RadFormDecorator focus not working on IE7

12 posts, 0 answers
  1. Khanh
    Khanh avatar
    39 posts
    Member since:
    Jun 2008

    Posted 23 Jul 2008 Link to this post

    Hi,

    Using the RadFormDecorator (Q1 2008.1.619.20), setting the focus on any control on IE7 does not work but works as expected in Firefox.  Remove RadFormDecorator and IE7 works correctly.

    <body> 
        <form id="form1" runat="server"
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="Buttons" 
            Skin="Sunset" /> 
        <AjaxToolKit:ToolkitScriptManager EnablePartialRendering="true" ID="ScriptManager1" 
            runat="server" CombineScripts="true" /> 
        <div> 
            <br /> 
            <telerik:RadComboBox ID="RadComboBox1" runat="server" MarkFirstMatch="true"
                <Items> 
                    <telerik:RadComboBoxItem Value="" Text="" /> 
                    <telerik:RadComboBoxItem Value="1" Text="1" /> 
                    <telerik:RadComboBoxItem Value="2" Text="2" /> 
                </Items> 
            </telerik:RadComboBox> 
            <br /> 
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
            <asp:Button ID="button1" runat="server" Text="submit" CssClass="testx" /> 
        </div> 
        </form> 
    </body> 

    Protected Sub Page_PreRender(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.PreRender 
            ScriptManager.GetCurrent(Page).SetFocus(RadComboBox1) 
        End Sub 

    Is there any work around for this?
    Thanks,
    Khanh

  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 24 Jul 2008 Link to this post

    Hello Khanh,

    The problem here comes from the fact that the Focus function is executed too early - before the controls are shown (RadFormDecorator initially hides the inputs so it can decorate them). You can verify this by examining the HTML dump of the page:

    <script type="text/javascript"
    //<![CDATA[
        WebForm_AutoFocus('RadComboBox1_Input');Sys.Application.initialize();
    Sys.Application.add_init(function() {
        $create(Telerik.Web.UI.RadFormDecorator, {"clientStateFieldID":"RadFormDecorator1_ClientState","skin":"Default"}, null, null, $get("RadFormDecorator1"));
    });
    WebForm_InitCallback();Sys.Application.add_init(function() {
        $create(Telerik.Web.UI.RadComboBox, {"_dropDownWidth":0,"_height":0,"_skin":"Default","_text":"","_uniqueId":"RadComboBox1","_value":"","_virtualScroll":false,"clientStateFieldID":"RadComboBox1_ClientState","collapseAnimation":"{\"type\":12,\"duration\":200}","itemData":[{"selected":true},{"value":"1"},{"value":"2"}],"markFirstMatch":true,"selectedIndex":0}, null, null, $get("RadComboBox1"));
    });
    //]]> 
    </script> 


    What I can suggest is to either add the following style on your page:
    <style> 
        input, textarea, button 
        { 
            visibilityvisible !important; 
        }             
    </style>

    Which will however, make the decorated controls flicker when page is initially loaded.

    As an alternative you can call the autofocus function again when the controls are loaded:
    ScriptManager.GetCurrent(Page).SetFocus(RadComboBox1); 
     
    ScriptManager.RegisterClientScriptBlock(thisthis.GetType(), "focus"
        "function pageLoad(){ WebForm_AutoFocus('" + RadComboBox1.ClientID + "')}"true); 


    I hope this helps.





    Regards,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Khanh
    Khanh avatar
    39 posts
    Member since:
    Jun 2008

    Posted 24 Jul 2008 Link to this post

    Hi Georgi,

    Thanks for the quick reply and workaround.  Works perfectly.

    Khanh
  5. Lee Wilson
    Lee  Wilson avatar
    13 posts
    Member since:
    Sep 2007

    Posted 15 Oct 2008 Link to this post

    I tried the second method and it didn't work.

    Please can you show an example of how to implement this in a scenario where the scriptmanager is in a MasterPage, and the RadTextBox to focus is in a UserControl on the MasterPage.

    I cannot make changes to the CodeBehind to the MasterPage or the ContentPage.  I can make changes to the UserControl and it's CodeBehind.

    Thanks

    Lee.
  6. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 16 Oct 2008 Link to this post

    Hello Lee,

    The original question is related to RadComboBox while in your scenario you use RadTextBox.
    We are not sure which Telerik.Web.UI version you are using, but there was discovered a problem with RadFormDecorator coexisting on the same page with RadTextBox in IE only, when
    RadFormDecorator DecoratedControls = "All".

    We have a couple of suggestions to try out:

    1. Set
    <RadFormDecorator DecoratedControls = "Default" ....>

    or, alternatively


    2. Later today or tomorrow the Telerik Q3 Futures will be released (which is a public beta of the coming Q3 release). The IE interoperability issue has been fixed, and with the new release your
    RadTextBox should work OK with RadFormDecorator.

    Best regards,
    Tervel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Roland
    Roland avatar
    156 posts
    Member since:
    Feb 2009

    Posted 20 Apr 2009 Link to this post

    I have observed the same behaviour with Telerik.Web.UI 2008.3.1314.35. I have FormDecorador set to decorate Buttons only and the focus is set on text boxes
  8. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 22 Apr 2009 Link to this post

    Hello Roland,

    Please upgrade to a recent version of the control and you will not experience this problem anymore.

    Regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  9. Roland
    Roland avatar
    156 posts
    Member since:
    Feb 2009

    Posted 22 Apr 2009 Link to this post

    I have upgraded to 2009.1.402.35.

    RadFormDecorador set to decorade Buttons

    Form has radtextbox txt.Focus().

    When I load page and press tab, it goes to navigation bar in IE7 and works fine in FF3 (goes to next tabindex).

    Additionally Update panel does not show the image, but white spot.

    Removed the temporary asp.net files.
    Cleared browser cache.
  10. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 24 Apr 2009 Link to this post

    Hi Roland,

    I tried to reproduce the problem but to no avail (sample page and video capture are attached to this thread). Could you please open a support ticket and send me a small sample project where the problem could be reproduced? I will check it right away.


    Kind regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  11. Roland
    Roland avatar
    156 posts
    Member since:
    Feb 2009

    Posted 28 Apr 2009 Link to this post

    Thank you for the files.

    I have created test project from the scratch and the bug does not occurred anymore.

    After a short investigation, another of the 3rd party control were interfering somehow with scripts.

    Thank you for replies.
  12. Matt
    Matt avatar
    49 posts
    Member since:
    Jun 2012

    Posted 09 Nov 2012 Link to this post

    It's 2012 and even with the latest code, it still doesn't work.
  13. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1493 posts

    Posted 14 Nov 2012 Link to this post

    Hello Matt,

    Could you explain exactly what does not work at your side? Is that the focus event in the code behind or the proper displaying of the RadTextBox? Could you also confirm your browser and its version. I am asking because there were some issues related to RadFormDecorator and RadTextBox which have been fixed in the lastest internal build. Could you try using the latest internal build to see if you are still having issues:http://www.telerik.com/account/your-products/internal-builds.aspx?

    I am attaching VS example and video to show my scenario in the RadFormDecorator_focus.zip archive. If you are still having problems could you modify my page to show them and post it here so we can actually investigate the case?

    Regards,
    Danail Vasilev
    the Telerik team
    Explore the entire set of ASP.NET AJAX controls we offer here and browse the myriad online demos to learn more about the components and the features they incorporate.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017