cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Hoskens ...@schaubroeck.be>
Subject Re: Request parameters form flow script to jx
Date Mon, 20 Dec 2004 07:12:20 GMT
First thing you need to do is check your version of Form.js. It should 
be something like

cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");

but may vary at the end with "v2/Form.js or "v3/Form.js".

If you're using v2, then you're definitely in trouble, as this version 
doesn't support passing of a bizdata object. Otherwise you can pass a 
bizdata as you would when using cocoon.sendPage():

var bizdata = { "username" : model.name };
formSuccess.showForm("registration-display-pipeline", bizdata);

then use it in your template with eg jexl: ${username}

In the future, v2 and v3 will likely be dropped. Hopefully they do pass 
some functionality to "v1" when this happens.

Kind Regards,
Jan

angeloimm wrote:
> Hi... yes i have read this sample; in the flow.script there is:
> 
> cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");
> 
> function registration() {
>     var form = new Form("forms/registration.xml");
> 
>     // The showForm function will keep redisplaying the form until
>     // everything is valid
>     form.showForm("registration-display-pipeline");
> 
>     var model = form.getModel();
>     var bizdata = { "username" : model.name }
>     cocoon.sendPage("registration-success-pipeline.jx", bizdata);
> }
> 
> As you can see it send to registration-success-pipeline.jx the bizData object.... but
this is done by using cocoon.sendPage; now i'ld like to do a similar thing but by using showForm
and not sendPage.... this is what mi chief wants so i have thinked to do for example:
> function registration() {
>     var form = new Form("forms/registration.xml");
> 
>     // The showForm function will keep redisplaying the form until
>     // everything is valid
>     form.showForm("registration-display-pipeline");
> 
>     var model = form.getModel();
>     var bizdata = { "username" : model.name };
>     cocoon.request.setAttribute( "myBizData", bizData );
> 
>     var formSuccess = new Form("forms/registration.xml");
>     formSuccess.showForm("registration-display-pipeline");
> }
> 
> The problem is that in the jx file i'm not able to recover this attribute... how can
i do?
> 
> 
> 
> ---------- Initial Header -----------
> 
>>>From      : "Jon Evans" jon.evans@misgl.com
> To          : users@cocoon.apache.org
> Cc          : 
> Date      : Fri, 17 Dec 2004 14:04:08 +0000
> Subject : Re: Request parameters form flow script to jx
> 
> 
>>Hi,
>>
>>On 17 Dec 2004, at 13:46, angeloimm wrote:
>>
>>
>>>Hi... first of all thanks for your reply. Now... have you ever tried 
>>>it? I have tried and i have an error that says: function expected 
>>>instead of an Object so i can't go on this way..... can you send a 
>>>working sample?
>>
>>Take a look at the registration sample 
>>http://localhost:8888/samples/blocks/forms/registration
>>
>>It uses flow, and has a jx result page which displays your username 
>>with:
>>
>>Registration was successful for ${username}!
>>
>>
>>Cheers,
>>
>>Jon
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
> 
> 
> 
> 
> ____________________________________________________________
> Regala e regalati Libero ADSL: 3 mesi gratis, navighi veloce e scarichi a 1.2 Mega. 
> Abbonati subito senza costi di attivazione su http://www.libero.it
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 


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


Mime
View raw message