Re: Re: AttributeModifier not added to a ListView item via an AjaxLink

2009-06-25 Thread Azzeddine Daddah
Martijn, I tried your solustion(s), but the CSS class of the topicLabel still not updated. public TestPage() { final WebMarkupContainer container = new WebMarkupContainer(container); container.setOutputMarkupId(true); container.add(new ListViewCategory(categories,

Re: AttributeModifier not added to a ListView item via an AjaxLink

2009-06-24 Thread Vasu Srinivasan
Ive got a very similar thing working. I think you may have to return the highlight value dynamically. Try this alternative: item.add(new AttributeModifier(class, true, new AbstractReadOnlyModel() { @Override public Object getObject() { return highlight } }); On Tue, Jun 23, 2009 at

Re: AttributeModifier not added to a ListView item via an AjaxLink

2009-06-24 Thread Azzeddine Daddah
Thanks Vasu for your replay. I've tried your suggestion, but didn't work. This is what I get in the Ajax debuger when I click a certain item: ... li a id=topicLink31 href=# onclick=var

Re: AttributeModifier not added to a ListView item via an AjaxLink

2009-06-24 Thread Vasu Srinivasan
I see you are trying to add the class modifier to item which is ListItem and thats not a HTML component. In my case, I was adding it to the link or label. I think you may have to do something like item.add(new Label(...).add(new AttributeModifier(class, new AbstractReadOnlyModel() ... etc. On

Re: AttributeModifier not added to a ListView item via an AjaxLink

2009-06-24 Thread Azzeddine Daddah
Thanks again Vasu, I've tried your solution but it does not work yet. Below my code: public TestPage() { final WebMarkupContainer container = new WebMarkupContainer(container); container.setOutputMarkupId(true); container.add(new ListViewCategory(categories,

Re: AttributeModifier not added to a ListView item via an AjaxLink

2009-06-24 Thread Martijn Dashorst
listview.setReuseItems(true) Martijn On Wed, Jun 24, 2009 at 5:03 PM, Azzeddine Daddahwaarhei...@gmail.com wrote: Thanks again Vasu, I've tried your solution but it does not work yet. Below my code: public TestPage() {        final WebMarkupContainer container = new

Re: AttributeModifier not added to a ListView item via an AjaxLink

2009-06-24 Thread Martijn Dashorst
or *always* add the attribute modifier and only output the class value when needed. Martijn On Wed, Jun 24, 2009 at 5:13 PM, Martijn Dashorstmartijn.dasho...@gmail.com wrote: listview.setReuseItems(true) Martijn On Wed, Jun 24, 2009 at 5:03 PM, Azzeddine Daddahwaarhei...@gmail.com wrote: