Hi Stefan,
To disable the Button and submit the form after press is easy. See the TLD
Doc about that or try the code until this text.
// Write this code in your Button onClick method.
"btnLogin" call the id of your Button
domNode=document.getElementById("form1:btnLogin");
domNode.setProps({disabled:true});
kr
-----Original Message-----
From: Stefan Bley [mailto:stefan.bley_at_saxsys.de]
Sent: Freitag, 10. Oktober 2008 10:04
To: users_at_woodstock.dev.java.net
Subject: RE: Submit and disable a button
Hi Steffen
In your example you do not disable the button. For me the question is how to
disable the button and at the same time submit the form.
Any idea?!
IOLAUS wrote:
>
> Hi,
>
> i made a mistake.
>
> .getElementById("form1:btnLogin").click() = true; is wrong!
>
> .getElementById("form1:btnLogin").click() without =true is correct.
>
>
> Thx
>
>
> -----Original Message-----
> From: Steffen [mailto:iolaus_at_gmx.ch]
> Sent: Donnerstag, 2. Oktober 2008 15:11
> To: users_at_woodstock.dev.java.net
> Subject: RE: Submit and disable a button
>
> Sorry for my little answer. So, I have a false return statement in the
> onClick method, in a ui-component.
>
>
> // js script example
>
> <webuijsf:script>
> function doSomething() {
> var userInput = confirm("got it?");
>
> if ( userInput ) {
> document.getElementById("form1:btnLogin").click() = true;
> }
> }
> </webuijsf:script>
>
>
> // Button and textfield
>
> <webuijsf:form id="form1">
>
> <webuijsf:textField binding="#{Page1.textField1}" id="textField1"/>
>
> <webuijsf:button actionExpression="#{Page1.btnLogin_action}"
> id="btnLogin"
> onClick="doSomething(); return false;"/>
>
> </webuijsf:form>
>
>
> // action handler for the btnButton
>
> public String btnLogin_action() {
> textField1.setText("Hello Steve, it works!");
> return null;
> }
>
> I hope it is helpful..
>
> Greetings
>
--
View this message in context:
http://www.nabble.com/Submit-and-disable-a-button-tp16322463p19913751.html
Sent from the Project Woodstock - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_woodstock.dev.java.net
For additional commands, e-mail: users-help_at_woodstock.dev.java.net