You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Daniel Meier <in...@manifakt.com> on 2001/03/09 19:40:19 UTC
dynamic forms
i'm a newcomer to cocoon and have asimple question to the fp:library:
there is this form-example (under /fp). it always works with a static amount
of "input"-elements (for example: title, body text, image = 3 elements)
i'd like to have this dynamic. so I generated a new template in the
xsl-sheet the following way:
**************************************************************************
<xsl:template match="input[@type='object']">
<xsl:for-each select="object/*">
<xsl:call-template name="subobjects"/>
</xsl:for-each>
</xsl:template>
<xsl:template name="subobjects">
<xsl:variable name="value">
<xsl:call-template name="get-nested-content">
<xsl:with-param name="content" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$value">
<TR BGCOLOR="#CCCCCC" VALIGN="TOP">
<TD ALIGN="RIGHT"><xsl:value-of select="name(.)"/></TD>
<TD>
<TEXTAREA ROWS="10" COLS="40">
<xsl:attribute name="name"><xsl:value-of
select="name(.)"/></xsl:attribute>
<xsl:call-template name="copy-form-attributes"/><xsl:copy-of
select="$value"/>
</TEXTAREA>
</TD>
<xsl:call-template name="show-processes"/>
<xsl:call-template name="show-errors"/>
</TR>
</xsl:if>
</xsl:template>
*************************************************************************
now I get for each "object" all the children as textaera.
but saving in the xml doesn't work!!!!!
this is because the "get-parameter name" (zzzzzz) is also dynamic) as well
as the node (yyyyyy).
*************************************************************************
<fp:if-post>
<fp:write to="data-item" select="yyyyyy" as="node">
<request:get-parameter name="zzzzzz"/>
</fp:write>
</fp:if-post>
*************************************************************************
has someone a solution or an easy workaround for this....
thanks for any help
mani
info@manifakt.com
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>