|
Rank: Advanced Member Groups: Member
Joined: 8/24/2007 Posts: 130
|
Hi,
I am using the Tabstrip control in "load on demand" configuration. It uses a callback panel to refresh the tab contents.
The problem I am having is that the controls it hosts use sever side validation. In the event that server validation fails for a tab, I would like that tab to remain visible rather than the selected tab.
I have found no way to do this currently. Please could you advise.
Regards, Phil
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
By the time the page is posted back to the server, the tab item has already been switched. You can render a small piece of JavaScript code to bring the selection back to the previous item but the user will see the tab button switches and then switches back.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 8/24/2007 Posts: 130
|
Hi, What would the javascript code look like. I have tried doing this, and have not managed to get it to work. The relevant part of my aspx code is shown below. If "IsValid" is set to false on CallbackPanelMain_Execute, I need it to revert back to the original tab. What javascript would I use in this case? (note that TabstripControl and TabItemControl are simple wrappers around the Essential Objects controls)
Code: HTML/ASPX
<form id="Form1" method="post" runat="server">
<script type="text/javascript">
function switchTab(e, info) {
eo_Callback('<%=CallbackPanelMain.ClientID%>', info.getItem().getIndex().toString());
}
</script>
<HEADER:iipayheader ID="iipHeader" runat="server"></HEADER:iipayheader>
<asp:PlaceHolder ID="phMenus" runat="server"></asp:PlaceHolder>
<div class="width750 centred">
<div class="alignCentre">
<stdcontrols:ErrorLabel ID="lblEmployeeEndedWarning" Visible="false" runat="server"
TextID="Text_EmployeeEndedWarning"></stdcontrols:ErrorLabel>
</div>
<div class="paddedLeft20">
<stdcontrols:SuccessLabel ID="lblSuccess" runat="server"></stdcontrols:SuccessLabel>
</div>
<div class="paddedLeft20">
<stdcontrols:ErrorLabel ID="lblError" runat="server"></stdcontrols:ErrorLabel>
</div>
<div class="paddedLeft20 paddedBottom2">
<stdcontrols:WarningLabel ID="lblWarning" runat="server"></stdcontrols:WarningLabel>
</div>
<stdcontrols:TabstripControl runat="server" ID="detailsTabStrip" Width="100%" ControlSkinID="None"
ClientSideOnItemClick="switchTab" CausesValidation="true">
<TopGroup>
<Items>
<stdcontrols:TabItemControl TitleId="EmployeeDetails_aspx_BasicDetails1" ItemID="BasicDetails1" />
<stdcontrols:TabItemControl TitleId="EmployeeDetails_aspx_AddressDetails" ItemID="AddressDetails" />
<stdcontrols:TabItemControl TitleId="EmployeeDetails_aspx_BankDetails" ItemID="AccountDetails" />
<stdcontrols:TabItemControl TitleId="EmployeeDetails_aspx_CountrySpecific" ItemID="CountrySpecific" />
<stdcontrols:TabItemControl TitleId="EmployeeDetails_aspx_SelfService" ItemID="SelfService"
DisplayDirectiveString="UiDisplayDirectiveGlobal.SELF_SERVICE" />
</Items>
</TopGroup>
</stdcontrols:TabstripControl>
<div class="empDetailsTabContainer standardBorderRight standardBorderLeft standardBorderBottom standardBackground">
<eo:CallbackPanel runat="server" ID="CallbackPanelMain" Width="100%" Height="100%"
OnExecute="CallbackPanelMain_Execute">
<div id="pageViewBasicDetails" runat="server">
<table class="basicDetails">
<tr>
<td class="label">
<stdcontrols:StandardLabel ID="lblTitle" runat="server" TextID="EmployeeDetails_aspx_Title"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td colspan="2">
<stdcontrols:StandardTextBox Width="200px" ID="txtTitle" runat="server" MaxLength="20" Mandatory="true"></stdcontrols:StandardTextBox>
</td>
<td class="validator">
<stdcontrols:AnnotationLabel ID="errTitle" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
<td class="label">
<stdcontrols:StandardLabel ID="lblStartDate" runat="server" TextID="EmployeeDetails_aspx_StartDate"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td>
<stdcontrols:DateControl ID="calStartDate" runat="server" MandatoryBorder="true">
</stdcontrols:DateControl>
</td>
<td>
</td>
</tr>
<tr>
<td class="label">
<stdcontrols:StandardLabel ID="lblForenames" runat="server" TextID="EmployeeDetails_aspx_Forenames"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td colspan="2">
<stdcontrols:StandardTextBox Width="200px" ID="txtForenames" runat="server" MaxLength="50" Mandatory="true"></stdcontrols:StandardTextBox>
</td>
<td class="validator">
<stdcontrols:AnnotationLabel ID="errForenames" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
<td class="label">
<stdcontrols:StandardLabel ID="lblEndDate" runat="server" TextID="EmployeeDetails_aspx_EndDate"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td>
<stdcontrols:DateControl ID="calEndDate" runat="server">
</stdcontrols:DateControl>
</td>
<td>
</td>
</tr>
<tr>
<td class="label">
<stdcontrols:StandardLabel ID="lblSurname" runat="server" TextID="EmployeeDetails_aspx_Surname"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td colspan="2">
<stdcontrols:StandardTextBox Width="200px" ID="txtSurname" runat="server" MaxLength="50" Mandatory="true"></stdcontrols:StandardTextBox>
</td>
<td class="validator">
<stdcontrols:AnnotationLabel ID="errSurname" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
<td class="label">
<stdcontrols:StandardLabel ID="lblEmail" runat="server" TextID="EmployeeDetails_aspx_Email"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td>
<stdcontrols:StandardTextBox Width="200px" ID="txtEmail" runat="server" MaxLength="60"></stdcontrols:StandardTextBox>
</td>
<td>
<stdcontrols:AnnotationLabel ID="errEmail" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
</tr>
<tr>
<td class="label">
<stdcontrols:StandardLabel ID="lblKnownAs" runat="server" TextID="EmployeeDetails_aspx_KnownAs"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td colspan="2">
<stdcontrols:StandardTextBox Width="200px" ID="txtKnownAs" runat="server" MaxLength="50"></stdcontrols:StandardTextBox>
</td>
<td class="validator">
<stdcontrols:AnnotationLabel ID="errAlias" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
<td class="label">
<stdcontrols:StandardLabel ID="lblTelNo" runat="server" TextID="EmployeeDetails_aspx_Telno"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td>
<stdcontrols:StandardTextBox Width="200px" ID="txtTelNo" runat="server" MaxLength="20"></stdcontrols:StandardTextBox>
</td>
<td>
<stdcontrols:AnnotationLabel ID="errTelNo" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
</tr>
<tr>
<td class="label">
<stdcontrols:StandardLabel ID="lblEmpNo" runat="server" TextID="EmployeeDetails_aspx_EmpNo"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td colspan="2">
<stdcontrols:StandardTextBox Width="200px" ID="txtEmpNo" runat="server" MaxLength="15" Mandatory="true"></stdcontrols:StandardTextBox>
</td>
<td class="validator">
<stdcontrols:AnnotationLabel ID="errEmpNo" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
<td class="label">
<stdcontrols:StandardLabel ID="lblExt" runat="server" TextID="EmployeeDetails_aspx_Ext"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td>
<stdcontrols:StandardTextBox Width="200px" ID="txtExt" runat="server" MaxLength="20"></stdcontrols:StandardTextBox>
</td>
<td>
<stdcontrols:AnnotationLabel ID="errExt" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
</tr>
<tr>
<td class="label">
<stdcontrols:StandardLabel ID="lblGender" runat="server" TextID="EmployeeDetails_aspx_Gender"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td colspan="2">
<stdcontrols:StandardDropDown ID="ddGender" Width="200px" runat="server"></stdcontrols:StandardDropDown>
</td>
<td class="validator">
<stdcontrols:AnnotationLabel ID="errGender" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
<td class="label">
<stdcontrols:StandardLabel ID="lblFax" runat="server" TextID="EmployeeDetails_aspx_Fax"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td>
<stdcontrols:StandardTextBox Width="200px" ID="txtFax" runat="server" MaxLength="20"></stdcontrols:StandardTextBox>
</td>
<td>
<stdcontrols:AnnotationLabel ID="errFax" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
</tr>
<tr>
<td class="label">
<stdcontrols:StandardLabel ID="lblDOB" runat="server" TextID="EmployeeDetails_aspx_DOB"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td>
<stdcontrols:DateControl ID="calDOB" enablevalidation="false" runat="server" MandatoryBorder="true">
</stdcontrols:DateControl>
</td>
<td class="age">
<asp:Label ID="lblAgeNumber" runat="server" CssClass="black"></asp:Label>
</td>
<td class="validator"></td>
<td class="label">
<stdcontrols:StandardLabel ID="lblSecurityGroup" runat="server" TextID="EmployeeDetails_aspx_SecurityGroup"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td>
<stdcontrols:StandardDropDown Width="200px" ID="ddSecurityGroup" runat="server" EmptyRecordText="Text_SecurityGroupGlobal">
</stdcontrols:StandardDropDown>
</td>
<td>
<stdcontrols:AnnotationLabel ID="errSecurityGroup" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
</tr>
<tr>
<td class="label">
<stdcontrols:StandardLabel ID="lblDeceased" runat="server" TextID="EmployeeDetails_aspx_Deceased"
CssClass="smallFont"></stdcontrols:StandardLabel>
</td>
<td>
<asp:CheckBox ID="chkDeceased" runat="server"></asp:CheckBox>
</td>
<td colspan="5">
<stdcontrols:AnnotationLabel ID="errDeceased" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
</tr>
</table>
</div>
<div id="pageviewAddresses" runat="server" visible="false">
<eo:CallbackPanel ID="callbackAddresses" Width="100%" runat="server" Triggers="{ControlID:btnNewAddress;Parameter:},{ControlID:chkHideObsoleteAddresses;Parameter:}">
<div class="width100pc paddedBottom10">
<div class="width200 floatLeft">
<stdcontrols:StandardCheckBox ID="chkHideObsoleteAddresses" runat="server" Checked="true"
TextID="Text_HideObsolete" AutoPostBack="true" />
</div>
<div class="width200 floatRight alignRight">
<stdcontrols:StandardLinkButton ID="btnNewAddress" runat="server" CausesValidation="false"
TextID="EmployeeDetails_aspx_AddNewAddress" OnClick="btnNewAddress_Click" />
</div>
</div>
<div class="paddedTop15">
<asp:PlaceHolder ID="phAddresses" runat="server"></asp:PlaceHolder>
</div>
</eo:CallbackPanel>
</div>
<div id="pageViewBankAccounts" runat="server" visible="false">
<eo:CallbackPanel ID="callbackAccounts" runat="server" Width="100%" Triggers="{ControlID:btnNewBankAccount;Parameter:},{ControlID:chkHideObsoleteAccounts;Parameter:}">
<div class="width100pc paddedBottom10">
<div class="width200 floatLeft">
<stdcontrols:StandardCheckBox ID="chkHideObsoleteAccounts" runat="server" Checked="true"
TextID="Text_HideObsolete" AutoPostBack="true" />
</div>
<div class="width200 floatRight alignRight">
<stdcontrols:StandardLinkButton ID="btnNewBankAccount" runat="server" CausesValidation="false"
TextID="EmployeeDetails_aspx_AddNewAccount" OnClick="btnNewBankAccount_Click" />
</div>
</div>
<div class="paddedTop15">
<asp:PlaceHolder ID="phBankAccounts" runat="server"></asp:PlaceHolder>
</div>
</eo:CallbackPanel>
</div>
<div id="pageviewECS" runat="server" visible="false">
<asp:Table ID="tblCountrySpecific" runat="server" CssClass="empDetailsCSTable" />
</div>
<div id="pageviewSelfService" runat="server" visible="false" class="centred width500 marginTop40">
<div class="marginBottom5">
<asp:Image ID="imgSelfService" runat="server" />
<stdcontrols:StandardLabel ID="lblSelfServiceStatus" runat="server" Font-Bold="true"></stdcontrols:StandardLabel>
</div>
<div id="divSSInstruction" visible="false" runat="server">
<stdcontrols:StandardLabel ID="lblSelfServiceInstruction" runat="server"></stdcontrols:StandardLabel>
</div>
<div>
<table>
<tr>
<td class="paddedRight8 noWrap paddedTop15">
<stdcontrols:StandardLabel ID="lblSSEmail" runat="server"></stdcontrols:StandardLabel>
</td>
<td class="paddedTop15">
<stdcontrols:StandardTextBox ID="txtSSEmail" runat="server" MaxLength="60" Width="250px"></stdcontrols:StandardTextBox>
<stdcontrols:StandardLabel ID="lblSSEmailValue" runat="server" ForeColor="Black"></stdcontrols:StandardLabel>
</td>
<td class="paddedTop15">
<stdcontrols:AnnotationLabel ID="annSSEmail" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
</tr>
<tr id="trSSEmailConfirm" runat="server">
<td class="paddedRight8 noWrap paddedTop8">
<stdcontrols:StandardLabel ID="lblSSEmailConfirm" runat="server" TextID="EmployeeDetails_aspx_ConfirmEmail"></stdcontrols:StandardLabel>
</td>
<td class="paddedTop8">
<stdcontrols:StandardTextBox ID="txtSSEmailConfirm" runat="server" MaxLength="60"
Width="250px"></stdcontrols:StandardTextBox>
</td>
<td class="paddedTop8">
<stdcontrols:AnnotationLabel ID="annSSEmailConfirm" runat="server" Visible="false">*</stdcontrols:AnnotationLabel>
</td>
</tr>
</table>
</div>
<div class="paddedTop15">
<stdcontrols:StandardButton ID="btnSelfService" runat="server" CausesValidation="false"
Width="120" OnClick="btnSelfService_Click"></stdcontrols:StandardButton>
<stdcontrols:StandardButton ID="btnSSReset" runat="server" CausesValidation="false"
Width="120" TextID="EmployeeDetails_aspx_SSReset" OnClick="btnSSReset_Click">
</stdcontrols:StandardButton>
</div>
</div>
</eo:CallbackPanel>
</div>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, The JavaScript code would be something like this:
Code: JavaScript
eo_GetObject("detailsTabStrip").setSelectedIndex(newIndex);
You will need to call such code after the callback is done. There are multiple ways to do that: one way is to use the CallbackPanel's ClientSideAfterUpdate event; Another way is to simply place a Label inside your CallbackPanel and then set that Label's Text to something like:
Code: HTML/ASPX
<script type='text/javascript'>your script code here...</script>
Hope this helps. Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 8/24/2007 Posts: 130
|
That's fixed it. Thank you.
|
|