singleclick function into radwindow

8 posts, 0 answers
  1. Luigi
    Luigi avatar
    17 posts
    Member since:
    Dec 2006

    Posted 17 Jul 2013 Link to this post

    Hi all,
      i have some issue about singleclick function used in radbutton.

    i have one radwindow with few textbox under validation and one radbutton used by confirm value (a classic form into radwindow :-) ).

     i need use singleclick function but if validation field fail (for example because some text was empty), my radbutton remain pressed, and i cannot reconfirm my form.

    pls help me, tnk

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 18 Jul 2013 Link to this post

    Hi Luigi,

    Try the following code snippet to achieve the required scenario.
    aspx:
    <telerik:RadButton ID="btnValidate" runat="server" Text="Validate" SingleClick="true"
       OnClientClicked="OnClientClicked">
    </telerik:RadButton>
    JS:
    <script type="text/javascript">
        function OnClientClicked(sender, args) {
            var raddate = $find('<%=RadDatePicker1.ClientID %>');
            if (raddate.get_dateInput()._text.length != 0)
                sender.set_enabled(true);
            else
                args._domEvent.preventDefault();
            return false;
        }
    </script>

    Thanks,
    Shinu
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Luigi
    Luigi avatar
    17 posts
    Member since:
    Dec 2006

    Posted 18 Jul 2013 Link to this post

    Hi, tnk fro your reply.
    my scenario is a bit different.

    i have few control under validation (not only one)
    and my control (like textbox, date, etc...) are create dinamically from code behind.

    in one case i put into my radwindow only textbox
    in one case i put into my radwindow textbox and datepicker
    I create my form dinamically for each occasion, depend from previous choose.

    all control added dinamically are into one  <asp:panel />

    can u help me one more time ?

    tnk
  5. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 19 Jul 2013 Link to this post

    Hey Luigi,

    I believe Telerik fixed this issue in their latest controls. The way I achieved it before was by doing the following:

    function OnClientClicking(sender, args) {
       if(!Page_IsValid) {
          args.set_cancel(true);
       }
    }

    I hope that helps.

    Kevin
  6. Luigi
    Luigi avatar
    17 posts
    Member since:
    Dec 2006

    Posted 19 Jul 2013 Link to this post

    hi, this fix do not work because "Page_isvalid" check the main page, not telerik window.

    Page_isvalid is ever true, though my telerik window have some control without a value.
    Result is: radbutton remain pressed, and my web page are lock because some control do not pass validation.

    can u help me? tnk
  7. Luigi
    Luigi avatar
    17 posts
    Member since:
    Dec 2006

    Posted 22 Jul 2013 Link to this post

    Hi,
      ok pageisvalid run well.

    but my radbutton do not return in enable state and with do not return with original text (remail ever pressed)
    need add other ajax object?

    can u help me?
    tnk

  8. Luigi
    Luigi avatar
    17 posts
    Member since:
    Dec 2006

    Posted 25 Jul 2013 Link to this post

    Any answer :-( ?
    Help me please 
  9. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1493 posts

    Posted 30 Jul 2013 Link to this post

    Hi Luigi,

    I have tried to reproduce the mentioned issue of persisting the disabled state of the SingleClick RadButton, when the Page validation is not passed, but to no avail. Could you please watch the short video I have attached and then tell me what I am missing with the test?

    Could you please try to reproduce the unexpected behavior with the attached VS example and then tell us what changes you have made, so that we can make an investigation locally?

    Could you also confirm whether your version of RadControls is the latest one - 2013.2.717 and if not, does upgrading to it resolve it?

    Note also that there is an issue with the persistence of the disabled state of SingleClick RadButton when its AutoPostBack property is set to false on the client. The issue has been logged as a feedback item here, and you can monitor, comment and vote on it.


    Regards,
    Danail Vasilev
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017