Hi all,
I have a WebdialogWindow, set ContentUrl="Wizards/AddCustomers.aspx" the AddCustomers.aspx page contains a Web tab, inside the tab I have some data fields (WebTextEdit controls) such as First Name, Last Name,...
When I click the left menu item, the Web dialog will be showed (WindowSate: Hidden to Normal) and I want the First Name field should be focused.
My Web Dialog:
<ig:WebDialogWindow ID="WebDialogWindow1" runat="server" Height="325px" Width="550px" Modal="true" WindowState="Hidden" MaintainLocationOnScroll="true" InitialLocation="Centered" StyleSetName="Default" BorderStyle="solid" BorderColor="transparent"> <ContentPane ContentUrl="Wizards/AddCustomers.aspx"> </ContentPane> <Header Height="25px" CaptionText="Add New Customer" ImageUrl="./images/uppermarkIcon32.ico" ImageCssClass="icon" CaptionAlignment="Left" Font-Bold="True" CaptionTextCssClass="wizardCaption" Font-Size="8pt" ></Header> </ig:WebDialogWindow>
I set the FocusOnInitialization of WebTextEdit to True, wrote JavaScript, Server side but not successful. :(
Anyone suggest the best solution to resolve this problem?
Please help me!
Thanks.
The code seems to run well. :)
Thanks so much!
The following code will show a dialog window and call the focus method on the webtextedit in the iframe.
window.set_windowState($IG.DialogWindowState.Normal);
var iframe = window.get_contentPane().get_iframe().contentWindow.igedit_getById("WebTextEdit1").focus();
You can use the following KB as a reference:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=6689
The "document.frame(int FrameIndex)" referenced in the article is the equivalent of "window.get_contentPane().get_iframe().contentWindow" in my code.