You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joel McConaughy <jo...@displayware.com> on 2004/06/04 21:00:51 UTC
[CForms/JXTemplate] how to pass bizData?
I am unable to access model data using the JXTemplate generator and
cforms. Is there a special variable that holds the form's model data?
Here is a simple case:
I have a form that gets called with the following code:
var m = { 'myvalue' : 'abc123' };
form.load( m );
form.showForm("simpleform");
In the sitemap, I access the template using the jx generator as follows:
<map:match pattern="simpleform">
<map:generate type="jx" src="forms/{1}_template.jx" />
<map:transform type="forms" />
<map:transform type="i18n">
<map:parameter name="locale" value="en-US" />
</map:transform>
<map:transform src="resources/forms-samples-styling.xsl" />
<map:serialize />
</map:match>
The template contains the following:
<?xml version="1.0"?>
<jx:template xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
<page xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">
<content>
<ft:form-template action="#{$continuation/id}.continue"
method="POST">
<!-- DOES NOT DISPLAY -->
<br/>myvalue=${myvalue}
<!-- DOES DISPLAY -->
<br/>continuation=${continuation.id}
</ft:form-template>
</content>
</page>
</jx:template>
Any ideas? Thanks in advance.
joel
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: [CForms/JXTemplate] how to pass bizData?
Posted by Joel McConaughy <jo...@displayware.com>.
Then suddenly the light bulb went on....
I figured out that there is a difference between the form's model data
and the bizdata passed from the flow. I simply added bizdata to
form.showForm("simpleform", bizdata) and viola, it worked.
joel
Joel McConaughy wrote:
> I am unable to access model data using the JXTemplate generator and
> cforms. Is there a special variable that holds the form's model
> data? Here is a simple case:
>
> I have a form that gets called with the following code:
> I
> var m = { 'myvalue' : 'abc123' };
> form.load( m );
> form.showForm("simpleform");
>
> In the sitemap, I access the template using the jx generator as follows:
>
> <map:match pattern="simpleform">
> <map:generate type="jx" src="forms/{1}_template.jx" />
> <map:transform type="forms" />
> <map:transform type="i18n">
> <map:parameter name="locale" value="en-US" />
> </map:transform> I
> <map:transform src="resources/forms-samples-styling.xsl" />
> <map:serialize />
> </map:match>
>
> The template contains the following:
>
> <?xml version="1.0"?>
> <jx:template xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
> <page xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
> xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">
> <content>
> <ft:form-template action="#{$continuation/id}.continue"
> method="POST">
> <!-- DOES NOT DISPLAY -->
> <br/>myvalue=${myvalue}
> <!-- DOES DISPLAY -->
> <br/>continuation=${continuation.id}
> </ft:form-template>
> </content>
> </page>
> </jx:template>
>
>
> Any ideas? Thanks in advance.
>
> joel
>
> ---------------------------------------------------------------------
> 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