I meant "in onValidateFromForm()", not "in onSubmit()". Alternatively, detect 
which submit was pressed like this:

        
http://jumpstart.doublenegative.com.au/jumpstart7/examples/input/multiplesubmits1


On 18 Jul 2014, at 8:02 pm, Geoff Callender 
<geoff.callender.jumpst...@gmail.com> wrote:

> IMHO, you should take a fresh look at the user experience. If you choose the 
> more natural flow of asking the user to choose a language *before* presenting 
> them with any forms, then the flow becomes natural and all the difficulties 
> disappear.
> 
> If, however, you proceed with the way you describe, then the inescapable fact 
> is that when you switch language, the separate form on the page must be 
> submitted and it must include info about the language you're switching to. 
> Here's a way:
> 
> * in each form, include a hidden field, switchLanguage.
> * in each form, include a hidden Submit with mode="cancel".
> * in the component layout, you don't need Form, Submit, EventLink, or 
> ActionLink in the component layout. Instead, use <a href="#"> links.
> * in the component layout, require javascript that, on click of a switcher 
> link:
>       * finds the hidden field, switchLanguage, and populates it; and
>       * finds the hidden Submit with mode="cancel" and clicks it.
> * server-side, in onSubmit, if switchLanguage is not null then you know to 
> switch the language.
> 
> If however, the component layout is around multiple forms, then things get 
> tricky. It might work if it AJAX-submits each one.
> 
> HTH,
> 
> Geoff
> 
> On 18 Jul 2014, at 1:49 am, squallmat . <squall...@gmail.com> wrote:
> 
>> The language switchers are in a component layout including the pages where
>> there is the forms. And I don't want (and the client too :p) to change the
>> presentation.
>> 
>> 
>> 2014-07-17 17:34 GMT+02:00 Thiago H de Paula Figueiredo <thiag...@gmail.com>
>> :
>> 
>>> On Thu, 17 Jul 2014 11:49:56 -0300, squallmat . <squall...@gmail.com>
>>> wrote:
>>> 
>>> What is still stucking me is that language switching, I can't do it with
>>>> form because we can't nest them.
>>>> 
>>> 
>>> Put the language switcher inside the form. No need to nest forms. Or add
>>> some JavaScript to disable the language switcher when your form has
>>> something typed on them.
>>> 
>>> 
>>> Is there a way in an actionlink to force persisting of the properties of
>>>> a page ?
>>>> 
>>> 
>>> I'm sorry, this questions doesn't make much sense, as what controls the
>>> persistence of a page fields are annotations in the fields themselves.
>>> 
>>> 
>>> --
>>> Thiago H. de Paula Figueiredo
>>> Tapestry, Java and Hibernate consultant and developer
>>> http://machina.com.br
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>> 
>>> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to