Hi all,
I need to put a couple of forms on a page. The WoodyTemplateTransformer wiki page says the way to do this is to use the special @location attribute on <wt:form-template>, to tell the transformer where to pick up the form instance.
It's kinda sketchy, but I think I can dig what they're getting at there. 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 page should 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 I want.
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')".
Sender: org.apache.cocoon.servlet.CocoonServlet
Source: Cocoon Servlet
Request URI
<x-tad-smaller>7652197982112f24115b4124565a28133b6b5a2d.continue
</x-tad-smaller>I see in the source code that this is what WidgetReplacingPipe does when the value denoted by the JXPath expression in @location turns out to be null. So how could it be null? It had to have worked the first time, but somehow coming back in on the continuation, it doesn't.
So then I thought, "Well, maybe I really need to be setting this attribute in the session context instead of the request context". So, I changed it in my flow, and I changed it in my <wd:form-template>. Well, that made things worse. This way, I get the SAXException right from the get-go (same exception: "No form found at location..."), I don't successfully display the page.
Can anybody tell me what I might be doing wrong? I can't figure out why the "getAttribute($session, 'form1') way isn't working at all, when doing it with $request worked at least a little bit! :-/.
Thanks a lot for any help,
~ml
- Please help! <wt:form-template> location attribute Mark Lundquist
- Please help! <wt:form-template> location attrib... Mark Lundquist
- Re: Please help! <wt:form-template> locatio... Mark Lundquist
- Re: Need some help w/ Woody Template Bruno Dumon
- Re: Need some help w/ Woody Template Mark Lundquist
- Re: Need some help w/ Woody Template Sylvain Wallez
- Re: Need some help w/ Woody Template Mark Lundquist
