Not totally true. There is some JS operations JSF makes upon submit that
will be bypassed by your return.

<h:commandButton value="submit" action="#{myBean.action}" onclick="if
(!confirm('Are you sure?')) return false;" />


This is because you need the operation to continue if user confirm. This
is not 100% necessary with command buttons, but it is with command links.


En l'instant précis du 20/08/07 13:55, Julien Martin s'exprimait en ces
termes:
> I was given the solution by someone. Here it is:
> [code]
> <h:commandButton value="submit" action="#{myBean.action}"
> onclick="return confirm('Are you sure?');" />
> [/code]
> Julien.
>
>
> 2007/8/20, Julien Martin <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>:
>
>     Hello,
>     I would like for a user to confirm that he/she wants to undertake
>     a submit action. I have a h:commandButton and I would like to use
>     the JS confirm function and the onclick attribute in order to do
>     that. The problem is when I want to submit the form (once the user
>     has clicked yes on the confirm button) and I do not want to
>     hard-code the path to the form. Another problem is that I have
>     several h:commandButtons on the form.
>     Can anyone please help?
>     Thanks in advance,
>     Julien Martin.
>
>


-- 
http://www.noooxml.org/

Reply via email to