Redirect after post and the usage of aliasbean might work out in your case. You also could set a session var with a token, which is set once the form is submitted, so that a second attempt is blocked.
Werner Kevin Roast wrote: > OK that's unfortunately what I thought. Does anyone have other solutions > to solve the original usability issue? E.g. a way to stop the user > executing multiple form submissions in a JSF web app. We feel that this > is significant usability issue for us and probably many other web > applications. > > Thanks, > > Kevin > -- > http://www.alfresco.org > > > -----Original Message----- > From: Martin Marinschek [mailto:[EMAIL PROTECTED] > Sent: 17 October 2005 12:17 > To: MyFaces Development > Subject: Re: Submitting JSF Form after disabling the submit button > > 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 <[EMAIL PROTECTED]> 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 >
