Hi all,
An example is described here:
http://cwiki.apache.org/WICKET/how-to-modify-an-attribute-on-a-html-tag.html
If have taken a look at the example given above, but it still doesn't work.
Wicket won't change the value of the class attribute.
Ted
Show us some of your code.
2006/12/1, Ted Roeloffzen [EMAIL PROTECTED]:
Hi all,
An example is described here:
http://cwiki.apache.org/WICKET/how-to-modify-an-attribute-on-a-html-tag.html
http://cwiki.apache.org/WICKET/how-to-modify-an-attribute-on-a-html-tag.html+
If have taken
list.add(new AttributeModifier(class, new Model() {
public Object getObject(final Component component)
{
String cssClass;
if(isHorizontal)
{
cssClass = menuItemsHorizontal;
} else {
cssClass = menuItemsVertical;
}
return cssClass;
}
}));
This is almost
And your html?
2006/12/1, Ted Roeloffzen [EMAIL PROTECTED]:
list.add(new AttributeModifier(class, new Model() {
public Object getObject(final Component component)
{
String cssClass;
if(isHorizontal)
{
cssClass = menuItemsHorizontal;
} else {
cssClass =
Hi Ted,
I see that the component is called 'list'.
If it is a ListView (or similar) you should also read the FAQ entry on
http://cwiki.apache.org/WICKET/listview-and-other-repeaters.html.
Regards,
Erik.
Ted Roeloffzen wrote:
list.add(new AttributeModifier(class, new Model() {
wicket:panel
ul wicket:id=menuItems class=menuItemsVertical
lia wicket:id=menuItem class=menuItemdiv wicket:id=menuItemLabel
/div/a/li
/ul
/wicket:panel
-
Take Surveys. Earn Cash. Influence the Future of IT
Join
It is indeed a ListView.
Which is attached to an UL-tag
Ted
2006/12/1, Erik van Oosten [EMAIL PROTECTED]:
Hi Ted,
I see that the component is called 'list'.
If it is a ListView (or similar) you should also read the FAQ entry on
add the attribute modifier to the ITEM instead of the list.
Martijn
On 12/1/06, Ted Roeloffzen [EMAIL PROTECTED] wrote:
It is indeed a ListView.
Which is attached to an UL-tag
Ted
2006/12/1, Erik van Oosten [EMAIL PROTECTED]:
Hi Ted,
I see that the component is called 'list'.
If
Hi all,
Is it possible to change the class attribute of a tag at run-time using
Wicket?
I need multiple instances of the same component, but with different styles.
Ted
-
Take Surveys. Earn Cash. Influence the Future of IT