cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DURDINA Michal <>
Subject RE: Declarative XMLForm
Date Sun, 27 Apr 2003 09:46:10 GMT
(Sorry, previous send was accidental :)

First of all, this probably should not happen in well-designed view, because
all command invocations should be represented only by links/buttons.

Therefore instead of "customize color" checkbox, there should be a button
"Customize color" for invoking the 'customization' command which will lead
to the customization view and one button "Finish" to invoke the 'finish'
command which will lead to confirm view or whatever next view.
<command name="custcolor" from-view="configuration"
<command name="finish" from-view="configuration" to-view="confirmation"/>

If you need to handle a special view selection that couldn't be handled only
by "command+from-view" pair distinction then you need to implement
user-defined method for the command and choose the next view there.
<command name="next" from-view="configuration" method="chooseView"

public String chooseView(String command, String fromView, String toView,
String role, Object model) {

  // there's only one 'toView' atribute thus it doesn't make much sense to
use it this case

  if (getRequest().getParameter("customizecolor") == null)
    return "confirmation"
    return "customize-color";

Any other view selection than based on "command+from-view" requires to
extend the command declaration (i.e. as proposed in but I
am affraid it would lead to overdeclarating of transitions between views.


> -----Original Message-----
> From: ivelin []
> Sent: Friday, April 25, 2003 2:24 PM
> To:
> Subject: Re: Declarative XMLForm
> Certainly an interesting alternative, provided that 
> command/view combination
> defines unique output most of the time.
> How would you code additional dependencies.
> For example if command is "next" and view is "configuration", then
> 1) if "customize color" option is selected, display view 
> "costomize color"
> 2) otherwise skip straight to "customization complete"

View raw message