You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Johnson <jo...@soho.club.tw> on 2004/05/20 07:29:24 UTC
Help! How to send bean between two forms
Hi!
I try to send bean from one form to another form.
the form1 js is
sendpage("form2.xml",{"bean":bean});
the sitemap for form2 is
<map:match pattern="Form2.xml">
<map:call function="handleForm">
<map:parameter name="function" value="form2"/>
<map:parameter name="form-definition" value="forms/form2.xml"/>
<map:parameter name="bindingURI" value="forms/form2_bind.xml"/>
<map:parameter name="bean" value="{request-param:bean}"/>
</map:call>
<map:transform type="i18n">
<map:parameter name="locale" value="{request:locale}"/>
</map:transform>
<map:serialize/>
</map:match>
the form2 js is
bean=cocoon.request.getParameter("bean");
it don't work,what's wrong!
Beat regards
Johnson Hsu
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Help! How to send bean between two forms
Posted by Joerg Heinicke <jo...@gmx.de>.
On 20.05.2004 07:29, Johnson wrote:
> Hi!
>
> I try to send bean from one form to another form.
> the form1 js is
> sendpage("form2.xml",{"bean":bean});
>
> the sitemap for form2 is
> <map:match pattern="Form2.xml">
> <map:call function="handleForm">
> <map:parameter name="function" value="form2"/>
> <map:parameter name="form-definition" value="forms/form2.xml"/>
> <map:parameter name="bindingURI" value="forms/form2_bind.xml"/>
> <map:parameter name="bean" value="{request-param:bean}"/>
> </map:call>
> <map:transform type="i18n">
> <map:parameter name="locale" value="{request:locale}"/>
> </map:transform>
> <map:serialize/>
> </map:match>
>
> the form2 js is
> bean=cocoon.request.getParameter("bean");
>
> it don't work,what's wrong!
The bean is not stored in a request param (this would be only strings,
no objects), but in a flow context, which means it is put into Cocoon's
object model.
You can access it from there or stre the bean explicitely in a request
attribute.
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org