Yeah, AttributeModifier is the right way to go. Especially in your
case, because you probably want to do something like this:
Your listview:
...
protected abstract void populateItem(final ListItem item) {
NewsItem newsItem = (NewsItem)item.getModelObject();
String id = (newsItem.isCool()) ? "newsEntryHot" : "newsEntryBoring";
WebMarkupContainer outerDiv = new WebMarkupContainer("outer");
outerDiv.add(new SimpleAttributeModifier("id", id));
item.add(outerDiv);
... // etc
}
Eelco
On 2/12/06, Tom S. <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm new to Wicket and so far I like it. :)
>
> I want to show a small news-list on a page and use a ListView for that. In
> the html-page it looks like this:
>
> <span wicket:id="news">
> <div id="newsEntryHot">
> <div id="newsDate">
> <span wicket:id="date">06-01-05</span>
> </div>
> <div id="newsHeadline">
> <span wicket:id="headline">App released</span>
> </div>
> <div id="newsContent">
> <span wicket:id="message">Bla bla</span>
> </div>
> </div>
> </span>
>
> We have defined different looks for "hot" and "normal" news. Hot news should
> have the outer div with id="newsEntryHot", normal ones with a different id.
> The information is locally available as a boolean property of the NewsEntry.
>
> How do I change the id-parameter? I've found the AttributeModifier class,
> but have not clue, whether it is the right thing and/or how to use it, esp.
> the related model.
>
> Thanks in advance,
> Tom
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user