myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Marinschek <martin.marinsc...@gmail.com>
Subject Re: Submitting JSF Form after disabling the submit button
Date Mon, 17 Oct 2005 11:17:28 GMT
Yes, you are right.

For disabled and readonly components, the actions are not executed and
the value is not read back. That is so specified - to make sure that
the user cannot change the value client side if you don't want to
allow him to do so server side.

regards,

Martin

On 10/17/05, Kevin Roast <kevin.roast@alfresco.org> wrote:
>
>
> Hi,
>
> I have come across a small issue, I'm not sure if it's MyFaces or not, so
> I'll post here and if anyone thinks they know what's going on…
>
> For our web-client, we want to stop the user submitting forms more than
> once, e.g. stop multiple clicks on the Submit buttons. The easy way to do
> this could be to add an onclick handler to the Submit button (or too the
> Form itself) which disables the appropriate button before submitting the
> form. This is easy enough, so something like:
>
> <h:form id="myform">
>    // some form fields here
>    …
>    // submit button
>    <h:commandButton id="finish" value="Finish" action="#{MyBean.finish}"
> onclick="javascript:disableButton(this);" />
> </h:form>
>
> The disableButton() javascript simply sets the button disabled attribute to
> true.
>
> The form will submit and the browser refreshes the page refreshes BUT none
> of the JSF lifecycle stuff, page navigation or action methods etc. have
> occurred.
>
> I guess because the submit has been disabled it is not a "successful" form
> control and myfaces is not executing the lifecycle?
>
> Any help here would be appreciated.
>
> Thanks,
>
> Kevin
> --
> http://www.alfresco.org
>


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German
Mime
View raw message