This is a migrated thread and some comments may be shown as answers.

RadTextBox text disappears on postback

22 Answers 571 Views
Input
This is a migrated thread and some comments may be shown as answers.
Nishant
Top achievements
Rank 1
Nishant asked on 12 Jul 2013, 07:23 PM
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

22 Answers, 1 is accepted

Sort by
0
Morten
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 13 Jul 2013, 10:32 AM
I have the same issue
0
Maria Ilieva
Telerik team
answered on 17 Jul 2013, 11:40 AM
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.
0
Nishant
Top achievements
Rank 1
answered on 17 Jul 2013, 03:35 PM
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>
0
Maria Ilieva
Telerik team
answered on 22 Jul 2013, 07:25 AM
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.
0
Nishant
Top achievements
Rank 1
answered on 27 Jul 2013, 05:57 AM
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

0
Maria Ilieva
Telerik team
answered on 31 Jul 2013, 11:27 AM
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.
0
JM
Top achievements
Rank 1
answered on 01 Aug 2013, 09:39 AM
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.
0
JM
Top achievements
Rank 1
answered on 01 Aug 2013, 11:41 AM
Latest version 2013_2_730 same result...
0
Maria Ilieva
Telerik team
answered on 05 Aug 2013, 02:51 PM
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.
0
Sasa
Top achievements
Rank 1
answered on 23 Aug 2013, 08:52 AM
Same here on FireFox, and with AutoPostBack set to true...

Any other solution?

Thanks
0
Nishant
Top achievements
Rank 1
answered on 23 Aug 2013, 03:59 PM
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
0
Nishant
Top achievements
Rank 1
answered on 25 Aug 2013, 04:47 PM
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
0
Maria Ilieva
Telerik team
answered on 27 Aug 2013, 11:18 AM
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.
0
Sasa
Top achievements
Rank 1
answered on 27 Aug 2013, 11:41 AM
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
0
Jeremy
Top achievements
Rank 1
answered on 28 Aug 2013, 09:06 PM
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.
0
Maria Ilieva
Telerik team
answered on 29 Aug 2013, 01:37 PM
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.
0
Jeremy
Top achievements
Rank 1
answered on 29 Aug 2013, 03:07 PM
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.
0
Maria Ilieva
Telerik team
answered on 03 Sep 2013, 11:52 AM
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.
0
Jeremy
Top achievements
Rank 1
answered on 03 Sep 2013, 03:42 PM

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

0
Kate
Telerik team
answered on 05 Sep 2013, 04:15 PM
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.
0
Jeremy
Top achievements
Rank 1
answered on 06 Sep 2013, 03:12 PM
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.

 

0
Peter Filipov
Telerik team
answered on 11 Sep 2013, 02:49 PM
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.
Tags
Input
Asked by
Nishant
Top achievements
Rank 1
Answers by
Morten
Top achievements
Rank 1
Iron
Iron
Veteran
Maria Ilieva
Telerik team
Nishant
Top achievements
Rank 1
JM
Top achievements
Rank 1
Sasa
Top achievements
Rank 1
Jeremy
Top achievements
Rank 1
Kate
Telerik team
Peter Filipov
Telerik team
Share this question
or