Re: ListView - modify css for some column
you populate all components inside the listview yourself, so just attach one to the td -igor On Mon, Sep 29, 2008 at 9:23 AM, radovan <[EMAIL PROTECTED]> wrote: > > > > Thies Edeling wrote: >> >> radovan wrote: >>> Hallo community, my code looks like this: >>> >>> listView = new ListView("collectionIterator", >>> listOfMyItems) { >>> >>> @Override >>> protected void populateItem(ListItem item) { >>> MyItem myItem = (MyItem) item.getDefaultModelObject(); >>> String name = myItem.getName(); >>> String value = myItem.getValue(); >>> item.add(new Label("name", name)); >>> item.add(new Label("value", value)); >>> } >>> }; >>> >>> >>> NameValue >>> >>> >>> >>> >>> >>> >>> and I need to change css class for element in table. >>> >>> If I add this: >>> >>> item.add(new AttributeAppender("class", new >>> Model("newCssClass)," ")); >>> >>> It adds this css class for all tags. By oter words for whole row. >>> But I >>> need modify only some , only some column. Could you give me some >>> advice? >>> Thanks a lot >> use an if statement to only add the attribute to that specific td? >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > > ok, but listItem is for whole row (for ), how I get td from listItem? > -- > View this message in context: > http://www.nabble.com/ListView---modify-css-for-some-column-tp19726888p19727084.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ListView - modify css for some column
you should use DataTable instead of ListView for that; there you can easily manipulate by overriding the getCSS() function of the columns. Best, Korbinian radovan schrieb: Hallo community, my code looks like this: listView = new ListView("collectionIterator", listOfMyItems) { @Override protected void populateItem(ListItem item) { MyItem myItem = (MyItem) item.getDefaultModelObject(); String name = myItem.getName(); String value = myItem.getValue(); item.add(new Label("name", name)); item.add(new Label("value", value)); } }; NameValue and I need to change css class for element in table. If I add this: item.add(new AttributeAppender("class", new Model("newCssClass)," ")); It adds this css class for all tags. By oter words for whole row. But I need modify only some , only some column. Could you give me some advice? Thanks a lot. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ListView - modify css for some column
Thies Edeling wrote: > > radovan wrote: >> Hallo community, my code looks like this: >> >> listView = new ListView("collectionIterator", >> listOfMyItems) { >> >> @Override >> protected void populateItem(ListItem item) { >> MyItem myItem = (MyItem) item.getDefaultModelObject(); >> String name = myItem.getName(); >> String value = myItem.getValue(); >> item.add(new Label("name", name)); >> item.add(new Label("value", value)); >> } >> }; >> >> >> NameValue >> >> >> >> >> >> >> and I need to change css class for element in table. >> >> If I add this: >> >> item.add(new AttributeAppender("class", new >> Model("newCssClass)," ")); >> >> It adds this css class for all tags. By oter words for whole row. >> But I >> need modify only some , only some column. Could you give me some >> advice? >> Thanks a lot > use an if statement to only add the attribute to that specific td? > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > ok, but listItem is for whole row (for ), how I get td from listItem? -- View this message in context: http://www.nabble.com/ListView---modify-css-for-some-column-tp19726888p19727084.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ListView - modify css for some column
radovan wrote: Hallo community, my code looks like this: listView = new ListView("collectionIterator", listOfMyItems) { @Override protected void populateItem(ListItem item) { MyItem myItem = (MyItem) item.getDefaultModelObject(); String name = myItem.getName(); String value = myItem.getValue(); item.add(new Label("name", name)); item.add(new Label("value", value)); } }; NameValue and I need to change css class for element in table. If I add this: item.add(new AttributeAppender("class", new Model("newCssClass)," ")); It adds this css class for all tags. By oter words for whole row. But I need modify only some , only some column. Could you give me some advice? Thanks a lot use an if statement to only add the attribute to that specific td? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]