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

RibbonBarButton OnClick reverts telerik values back to original

2 Answers 85 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 26 Sep 2012, 05:45 PM
Hi,

I believe this to be a bug in the ribbon bar (I am on version 2012.2.724.40).  I have a ribbon bar with a RibbonBarButton called "Save" on it.  When the user clicks save, all fields on the current screen are saved to the database.  However, I have found that for telerik fields on the screen (I've reproduced with RadNumericTextBox, RadTextBox, and RadDatePicker, see below code), if the user does not tab off of the field before clicking the ribbon bar button, that the value entered does not save and reverts back to the previous value.  This behavior does not occur if you use a regular asp.net button. My code to reproduce this is below, I have included a radnumerictextbox, raddatepicker, and a regular asp.net textbox.  The regular asp.net textbox always shows correctly, however the telerik ones do not.  If this is indeed a bug, is there a workaround until a fix is available?  I know it seems minor but we have customers who do much data entry, and little things like this can cause big issues.

The steps to reproduce are:
1.  Enter a value in the rad numeric textbox, say 50.  Tab off (or at least set focus somewhere else), then click 'save' in the ribbon bar.  The alert message shows '50' as expected.
2.  Now change the value to '100'.  Do not tab off the numeric textbox, but instead keep focus.  Click 'save' in the ribbon bar.  The alert shows '50' instead of '100', and the value reverts back to '50' in the textbox as well.

Thank you!
Richard

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadRibbonBar ID="BaseRibbonBar" runat="server" OnButtonClick="BaseRibbonBar_ButtonClick"
    EnableAjaxSkinRendering="true" Visible="true" Skin="Windows7">
    <telerik:RibbonBarTab Text="Basilisk">
        <telerik:RibbonBarGroup Text="Actions" Value="Actions">
            <Items>
                <telerik:RibbonBarButton Size="Large" Value="Save" Text="Save" ImageUrlLarge="~/save.png"
                    ImageUrl="~/Images/save.png" ToolTip="Save the current record" />
            </Items>
        </telerik:RibbonBarGroup>
    </telerik:RibbonBarTab>
</telerik:RadRibbonBar>
<telerik:RadAjaxPanel runat="server" ID="testPanel">
    <telerik:RadNumericTextBox ID="tbMonths" runat="server" Width="40px">
    </telerik:RadNumericTextBox>
    <telerik:RadDatePicker runat="server" ID="datepicker"></telerik:RadDatePicker>
    <asp:Button runat="server" ID="btnTest" OnClick="btnTest_Click" Text="Save" />
    <asp:TextBox runat="server" ID="Asptest"></asp:TextBox>
</telerik:RadAjaxPanel>

protected void btnTest_Click(object sender, EventArgs e)
{
    ScriptManager.RegisterStartupScript(this, GetType(), "Test", "alert('result is " + tbMonths.SelectedDate.ToString() + "');", true);
}
 
protected void BaseRibbonBar_ButtonClick(object sender, Telerik.Web.UI.RibbonBarButtonClickEventArgs e)
{
    ScriptManager.RegisterStartupScript(this, GetType(), "Test", "alert('ribbon result is " + tbMonths.Value.Value.ToString() + "');", true);
}

2 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 27 Sep 2012, 12:20 PM
Hi Richard,

This was indeed a bug in RadRibbonBar, which we fixed in the Q2 2012 SP2 version of the controls ( as stated in the SP2 release notes ). So if you upgrade your controls you shouldn't experience this issue any more.
 
Greetings,
Bozhidar
the Telerik team
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 their blog feed now.
0
Richard
Top achievements
Rank 1
answered on 27 Sep 2012, 01:20 PM
Thank you Bozhidar, I'm sorry I didn't even realize a new release was out, I was thinking I had the latest.  I should have checked that first.

Thanks!
Tags
RibbonBar
Asked by
Richard
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Richard
Top achievements
Rank 1
Share this question
or