cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Larsen" <>
Subject RE: Change widget label in action listener
Date Thu, 17 Jul 2008 20:25:19 GMT
Hi Chris,


Thanks for your expertise on this issue.  I think I may do a cheap fix on
this though, by creating two action widgets and hiding the one not
appropriate at the time.  





From: Christofer Dutz [] 
Sent: Thursday, July 17, 2008 1:06 PM
Subject: AW: Change widget label in action listener


Hi Gary,


I just had a look at your problem since the question sounded interesting. I
think I have to disappoint you here.

The label stuff is dealt with not in the Widget itself, but the
WidgetDefinition class, which is used to encapsulate the form-definition. 

As far as I could see it the label is initialized in the initializeForm
method, which sort of directly processes the form definition and the
setDisplayData method.

The only chance to modify the label seems to be, not to initialize it in the
form definition (No fd:label element) and then Passing a Map with you custom
label bound to the key "label" to the setDisplayData method:


Map labelMap = new HashMap();

labelMap.put("label", "my-cool-label");



Have to admit, that I reverse engineered this approach from the Cocoon
2.1.10 source and haven't tired it . would be very interested if it worked
though ;)






Von: Gary Larsen [] 
Gesendet: Donnerstag, 17. Juli 2008 17:28
Betreff: RE: Change widget label in action listener


I'm using Cocoon 2.1.9



From: Gary Larsen [] 
Sent: Thursday, July 17, 2008 10:52 AM
Subject: Change widget label in action listener


I'm trying to change the label on an Action widget as part of the action.
There does not seem to be a 'label' member or Widget so I guessed it would
be an attribute, but these do not work:


                widget.setAttribute("label", new I18nMessage("text"));


                widget.setAttribute("widget-label", new


Thanks for any suggestions.



View raw message