You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alex Kovacs <al...@fast.fujitsu.com.au> on 2003/11/03 00:36:27 UTC

JXForm flow issue with request parameters

Hi,

I am trying to create a wizard using JXForm. I have the following funtion in the flow:

"function flowhandler(form) {

    var username = cocoon.request.get("username");
    var model = aBean.getModel(username);
 
    form.setModel(model);

    
    form.sendView("xdocs/personal_details.xml");
    form.sendView("xdocs/current_enrolment.xml");

    form.finish("xdocs/end.xml");
}
"

and the sitemap as follows:

" ...
     <map:match pattern="new/">
      
        <map:call function="jxform">
          <map:parameter name="function" value="flowhandler"/>
          <map:parameter name="id" value="form-feedback"/>
          <map:parameter name="validatorNamespace" value="http://www.ascc.net/xml/schematron"/>
          <map:parameter name="validatorSchema" value="scripts/schematron.xml"/>
          
          <map:parameter name="username" value="{request-param:username}"/>
        </map:call>
      </map:match>
....
"

Now, when I call the sitemap with http://localhost:8080/myapp/new/?username=john (I do this from another page actually), everything is displayed correctly in the first view (xdocs/personal_details.xml), but as soon as I press next on the page, I get the following error in the browser:

"
* There are [1] errors. Please fix these errors and submit the form again.
* No pointer for xpath: username
"

What am I doing wrong? And, if I cannot use cocoon.request.get(), to obtain the username, how should I do it?

Many thanks for helping,
Alex

Re: JXForm flow issue with request parameters

Posted by Alex Kovacs <al...@fast.fujitsu.com.au>.
Got it fixed :-).

The idea is to use POST as the method for the form that calls the flowscript pipeline. As soon as one sends some GET data, JXForm breaks. BTW I use cocoon 2.1.2 (stable release).

Regards,
Alex
  ----- Original Message ----- 
  From: Alex Kovacs 
  To: users@cocoon.apache.org 
  Sent: Monday, November 03, 2003 9:36 AM
  Subject: JXForm flow issue with request parameters


  Hi,

  I am trying to create a wizard using JXForm. I have the following funtion in the flow:

  "function flowhandler(form) {

      var username = cocoon.request.get("username");
      var model = aBean.getModel(username);
   
      form.setModel(model);

      
      form.sendView("xdocs/personal_details.xml");
      form.sendView("xdocs/current_enrolment.xml");

      form.finish("xdocs/end.xml");
  }
  "

  and the sitemap as follows:

  " ...
       <map:match pattern="new/">
        
          <map:call function="jxform">
            <map:parameter name="function" value="flowhandler"/>
            <map:parameter name="id" value="form-feedback"/>
            <map:parameter name="validatorNamespace" value="http://www.ascc.net/xml/schematron"/>
            <map:parameter name="validatorSchema" value="scripts/schematron.xml"/>
            
            <map:parameter name="username" value="{request-param:username}"/>
          </map:call>
        </map:match>
  ....
  "

  Now, when I call the sitemap with http://localhost:8080/myapp/new/?username=john (I do this from another page actually), everything is displayed correctly in the first view (xdocs/personal_details.xml), but as soon as I press next on the page, I get the following error in the browser:

  "
  * There are [1] errors. Please fix these errors and submit the form again.
  * No pointer for xpath: username
  "

  What am I doing wrong? And, if I cannot use cocoon.request.get(), to obtain the username, how should I do it?

  Many thanks for helping,
  Alex