DefaultButton problem

8 posts, 0 answers
  1. Chen
    Chen avatar
    46 posts
    Member since:
    Oct 2010

    Posted 14 Jan 2011 Link to this post

    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?
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 17 Jan 2011 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Chen
    Chen avatar
    46 posts
    Member since:
    Oct 2010

    Posted 17 Jan 2011 Link to this post

    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.
  5. Greg
    Greg avatar
    7 posts
    Member since:
    Apr 2012

    Posted 10 Oct 2014 Link to this post

    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
  6. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 15 Oct 2014 Link to this post

    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.

     
  7. Greg
    Greg avatar
    7 posts
    Member since:
    Apr 2012

    Posted 15 Oct 2014 in reply to Nencho Link to this post

    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.









  8. KidSysco
    KidSysco avatar
    10 posts
    Member since:
    Aug 2013

    Posted 27 Mar 2015 Link to this post

    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.



  9. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 01 Apr 2015 Link to this post

    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.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017