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

DefaultButton problem

7 Answers 59 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Chen
Top achievements
Rank 1
Chen asked on 15 Jan 2011, 01:35 AM
I have a tabstrip with a multipage.
I specified a default button in one of the pages:
<telerik:RadPageView CssClass="TabPageView" runat="server" ID="PageView5"
DefaultButton="ButtonSearchPerson">
<table>
  <tr>
    <td>
<telerik:RadTextBox ID="RadTextBoxSearchPerson" runat="server"
EmptyMessage="Search person by ID or url" MaxLength="50" Rows="1"
SelectionOnFocus="SelectAll" Width="155px">
</telerik:RadTextBox>
        <asp:Button ID="ButtonSearchPerson" runat="server" OnClick="ButtonSearchPerson_Click"
Text="Search" />
...

Nothing special.
When I click inside the textbox (in this pageview) I expect the default button to fire.
Instead a button from the first page fires (with a different ID).
Am I doing anything wrong here?
Any advice?

7 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 17 Jan 2011, 11:29 AM
Hello Chen,

Can you send us the entire code of your implementation so we can create a working sample locally and test it?

Note that the default button will fire when you press the 'enter' key. Here is how I tested the scenario, but it behaved as expected:

<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="1">
      <telerik:RadPageView CssClass="TabPageView" runat="server" ID="RadPageView1" DefaultButton="ButtonSearchPerson">
          <table>
              <tr>
                  <td>
                      <telerik:RadTextBox ID="RadTextBox1" runat="server" EmptyMessage="Search person by ID or url"
                          MaxLength="50" Rows="1" SelectionOnFocus="SelectAll" Width="155px">
                      </telerik:RadTextBox>
                      <asp:Button ID="Button1" runat="server" Text="Search" onclick="Button1_Click" />
                  </td>
              </tr>
          </table>
      </telerik:RadPageView>
      <telerik:RadPageView CssClass="TabPageView" runat="server" ID="PageView5" DefaultButton="ButtonSearchPerson">
          <table>
              <tr>
                  <td>
                      <telerik:RadTextBox ID="RadTextBoxSearchPerson" runat="server" EmptyMessage="Search person by ID or url"
                          MaxLength="50" Rows="1" SelectionOnFocus="SelectAll" Width="155px">
                      </telerik:RadTextBox>
                      <asp:Button ID="ButtonSearchPerson" runat="server" Text="Search" OnClick="ButtonSearchPerson_Click" />
                  </td>
              </tr>
          </table>
      </telerik:RadPageView>
  </telerik:RadMultiPage>


protected void ButtonSearchPerson_Click(object sender, EventArgs e)
  {
      Response.Write("Button from second page fired");
  }
  protected void Button1_Click(object sender, EventArgs e)
  {
      Response.Write("Button from first page fired");
  }


Regards,
Peter
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Chen
Top achievements
Rank 1
answered on 17 Jan 2011, 11:54 AM
Sure. I'll submit a support ticket.
Note however, that you have the same default button for both pages. I have a default button per page.
0
Greg
Top achievements
Rank 1
answered on 10 Oct 2014, 08:01 PM
Having the same problem. I have multiple RadPageViews, each with a different default button.

Works OK in IE 11 and Safari 5.1.7

Does NOT work in Chrome 38.0.2125.101, Firefox 32.0.3 or Opera 24.0
0
Nencho
Telerik team
answered on 15 Oct 2014, 11:26 AM
Hello Greg,

I noticed that you had submitted a similar ticket ti this one in the following thread :

http://www.telerik.com/forums/radpageview-defaultbutton-in-firefox

Therefore, I would like to ask you to continue the conversion in the other thread, which I have already replied, in order to avoid duplication.

Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Greg
Top achievements
Rank 1
answered on 15 Oct 2014, 11:40 AM
Hi Nencho,

The version of controls I'm using is v4.0.30319.

My implementation is a bit more complex than your sample. I have a tabstrip/multipageview that contains 3 pageviews. Within each of these pageviews is a "child" tabstrip/multipageview that has 2-3 pageviews. It is in these child pageviews where the buttons are, along with various other controls such as textboxes, dropdowns and radgrids. I am guessing that the issue is to do with the fact that I have the nested multipageviews and pageviews. My workaround has been to set the Page.Form.DefaultButton property as needed.









0
KidSysco
Top achievements
Rank 1
answered on 27 Mar 2015, 01:35 PM
Yeap, same thing here. I am using 2014.3.1209.45.

The DefaultButton attribute in the Telerik:PageView tag is totally buggy acting when the Page View is used with a TabStrip. I get all sorts of goofiness depending on how I have things configured. Sometimes it throws JS errors, sometimes it fires all of the default button events when it should only fire one, as reported in this post by someone else. Also, I can even get it to fire the events of Filtering controls on a RadGrid in the same page.

However, by simply nesting more ASP panels and using the Default button attribute, everything is working perfectly.

What a mess. And please do not ask me to create a ticket and send in my code. That approach to the way Telerik supports me is very frustrating. I cannot take the time to rip apart my project to show you what is wrong with your controls. Rather, Telerik needs to test this stuff more rigorously. I have a job to do and I am already behind schedule.



0
Nencho
Telerik team
answered on 01 Apr 2015, 01:06 PM
Hello,

Did you try the workaround that Greg mentioned in the other thread - My workaround has been to set the Page.Form.DefaultButton property as needed.

http://www.telerik.com/forums/radpageview-defaultbutton-in-firefox

As for the mentioned ticket submission with a runnable sample attached - we request this, in order to efficiently assist you. Very often the encountered issues are caused by the implementation of our product and the different technique of usage, which are due to many reasons - business logic of the client's project, unification in the implementation etc.

However, we aim to pinpoint the issues and fix them without the need of such attachments, but sometimes this is not possible as we need to investigate the proper approach that the client is using.

Regards,
Nencho
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
TabStrip
Asked by
Chen
Top achievements
Rank 1
Answers by
Peter
Telerik team
Chen
Top achievements
Rank 1
Greg
Top achievements
Rank 1
Nencho
Telerik team
KidSysco
Top achievements
Rank 1
Share this question
or