En l'instant précis du 23/03/07 12:58, Marko Asplund s'exprimait en ces
termes:
> hi
>
> I need to do the following in my JSF application:
> - submit a form with input text fields
> - validate form input
> - if conversion or validation results in errors, show the original form
> - if input is ok, open a new window and load a JSF response in it.
> Input form window is left unchanged.
>
> One option I can come up with would be to include a piece of
> Javascript in the form page on postback that would open up a new
> window and load the JSF view in it. Does this sound workable? How do I
> generate Javascript code that would result in invoking a JSF action
> method in a browser window?
when form is valid, your action is called and a navigation occured. In
the page, after navigation, have 2 forms. One is you original form
(probably empty now). The other is a form with only hidden input field
and a target to "_blank". All you javascript has to do is to call the
form_submit() method associated with your hidden form. JSF generate such
javascript function for each form. You just have to call it on page load :)

Reply via email to