two suggestions, 1)emptyrow.setoutputmarkupplaceholdertag(true) instead of setoutputmarkupid(true). 2)you can use dataview.getitemscount() instead of data.size() as later can be expensive.
On Sun, Feb 14, 2010 at 8:11 AM, <b...@actrix.gen.nz> wrote: > Hi all, > > How is it possible to dynamically show and hide an additional dummy > row "No items to show" below a DataView? > > I tried this with code similar to code below but it does not work even > though isVisible() is called. I have a small testcase ready to go. > It's quite basic so I must be missing something obvious. > > Many thanks > > Bernard > > > In a DataView, with an AjaxFallbackLink delete action, in onClick I do > something like > > item.setVisible(false); > target.addComponent(item); > target.addComponent(emptyRow); > > with emptyRow as follows: > > final WebMarkupContainer emptyRow = new > WebMarkupContainer("emptyRow"){ > @Override > public boolean isVisible(){ > return rowProvider.size() == 0; > } > }; > emptyRow.setOutputMarkupId(true); > add(emptyRow); > > In HTML: > > <tr wicket:id="dataRow"> > <td wicket:id="Id">ID</td> > <td><a wicket:id="delete">Delete</a></td> > </tr> > <tr wicket:id="emptyRow"> > <td colspan="2">No Items to show</td> > </tr> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- regards, Vineet Semwal