You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Roberto Marra <rm...@montefiore.ch> on 2005/05/18 09:23:26 UTC

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
Roberto