RadTextBox text disappears on postback

23 posts, 0 answers
  1. Nishant
    Nishant avatar
    33 posts
    Member since:
    Jul 2012

    Posted 12 Jul 2013 Link to this post

    Hi,

    I've a RadTextBox inside a RadPageView working with a RadTabStrip control. When the user types in a value in it and, with the TextBox in focus, clicks on the next tab, then the changes inside this TextBox disappear (the blur does not happen).

    It appears to be an issue only in IE, I tried Chrome and it works great there. I'm using :

    ASP.NET Ajax : 2013.2.611.40
    Browser : IE 9

    Nishant
  2. Morten
    Morten avatar
    267 posts
    Member since:
    Jul 2012

    Posted 13 Jul 2013 Link to this post

    I have the same issue
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 17 Jul 2013 Link to this post

    Hello Nishant,

    I tried to replicate the described issue on my end but to no avail. Find attached the sample runnable application which demonstrates the correct behavior of this scenario and verify what the difference on your case is.

    Regards,
    Maria Ilieva
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  5. Nishant
    Nishant avatar
    33 posts
    Member since:
    Jul 2012

    Posted 17 Jul 2013 Link to this post

    Hi Maria,

    It may have something to do with the fact that the AutoPostBack of my tabstrip is set to True and I ajaxify the PageView on click of TabStrip using the RadAjaxManager. Here is an example where I've just modifed your sample a little bit reproduce the issue. If you run this markup, enter some text in TextBox1, and without hitting ENTER or TAB or clicking anywhere else, click on the 2nd tab, the changes made in the TextBox1 disappear !  What's interesting is that it happens in IE but not in Chrome :
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <title></title>
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadTabStrip ID="TabStrip" runat="server" SelectedIndex="0" MultiPageID="MultiPage"
            AutoPostBack="True" Width="95%">
            <Tabs>
                <telerik:RadTab runat="server" Text="General" Value="General" Selected="True">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Products" Value="Products">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="MultiPage" Width="100%" Height="550px" runat="server" SelectedIndex="0" RenderSelectedPageOnly="true">
            <telerik:RadPageView ID="GeneralPageView" runat="server">
                <telerik:RadTextBox ID="RadTextBox1" runat="server">
                </telerik:RadTextBox>
            </telerik:RadPageView>
            <telerik:RadPageView ID="ProductsPageView" runat="server">
                <telerik:RadTextBox ID="RadTextBox2" runat="server">
                </telerik:RadTextBox>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
        <telerik:RadAjaxManager ID="AjaxManager" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="TabStrip">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="TabStrip" />
                        <telerik:AjaxUpdatedControl ControlID="MultiPage" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        </form>
    </body>
    </html>
  6. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 22 Jul 2013 Link to this post

    Hello Nishant,

    In order to submit the RadTextBox value to the server and keep it when the tab selection is changed you should firstly blur the control before the tab i posting to the server. Therefore would suggest you manually call blur() for the RadTextBox control in the "OnClientTabSelecting" client event. Give this a try and verify if ti helps.

    Regards,
    Maria Ilieva
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  7. Nishant
    Nishant avatar
    33 posts
    Member since:
    Jul 2012

    Posted 27 Jul 2013 Link to this post

    Hi Maria,

    There are dozens of TextBoxes on each tab, and I can't hardcode the names of those textboxes in the OnClientTabSelecting event. Is there a way to determine the active textbox name at runtime and call its blur method ?

    I tried the below code in the OnRequestStart of RadAjaxManager :
    if (document.activeElement.tagName.toLowerCase() == "input")
     document.activeElement.blur();


    But still doesn't work !!

    Also, why does it specifically happen for the RadTabStrip ? There is no problem when I click a RadButton that's Ajaxified as well.


    Nishant

  8. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 31 Jul 2013 Link to this post

    Hello,

    Could you please try to set the AutoPostBack property of the text box controls to "true" and very how this works? This should make the input to submit its value to the server and the presented behavior should not appear.

    Regards,
    Maria Ilieva
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  9. JM
    JM avatar
    4 posts
    Member since:
    Mar 2009

    Posted 01 Aug 2013 Link to this post

    Hi,
    I have same problem with our application as Nishant after upgrade to version 2013.2.611.40, 
    it happens in Firefox, not in Chrome.
  10. JM
    JM avatar
    4 posts
    Member since:
    Mar 2009

    Posted 01 Aug 2013 Link to this post

    Latest version 2013_2_730 same result...
  11. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 05 Aug 2013 Link to this post

    Hello JM,

    Could you please let me know if you have tested the AutoPostback property of the RadTextBox control? What the result on your end is in case it is set to "true"?

    Regards,
    Maria Ilieva
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  12. Sasa
    Sasa avatar
    25 posts
    Member since:
    Jul 2013

    Posted 23 Aug 2013 Link to this post

    Same here on FireFox, and with AutoPostBack set to true...

    Any other solution?

    Thanks
  13. Nishant
    Nishant avatar
    33 posts
    Member since:
    Jul 2012

    Posted 23 Aug 2013 Link to this post

    Hi Maria,

    Adding AutoPostBack=True to the RadTextBox introduces another problem. When i click on another Tab after entering a value in the RadTextBox, the PageView changes to another tab's PageView, but on the TabStrip it still shows the Old Tab.

    Also, adding AutoPostBack=True to dozens of TextBoxes on every tab is not a viable solution for an enterprise application used by thousands of users, as it will cause unnecessary roundtrips to the server and reduce application performance.

    I also tried hardcoding the blur() for 1 control, but that doesn't work either !

    <telerik:RadTabStrip ID="TabStrip" runat="server" SelectedIndex="0" MultiPageID="MultiPage"
        OnClientTabUnSelected="onTabUnselected" OnClientTabSelecting="onTabSelecting"
        AutoPostBack="true" CausesValidation="false" OnTabClick="TabStrip_TabClick" Width="95%">


    function onTabSelecting(sender, args) {
                    $find("<%= OfferNameTextBox.ClientID %>").blur();
                }


    Nishant
  14. Nishant
    Nishant avatar
    33 posts
    Member since:
    Jul 2012

    Posted 25 Aug 2013 Link to this post

    Hi,

    It is clearly an issue introduced in v2013.2.611.40, as this issue can not be reproduced with the earlier versions. Please suggest if this issue has been listed in the Telerik Bug Tracker and provide an estimated date of resolution.

    Also, provide a viable workaround, because this issue is now becoming a showstopper for several .NET projects in my company that uses Telerik Controls. We can't even roll back to a previous version, because that'd bring up several other issues resolved by this release.

    Regards,
    Nishant
  15. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 27 Aug 2013 Link to this post

    Hi Nishant,

    The issue you are facing is already fixed and the fix is available in the latest internal build of the controls. Please download the dll files form the latest internal build and verify if this works for you. Do let us know if any other issues with the new dll's appear.

    Regards,
    Maria Ilieva
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  16. Sasa
    Sasa avatar
    25 posts
    Member since:
    Jul 2013

    Posted 27 Aug 2013 Link to this post

    Hi Maria,

    I have last release version 2013.2.717.45 and still have issue only in Firefox. How can I blur focused textbox?

    Thanks
  17. Jeremy
    Jeremy avatar
    4 posts
    Member since:
    Apr 2013

    Posted 28 Aug 2013 Link to this post

    I am also having this same issue. I upgraded from v.2013.1.417.40 to v.2013.2.717.40 to attempt to fix another issue (DropDownbox returning "" values when using arrow keys). That issue is fixed however everywhere in my application were I lookup user or address information with a RADAutoComplete box and return the substring information to RadTextBoxes with Javescript I am required to click into each RadTextBox in order for the blur() event to trigger. This was not the case with the previous version. If I replace the RadTextBox with an ASP:TextBox the functionality works as expected.
  18. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 29 Aug 2013 Link to this post

    Hi Jeremy,

    Please try using the 2013.2.828.40 version of the controls which is actually the latest internal build and verify how it goes.


    Regards,
    Maria Ilieva
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  19. Jeremy
    Jeremy avatar
    4 posts
    Member since:
    Apr 2013

    Posted 29 Aug 2013 Link to this post

    Hi Maria, 
        Thank you for your reply. The latest internal build seems to have resolved this issue (and the Dropdown issue i had originally) . I ran through 99% of my program this morning with the new build applied. I will continue testing on my development server to verify everything else is working properly.

    Thank you for your assistance.
  20. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 03 Sep 2013 Link to this post

    Hello Jeremy,

    Thank you for getting back to us.

    I'm glad to hear that the latest internal build addressed the presented issue.
    Do let us know if any additional problems appear so that we could fix them for the upcoming releases.

    Regards,
    Maria Ilieva
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  21. Jeremy
    Jeremy avatar
    4 posts
    Member since:
    Apr 2013

    Posted 03 Sep 2013 Link to this post

    Maria,
    I have found one issue so far. I am using a RadDropDownTree in 2 places in my code with Checkboxes = "SingleClick". When a user clicks on the check box it selects the item but doesn't check the box (it shows in the Top Header above that it is selected). After selecting a individual record and closing the DropDown and re-opening it will show that record with the checkbox checked. Just not on your initial selection.  

    The Below code is one place where I am using the TreeView. The Second Place is similar with the difference being the
    e.DropDownTreeNode.Level == 0 is also ignoring the 2nd level (check boxes are on the 3rd Level down)

    1st instance ASPX

    <script type="text/javascript">
        function rddlTreeView_EntryAdded(sender, args) {
            sender.toggleDropDown();
        }
    function OnClientEntryAdding(sender, args) {
            sender.get_entries().clear();
        }
    </script>
     
    <!--Later in the Code -->
    <asp:Panel ID="pnl_AddIndv" runat="server" Width="500px" CssClass="PopUp" Visible="true"
            ScrollBars="None" BackColor="Transparent" BorderColor="Transparent" DefaultButton="ibSave">
     
    <telerik:RadDropDownTree ID="rddlTreeView" runat="server" OnNodeDataBound="rddlTreeView_NodeDataBound"
                                    ClientIDMode="Static" DefaultMessage="Select branch and rank..." CheckBoxes="SingleCheck"
                                    FullPathDelimiter="->" ExpandNodeOnSingleClick="True" OnClientEntryAdded="rddlTreeView_EntryAdded"
                                    OnClientEntryAdding="OnClientEntryAdding" Width="100%" DropDownSettings-AutoWidth="Enabled">
                                </telerik:RadDropDownTree>
    </asp:panel>

     

    1st instance C#

    protected void Page_Load(object sender, EventArgs e)
        {
           BindToDataTable(rddlTreeView);
        }
     
    private void BindToDataTable(RadDropDownTree treeView)
        {
            OracleConnection cnnOra = new OracleConnection(System.Configuration.ConfigurationManager.ConnectionStrings["CONNECTION NAME REMOVED"].ConnectionString);
            OracleDataAdapter adapter = new OracleDataAdapter();
            adapter.SelectCommand = new OracleCommand("SQL REMOVED", cnnOra);
            DataTable dataTable = new DataTable();
            adapter.Fill(dataTable);
     
            treeView.DataTextField = "RANK_LONG";
            treeView.DataValueField = "RANK_SHORT";
            treeView.DataFieldID = "ID";
            treeView.DataFieldParentID = "PARENT_ID";
            treeView.DataSource = dataTable;
            treeView.DataBind();
        }
     
    protected void rddlTreeView_NodeDataBound(object sender, DropDownTreeNodeDataBoundEventArguments e)
        {
            if (e.DropDownTreeNode.Level == 0)
                e.DropDownTreeNode.Checkable = false;
        }

    2nd instance C# (Page Load, ASPX and Bind Functions are the same)

    if (e.DropDownTreeNode.Level == 0 || e.DropDownTreeNode.Level == 1)
    e.DropDownTreeNode.Checkable = false;

    Let me know if you have any ideas or if you need more information.

    Thanks

  22. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 05 Sep 2013 Link to this post

    Hi Jeremy,

    In general the RadDropDownTree control is not designed in a way to check the nodes once the user clicks on a node of the tree. However, I can suggest that you get a reference to the tree in the drop down and set the node as checked as described here (or you can set the node as selected as described in details here).

    Regards,
    Kate
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  23. Jeremy
    Jeremy avatar
    4 posts
    Member since:
    Apr 2013

    Posted 06 Sep 2013 Link to this post

    Hi Kate,
    Perhaps I wasn't clear on what functionality I was referencing with the checkboxes in a RadDropDownTree.
    I have 2 instances of RadDropDownTree's on this project. Prior to updating to the current internal build as suggested above when a user would click on the the "checkbox" next to the node it would do what you would expect a checkbox to do and check the box. With the internal build when you click the check box it shows it is selected (has focus "dashed lines" around it) but does not "check" the actual box. After you close the  RadDropDownTree dropdown and reopen it the box is checked. This is not the behavior experienced with the previous version of the controls. While this still works in my code and the users are able to select the item and continue on, it is confusing when they click on a checkbox and it doesn't show the "check mark". I have attached some Screenshots.

    ScreenShot1.png
    I have clicked the checkbox next to “Brief Description” the top bar of the RadDropDownTree Reflect the correct information you can see that the checkbox has focus however there is no check mark in the box.
    ScreenShot2.png Here I have closed the Drop Down and my content has loaded into the RadEditor
    ScreenShot3.png
    This is a screenshot of after the content is loaded and I reopen the dropdown.
    At this point the user could select a different node but the functionality is still the same where the checkbox isn’t checked on initial check.

     

     

  24. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 11 Sep 2013 Link to this post

    Hello Nishant,

    I have tested the latest version of our code base and everything is working fine. Keep in mind that we are improving our code and it is possible to have some changes which are already fixed. Could you try to use the latest official version of our controls and let me know if everything is working fine - SP1 Q2. 2013. In case that the issue exists please specify the browser version that you are using.

    Regards,
    Peter Filipov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017