Hello everybody and Hello to specially
Ivelin,
i have a problem to create dynamic selectOnes in
my
XMLForms with the <xf:repeat>. I looked
on the source of
XMLForm-Transformer and it seems to be not
possible
with this Version. But this is importent to create
powerfull
forms. I solved this problem with some additionals
in
the xmlform2html.xsl and wizzard2html.xsl, but this
is just
a workarround. How long will it take to change the
transformer
to this functionality?? ( I hope tomorrow ;-)
).
... And here is my dirty workarround
wizzard2html.xsl
[..]
<xsl:template
match="xf:group[@type='selectOne']">
<tr> <td><b><xsl:value-of select="xf:caption" /></b></td> <td align="left"> <table cellspacing="0" cellpadding="0" border="0" class="plaintable"> <tr> <td align="left"> <xsl:copy-of select="." /> </td> <xsl:if test="xf:violation"> <td align="left" class="{xf:violation[1]/@class}" width="100%"> <xsl:for-each select="xf:violation"> * <xsl:value-of select="." /> <br/> </xsl:for-each> </td> </xsl:if> </tr> </table> </td> </tr> </xsl:template> [...]
xmlform2html.xsl
[...]
<xsl:template
match="xf:group[@type='selectOne']">
<select name="{@ref}" size="{@size}"> <xsl:copy-of select="@*[not(name()='ref')]"/> <xsl:variable name="selected" select="//xf:output[@type='selection']/xf:value"/> <xsl:for-each select="xf:repeat/xf:group/option"> <option value="{xf:output[@type='itemValue']/xf:value}"> <xsl:if test="$selected = xf:output[@type='itemValue']/xf:value"> <xsl:attribute name="selected"/> </xsl:if> <xsl:value-of select="xf:output[@type='itemCaption']/xf:value"/> </option> </xsl:for-each> </select> </xsl:template> [...]
in my xmlform i use something like
this:
[...]
<xf:group ref="/attribute/preisinfoid"
type="selectOne" size="10">
<xf:caption>Sainsons</xf:caption> <xf:output type="selection" ref="/attribute/preisinfoid"/> <xf:repeat nodeset="/model/myCollection"> <option> <xf:output type="itemValue" ref="./preisinfoId"/> <xf:output type="itemCaption" ref="./preisInfoText"/> </option> </xf:repeat> </xf:group> [...]
|
- Re: Dynamic SelectOnes in XMLForms u13209
- Re: Dynamic SelectOnes in XMLForms Ivelin Ivanov