Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

How to focus on the first field in WebDialogWindow

Last post 08-28-2008 0:47 by Le Anh Sang. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-22-2008 1:06

    • Le Anh Sang
    • Top 500 Contributor
    • Joined on 12-20-2007
    • Hanoi, Vietnam
    • Points 285

    How to focus on the first field in WebDialogWindow

    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. 

     

     

    Regards,

    Sang
    • Post Points: 20
  • 08-27-2008 10:52 In reply to

    Re: How to focus on the first field in WebDialogWindow

    The following code will show a dialog window and call the focus method on the webtextedit in the iframe.

    var window = $find("WebDialogWindow1");

    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.

    • Post Points: 20
  • 08-28-2008 0:47 In reply to

    • Le Anh Sang
    • Top 500 Contributor
    • Joined on 12-20-2007
    • Hanoi, Vietnam
    • Points 285

    Re: How to focus on the first field in WebDialogWindow

    The code seems to run well. :)

    Thanks so much!

    Regards,

    Sang
    • Post Points: 5
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems