You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Hugo Burm <hu...@xs4all.nl> on 2003/12/03 18:41:08 UTC

Scope of request attributes, Woody, and continuations

Hello,

Is there a way to find my request attributes (not parameters) after a
continuation?
Scenario:
- Set request attribute at the beginning of a Woody flowscript
- Woody calls new pipeline in showForm. Request attributes are still there
in new pipeline (surprise!).
- Woody calls a continuation (e.g. because I pressed "add contact" in the
form2bean.flow example). Basically, the same page appears but my request
attributes are gone now.


Hugo.




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


Re: Woody(cocoon forms): wb:repeater

Posted by Christopher Oliver <re...@verizon.net>.
Why not just write a javascript function  in your flow script to copy 
data from the form object to your model? Of course, this approach would 
also work for Java objects. In most cases I think this is just as easy 
as using the "form-binding" aproach.

My $0.02,

Chris

Yatin Shah wrote:

> Hello!
>
> Is it possible to use a javascript function to do insert-bean processing?
>
> In form2bean example a java class(Form2Bean.java ) is used for the 
> data model.
> This class includes a method(addContact) to add instances of Contact 
> class to the internal ArrayList object.
> The supplied binding sample uses the following construct :
>
>    <wb:on-insert-row>
>      <wb:insert-bean
>        classname="org.apache.cocoon.woody.samples.Contact"
>        addmethod="addContact"/>
>    </wb:on-insert-row>
>
> If I'm using javascript objects and arrays for my model, is there any 
> way to specify javascript function for adding a
> new instance of class to my data model?
>
> TIA
> -Yatin
>
> My Env:
> Cocoon: cvs version of Nov 07, 2003.
> Linux, JDK 141 running on Jetty.
>
>
> ---------------------------------------------------------------------
> 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


Woody(cocoon forms): wb:repeater

Posted by Yatin Shah <no...@kripa.com>.
Hello!

Is it possible to use a javascript function to do insert-bean processing?

In form2bean example a java class(Form2Bean.java ) is used for the data 
model.
This class includes a method(addContact) to add instances of Contact 
class to the internal ArrayList object.
The supplied binding sample uses the following construct :

    <wb:on-insert-row>
      <wb:insert-bean
        classname="org.apache.cocoon.woody.samples.Contact"
        addmethod="addContact"/>
    </wb:on-insert-row>

If I'm using javascript objects and arrays for my model, is there any 
way to specify javascript function for adding a
new instance of class to my data model?

TIA
-Yatin

My Env:
Cocoon: cvs version of Nov 07, 2003.
Linux, JDK 141 running on Jetty.


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


RE: Scope of request attributes, Woody, and continuations

Posted by Hugo Burm <hu...@xs4all.nl>.
Thanks Jeremey,

But as always it is a little bit more complicated.
In the "form2-display-pipeline" I have a generator with a "setup" and
"generate" function. The "setup" saves the request from the ObjectModel for
using it in "generate".
If the continuation is a new request, why is "setup" not called by the
continuation? Only the "generate" function is called. So there is no way to
save the new request now (e.g to get the session) and my old request is
gone. May be this is a bug. May be I should cross-post this to the dev list.

regards Hugo

> -----Original Message-----
> From: Jeremy Quinn [mailto:jeremy@media.demon.co.uk]
> Sent: Wednesday, December 03, 2003 6:58 PM
> To: users@cocoon.apache.org
> Subject: Re: Scope of request attributes, Woody, and continuations
>
>
>
> On 3 Dec 2003, at 17:41, Hugo Burm wrote:
>
> > Hello,
> >
> > Is there a way to find my request attributes (not parameters) after a
> > continuation?
>
> I don't think so ... it is a different Request
>
> > Scenario:
> > - Set request attribute at the beginning of a Woody flowscript
> > - Woody calls new pipeline in showForm. Request attributes are still
> > there
> > in new pipeline (surprise!).
>
> No surprise .... it is the same Request .... you just called an
> internal pipeline, right?
>
> > - Woody calls a continuation (e.g. because I pressed "add contact" in
> > the
> > form2bean.flow example). Basically, the same page appears but my
> > request
> > attributes are gone now.
>
> Your last Request finished ... you got the page with the button on ....
> your client then made a new Request when you clicked it
>
>
> That's how I understand it anyway ;)
>
> HTH
>
> regards Jeremy


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


Re: Scope of request attributes, Woody, and continuations

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 3 Dec 2003, at 17:41, Hugo Burm wrote:

> Hello,
>
> Is there a way to find my request attributes (not parameters) after a
> continuation?

I don't think so ... it is a different Request

> Scenario:
> - Set request attribute at the beginning of a Woody flowscript
> - Woody calls new pipeline in showForm. Request attributes are still 
> there
> in new pipeline (surprise!).

No surprise .... it is the same Request .... you just called an 
internal pipeline, right?

> - Woody calls a continuation (e.g. because I pressed "add contact" in 
> the
> form2bean.flow example). Basically, the same page appears but my 
> request
> attributes are gone now.

Your last Request finished ... you got the page with the button on .... 
your client then made a new Request when you clicked it


That's how I understand it anyway ;)

HTH

regards Jeremy