cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roberto Marra" <>
Subject Re: CForms & value of field...
Date Wed, 18 May 2005 14:45:52 GMT
I mean... sorry if I didn't clarify myself...
Im looking at the samples "../block/forms/flow/binding_example.js". This is the flowscript:

function form2bean(form) {
    var bean = new;

    //fill bean with some data to avoid users having to type to much
      bean.setBirthday(new java.util.Date());
      var contact = new;


    cocoon.sendPage("form2bean-success-pipeline", { "form2bean": bean });

The bean is used to fill-up the field of the form. What I need is retrive the value of the
field of the form. I already did something like 


But as I wrote if I got 300field I would like to find another solution...

hope that I clarify..

  ----- Original Message ----- 
  From: Roberto Marra 
  Sent: Wednesday, May 18, 2005 4:14 PM
  Subject: Re: CForms & value of field...

  Hi Jeroen & thanx.
  I had a look of the OJB samples. Let say that now my main target is not to write to db but
to have the value of the CForm available in the flowscript & I want to do that via binding.
So in the sitemap I got that now:

  <map:match pattern="regContatti">
  <map:call function="handleForm">
  <map:parameter name="function" value="storeContact"/>
  <map:parameter name="form-definition" value="forms/definitions/contatti.xml"/>
  <map:parameter name="bindingURI" value="binding/contatti/bindContatti.xml"/>

  & in the flowscript
     var bindingFile =  cocoon.parameters["bindingURI"];
     var bean = new;




    but "test" return me null. So for sure I didn't understand something...or more...


    ----- Original Message ----- 
    From: Jeroen Reijn 
    Sent: Wednesday, May 18, 2005 9:52 AM
    Subject: RE: CForms & value of field...

    Hi Roberto,

    I think binding the form could be a great solution for your problem. You could check out
the OJB samples to see how to write to the DB.


      -----Original Message-----
      From: Roberto Marra []
      Posted At: Wednesday, May 18, 2005 9:23 AM
      Posted To: Cocoon User List
      Conversation: CForms & value of field...
      Subject: CForms & value of field...

      Hi all,
      I guess I missed something about the process of get value from the CForm to the flowscript.
So hope somebody can clarify me it.

      I got a CForm definition file & a template. Then in my pipeline I got a match pattern
that call a function & pass the parameter of the CForm in this way:

           <map:parameter name="ragSoc" value="{request-param:ragSoc}"/>
           <map:parameter name="indirizzo" value="{request-param:indirizzo}"/>
           <map:parameter name="cap" value="{request-param:cap}"/>
           <map:parameter name="citta" value="{request-param:citta}"/>
           <map:parameter name="nazione" value="{request-param:nazione}"/>
           <map:parameter name="telefono" value="{request-param:telefono}"/>

      then, in my flowscript I do that:

          ragSoc    = cocoon.parameters["ragSoc"];
          indirizzo = cocoon.parameters["indirizzo"];
          cap       = cocoon.parameters["cap"];
          citta     = cocoon.parameters["citta"];
          nazione   = cocoon.parameters["nazione"];
          telefono  = cocoon.parameters["telefono"];
          email     = cocoon.parameters["email"];
          lingua    = cocoon.parameters["lingua"];
          pwd       = cocoon.parameters["pwd"];
          confpwd   = cocoon.parameters["confpwd"];

      & then I call a Java method & I do what I have to do (in this case write the
value in the db). So, that could be interesting for one CForm, but Im making an application
programm, with a lot of CForms with a lot of field. Im sure I have not to send everytime all
the field in this way to flowscript, Im sure there is an elegant way to do that. Is the binding
file the solution? I saw different example of binding but in the example the binding is used
most of the time to write data in the CForms..

      Any suggestion?

      Thanx in advance

View raw message