Hi Bart, how did you catch the label in your xsl transformation? In forms-field-styling.xsl we have: <!--+
| Labels for form elements.
+-->
<xsl:template match="fi:label" mode="label">
<xsl:param name="id"/>
<xsl:variable name="resolvedId">
<xsl:choose>
<xsl:when test="$id != ''"><xsl:value-of select="$id"/></xsl:when>
<xsl:otherwise><xsl:value-of select="concat(@id, ':input')"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<label for="{$resolvedId}" title="{fi:hint}">
<xsl:apply-templates select="." mode="css"/>
<b><xsl:copy-of select="fi:label/node()"/></b>
</label>
</xsl:template>
But I think this template isn't used and the label is directly set within the
AbstractWidget:
public void generateLabel(ContentHandler contentHandler) throws SAXException {
if (getCombinedState().isDisplayingValues()) {
getDefinition().generateDisplayData("label", contentHandler);
}
}
Cheers,
Mike
________________________________
Von: bart remmerie [mailto:[EMAIL PROTECTED]
Gesendet: Mi 14.11.2007 11:53
An: [email protected]
Betreff: Re: AW: own widget
Dear Michel,
I've already implemented such a feature, not by creating a new widget, but
using the stylesheet-approach.
Basically, you create a new styling type "link" or "href-label" and include it
in the forms styling stylesheets.
The most difficult part is to create the "href" part of your hyperlink.
For an elegant solution, you should be able to define the hyperlink outside the
stylesheet.
You should be able to pass it as an argument through the form's template.
In my use case, I pass a 'fixed part', something like '/myhelppages/' + a
variable part linked to the id of the record. Where the id of the record is a
part of the object model, known within the form (as a hidden field) &
accessible in the stylesheet.
I know this may seem complicated, and if interested I can provide the
source-snippets.
Bart
2007/11/9, Michel Erard <[EMAIL PROTECTED]>:
I already tested the trunk version of forms block and the only thing
that changed for uses was that all 'class' attributes are replaced by 'ref' and
take a spring bean as argument. And there is a new spring config file in the
forms block of course.
What do you think about a new Datatype 'object', that for example can
be used to link persistent objects? Of course this feature would only make
sense when you have a selection-list with a defined set of objects. Or maybe
better an ObjectSelectionList?
________________________________
Von: Grzegorz Kossakowski [mailto:[EMAIL PROTECTED]
Gesendet: Do 08.11.2007 18:57
An: [email protected]
Betreff: Re: AW: own widget
Felix Knecht pisze:
> @Grzegorz
> I thought Giacomo migrated the forms block to spring
(cocoon-forms-1.1.0).Wouldn't it make more sense to use already the
> new forms block instead of the legacy one (probably it makes
configuration also easier)?
Yes, Giacomo migrated forms to Spring recently but there are still two
problems:
1. There was no release of Forms 1.1.0
2. There is no migration guide or any other document describing how
things changed and how
everything is going to work.
The second point is especially important and I'm little bit
disappointed that others making
incompatible (but wholeheartedly wanted!) changes do not write any
documentation. It's really not
hard to write migration guide but I believe it really helps our users.
Am I wrong?
--
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Bart Remmerie
<<winmail.dat>>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
