You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Raphaël Piéroni <ra...@gmail.com> on 2007/11/30 11:22:48 UTC
[Cocoon 2.2] Cforms default styling for textareas
Hi Guys,
in the default ps-cforms-defaut.xsl
that i copied in my project ther is some bug for displaying a texte area.
Here is the extract of my xsl for enabling textareas :
<xsl:template name="field">
<xsl:param name="fieldelement"/>
<xsl:choose>
<xsl:when test="fi:styling/@type = 'textarea'" >
<textarea name="{$fieldelement/@id}" >
<xsl:if test="fi:styling">
<xsl:copy-of select="fi:styling/@*[name() != 'type']"/>
</xsl:if>
<xsl:value-of select="$fieldelement/fi:value"/>
</textarea>
</xsl:when>
<xsl:otherwise>
<input name="{$fieldelement/@id}"
value="{$fieldelement/fi:value}">
<xsl:if test="fi:styling">
<xsl:copy-of select="fi:styling/@*"/>
</xsl:if>
</input>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
and here is the extract of the cform template to
define a textarea : <ft:widget id="description"><fi:styling
type="textarea" rows="8" cols="60" /></ft:widget>
Regards,
Raphaël
Re: [Cocoon 2.2] Cforms default styling for textareas
Posted by Joerg Heinicke <jo...@gmx.de>.
The mentioned stylesheet is really only for usage inside the petshop and
you should not reuse this stylesheet inside your project. For a
reasonable and well-tested default styling of Cocoon Forms have a look
into the cocoon-forms-impl block, at
src/main/resources/org/apache/cocoon/forms/resources. Instead of
completely starting from scratch (and providing a very bad
implementation) the petshop samples should also reuse those ones,
probably via the servlet service framework.
Joerg
On 30.11.2007 05:22, Raphaël Piéroni wrote:
> Hi Guys,
>
> in the default ps-cforms-defaut.xsl
> that i copied in my project ther is some bug for displaying a texte area.
>
> Here is the extract of my xsl for enabling textareas :
>
> <xsl:template name="field">
> <xsl:param name="fieldelement"/>
> <xsl:choose>
> <xsl:when test="fi:styling/@type = 'textarea'" >
> <textarea name="{$fieldelement/@id}" >
> <xsl:if test="fi:styling">
> <xsl:copy-of select="fi:styling/@*[name() != 'type']"/>
> </xsl:if>
> <xsl:value-of select="$fieldelement/fi:value"/>
> </textarea>
> </xsl:when>
> <xsl:otherwise>
> <input name="{$fieldelement/@id}"
> value="{$fieldelement/fi:value}">
> <xsl:if test="fi:styling">
> <xsl:copy-of select="fi:styling/@*"/>
> </xsl:if>
> </input>
> </xsl:otherwise>
> </xsl:choose>
> </xsl:template>
>
>
> and here is the extract of the cform template to
> define a textarea : <ft:widget id="description"><fi:styling
> type="textarea" rows="8" cols="60" /></ft:widget>
>
>
> Regards,
>
> Raphaël
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org