Hi,
I got a problem with tabbing through WebNumericEditors within a wizard. I have 4 WebNumericEditors and want to tab through each editor. First of all, the function actually works. But it takes more than 2 second to leave one editor and focus to next one. I tried some other ones like WebTextEdit or WebCurrencyEdit and they get focus easily right after TAB key pressed.
I hope someone can help me on this issue. Thanks in advance.
If that "tabmanager" is something which is set on server using Client/UniqueID or editor, then I am in doubt that it will work at all, because the id of actual input-field used by WebTextEdit does not match with ClientID. The element with that id is a hidden field and designed to support MS Validators.
If you need to modify behavior on tab (or any other key), then you should use ClientSideEvent.KeyDown. Example below will circle focus on Tab in loop between 3 editors.
<script type="text/javascript" id="igClientScript">function WebMaskEdit1_KeyDown(oEdit, keyCode, oEvent){ if(keyCode != 9) return; var newFocusID = null; oEvent.cancel = true; if(oEdit.ID == 'WebMaskEdit1') newFocusID = 'WebNumericEdit1'; else if(oEdit.ID == 'WebNumericEdit1') newFocusID = 'WebDateTimeEdit1'; else if(oEdit.ID == 'WebDateTimeEdit1') newFocusID = 'WebMaskEdit1'; if(newFocusID) igedit_getById(newFocusID).focus();}</script>
<igtxt:WebMaskEdit ID="WebMaskEdit1" runat="server"> <ClientSideEvents KeyDown="WebMaskEdit1_KeyDown" /></igtxt:WebMaskEdit><igtxt:WebNumericEdit ID="WebNumericEdit1" runat="server"> <ClientSideEvents KeyDown="WebMaskEdit1_KeyDown" /></igtxt:WebNumericEdit><igtxt:WebDateTimeEdit ID="WebDateTimeEdit1" runat="server"> <ClientSideEvents KeyDown="WebMaskEdit1_KeyDown" /></igtxt:WebDateTimeEdit>
Hi Viktor,
No, I just want my application has the following ability: When user hit button 'Tab' on keyboard, caret will move from one text editor to another one.
FYI, I took a look at other pages and found tabbing function works fine, but not in this page.
I tested those codes and I did not find problems. WebTextEdit does not raise exception if script handlers are missing, so ClientSideEvents properties do not bring problems.
You mentioned a tab-wizard, maybe problem in that object.
Thanks for replying. I followed your hints and saw the test application works fine. Kinda weird here... I thought the bug appears because my editors have some client-side events such as TextChanged or ValueChange so I removed them, but that didn't fix.
I post my code here for reference.
<ig:WebDialogWindow ID="wd" runat="server" Height="300px" Width="580px" Modal="true" InitialLocation="Centered" BorderWidth="0" BorderColor="#BEDCFF" BorderStyle="None" BackColor="#BEDCFF"> <Header Font-Size="8pt" Font-Bold="True" Height="22px" CaptionAlignment="Left" ImageCssClass="icon" CaptionText="My WebDialog" CaptionTextCssClass="wizardCaption" ForeColor="Black" Font-Names="Tahoma"> </Header>
<ContentPane BackColor="#BEDCFF" BorderColor="#BEDCFF" ScrollBars="Hidden"> <Template>
<asp:UpdatePanel ID="upn" runat="server" UpdateMode="Conditional" RenderMode="Block"> <ContentTemplate>
<igtxt:WebNumericEdit ID="txtTop" runat="server" MaxLength="4" DataMode="Int" MinValue="0" AutoPostBack="false"> <ClientSideEvents ValueChange="txtTop_ValueChange" TextChanged="txtTop_TextChanged" /> </igtxt:WebNumericEdit>
<igtxt:WebNumericEdit ID="txtBottom" runat="server" MaxLength="4" DataMode="Int" MinValue="0" AutoPostBack="false"> <ClientSideEvents ValueChange="txtBottom_ValueChange" TextChanged="txtBottom_TextChanged" /> </igtxt:WebNumericEdit>
</ContentTemplate> </asp:UpdatePanel> </Template> </ContentPane></ig:WebDialogWindow>
It sounds strange. The WebNumericEdit and WebCurrencyEdit is exactly same control on client and both should work by exactly same way.
Long delay probably means a long or "dead" loop or invisible (async postback) or a hidden exception. That problem can be anywhere including internal logic of editor. Try to debug by building a temporary page which contains only editors without any extra unrelated codes and see how it works. You also can try to process ClientSideEvents of editors (focus/blur/etc), set break points (debugger;) in those handlers and check flow of logic before (stack) and after those events.