cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michel Erard" <>
Subject AW: AW: own widget
Date Wed, 14 Nov 2007 14:35:02 GMT
PS: I use Version 2.2 :-)


Von: Michel Erard
Gesendet: Mi 14.11.2007 15:28
Betreff: AW: AW: own widget

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:when test="$id != ''"><xsl:value-of select="$id"/></xsl:when>

<xsl:otherwise><xsl:value-of select="concat(@id, ':input')"/></xsl:otherwise>



<label for="{$resolvedId}" title="{fi:hint}">

<xsl:apply-templates select="." mode="css"/>

<b><xsl:copy-of select="fi:label/node()"/></b>



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);








Von: bart remmerie []
Gesendet: Mi 14.11.2007 11:53
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.

2007/11/9, Michel Erard <>: 

	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 []
	Gesendet: Do 08.11.2007 18:57
	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
	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
	To unsubscribe, e-mail:
	For additional commands, e-mail: 
	To unsubscribe, e-mail: 
	For additional commands, e-mail:

Bart Remmerie 

View raw message