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

singleclick function into radwindow

7 Answers 73 Views
Button
This is a migrated thread and some comments may be shown as answers.
Luigi
Top achievements
Rank 1
Luigi asked on 17 Jul 2013, 09:41 PM
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

7 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 18 Jul 2013, 09:43 AM
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
0
Luigi
Top achievements
Rank 1
answered on 18 Jul 2013, 02:44 PM
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
0
Kevin
Top achievements
Rank 2
answered on 19 Jul 2013, 12:56 PM
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
0
Luigi
Top achievements
Rank 1
answered on 19 Jul 2013, 01:02 PM
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
0
Luigi
Top achievements
Rank 1
answered on 22 Jul 2013, 01:34 PM
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

0
Luigi
Top achievements
Rank 1
answered on 25 Jul 2013, 01:35 PM
Any answer :-( ?
Help me please 
0
Danail Vasilev
Telerik team
answered on 30 Jul 2013, 12:07 PM
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.
Tags
Button
Asked by
Luigi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Luigi
Top achievements
Rank 1
Kevin
Top achievements
Rank 2
Danail Vasilev
Telerik team
Share this question
or