De : Jean-Christophe Kermagoret [mailto:[EMAIL PROTECTED]]
> 
> It's possible to have this kind of behaviour with a 
> javascript function 
> that values the "action" and "template" parameter for each case. For 
> example :
> 
> function SubmitDefault() {
>     form.....action.value = "MyDefaultPortletAction";
>     form.....template.value = "MyDefaultTemplate.vm" ;
> }
> 
> function SubmitToUpdate() {
>     form.....action.value = "MyUpdatePortletAction";
>     form.....template.value = "MyUpdateTemplate.vm" ;
> }
> ...
> What are the reasons to use several action and template variables ?
> 

You probably don't want to do this in JS, for 3 reasons:
- you don't trust your client (and if you do, you should not :)
- you can't guarantee that your client will actually execute the
  code
- you break the MVC pattern by encoding controller information 
  in your template and tying your different templates together

IMO, you should never explicitely set a template from another
one but always abstract your application flow through a "state"
that is mapped to a template view by your controller code.
It also makes it much easier to validate the current state of the
application.

--
Rapha�l Luta - [EMAIL PROTECTED]
Jakarta Jetspeed - Enterprise Portal in Java
http://jakarta.apache.org/jetspeed/

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to