You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sy...@swisscom.com on 2003/04/03 11:05:30 UTC

XMLForm: problem with prepare() method

Hello,

You can see below the prepare() method of my XMLForm action:

----code----
protected Map prepare() {
  if (getCommand() == null) {
    Form.remove(getObjectModel().getFormId());
    getForm().addFormListener(this);
    return page(VIEW_FORM1);
  } else if (Form.lookup(getObjectModel().getFormId() == null) {
    return page(VIEW_FORM1);
  }
  return super.PREPARE_RESULT_CONTINUE;
}
----code----

My purpose is when I restart the application (when I load the first page, without command) I want to clear the Form.

The problem is that the getCommand() method never return a null value, except when I load the app. for the first time.

My Form has 2 pages.
The first page has a next command that call the second page.
The second page has a preview command that recall the first page (without clear the Form values) and a next command that call the first page (a new one, where I want to clear the Form values).

Does it mean that the second page of my Form shouldn't have a command for calling a new first page?

Is someone has a solution?

Thanks
Sylvain

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org