cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <>
Subject Re: Need some help w/ Woody Template
Date Wed, 11 Feb 2004 08:54:23 GMT
On Tue, 2004-02-10 at 11:37, Mark Lundquist wrote:
> Hi all,
> I need to put a couple of forms on a page. 
> TheWoodyTemplateTransformer wiki page says the way to do this is to
> usethe special @location attribute on <wt:form-template>, to tell
> thetransformer where to pick up the form instance.
> It's kinda sketchy, but I think I can dig what they're getting
> atthere.  So I did this:
> <wd:form-template
> location="getAttribute($request, 'form1')"
>           action="#{$continuation/id}.continue" method="POST"
> >
> ...and then I went like this in my flow:
> form1 = new Form ("form1.wd");
> cocoon.request.setAttribute ("form1", form1.form);
> form2 = new Form ("form2.wd");
> cocoon.request.setAttribute ("form2", form2.form);
> I can see that if I call showForm() on either of these, the whole
> pageshould get displayed with both forms.  So, I went ahead and:
> form2.showForm ("display-forms");
> Poofo, it works!  There's my page, with both forms, all styled like
> Iwant.
> Oops, no it doesn't.  When I click the submit button, I get this:
> Description:org.apache.cocoon.ProcessingException: Failed to execute
> pipeline.:org.xml.sax.SAXException: No form found at
> location"getAttribute($request, 'form1')".

That's because the request is an object that lives only for the duration
of one request. Thus if you put something in a request attribute, it
only remains there for the current request. The submit is a new request,
so you would have to put the forms back in the attributes on that new
request. But with the woody2.js this is rather hard, since you can't do
that AFAIK without modifications.

The whole woody-flowscript integration is quite focussed on displaying
one form at a time, so you're a bit on your own if you want to display
multiple forms... (not that it's impossible, but you'll have to write
some more code by your own)


Bruno Dumon                   
Outerthought - Open Source, Java & XML Competence Support Center                

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message