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

Button with ContentTemplate RadConfirm callback in Firefox

2 Answers 97 Views
Button
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 19 Apr 2017, 08:08 PM

I work on a large website that has many RadButtons with ContentTemplates, and uses a RadConfirm and callback functionality to confirm the user action and perform a PostBack.  Recently, someone noticed that the JavaScript code inside the callback sender.click() does not work in Firefox.

This is a known bug, as documented here LINK

Great, so I've set about adding the Firefox-specific workaround, as seen in this demo.  LINK

if (shouldSubmit) {
          //initiate the original postback again
          sender.click();
            if (Telerik.Web.Browser.ff) {
                sender.get_element().click();
          }
}

 

Which works fine with normal RadButtons.  But, I've found if the RadButton has a <ContentTemplate> declared, the postback is not executed, and the confirm keeps calling the OnClientClicking method which opens the RadConfirm again.

I've copied the code from this Demo into my own test page and reproduced the issue, it is very simple to reproduce.  Simply add a ContentTemplate to the second button.

<telerik:RadButton RenderMode="Lightweight" ID="btnRadConfirm" runat="server" Text="RadConfirm" OnClientClicking="RadConfirm" OnClick="Button_Click">
  <ContentTemplate>
     Template
   </ContentTemplate>         
</telerik:RadButton>

 

And now the confirmation cannot cause a postback in Firefox.  We are using Telerik version 2016.2.607.45

2 Answers, 1 is accepted

Sort by
0
Joe
Top achievements
Rank 1
answered on 25 Apr 2017, 02:41 PM
6 days and no answer, looks like I'll go through the official support channels then.
0
Sean
Top achievements
Rank 1
answered on 01 May 2017, 05:56 PM
Telerik's official answer for this is to use the RadPushButton instead of the RadButton for RadConfirm functionality.  This makes the confirm callback work in Firefox.  The RadPushButton does not support some RadButton functionality like ToggleStates, so be warned.
Tags
Button
Asked by
Joe
Top achievements
Rank 1
Answers by
Joe
Top achievements
Rank 1
Sean
Top achievements
Rank 1
Share this question
or