On 8/10/07, Pantaleoni, Andrea (KCTU) <[EMAIL PROTECTED]> wrote: > > Normally you put in <tr> the wicket:id of the listview component and in > <td> > the single component previously added in the listview > How could you manage that with two listview in the manner you indicate?? > Have you ever tried that? are you sure? > Anyway I guess the problem of the match between components in form object > and > markup do not change > when you create a list view implicit you define a fix number of columns > thet > you add to the listview which in turn you add to the form. > Please, if you can, post the code you used to solve the problem or try to > sketch it. > thanks
Here's a real-life example of a table with dynamic columns: http://fisheye3.cenqua.com/browse/j-trac/trunk/jtrac/src/main/java/info/jtrac/wicket/ItemListPanel.java?r=trunk line 226 is the outer ListView for the <tr> and line 239 is the inner ListView for the coumns. Link to the html below: http://fisheye3.cenqua.com/browse/j-trac/trunk/jtrac/src/main/java/info/jtrac/wicket/ItemListPanel.html?r=trunk Hope this helps. This is btw a totally custom data-table with sorting and even the pagination done from scratch - but all this is very easy with Wicket :) Regards, Peter. -----Original Message----- > From: Paolo Di Tommaso [mailto:[EMAIL PROTECTED] > Sent: 10 August 2007 14:41 > To: [email protected] > Subject: Re: How Can I Implement a Dynamic Table? > > > There are many ways .. > > For example you can have two nested ListView, for example: > > <table > > <tr wicket:id="the-row" > > <td wicket:id="the-column" > value </td> > </tr> > </table> > > The first iterate over the row as usual, and the second over the columns. > > The problem can be reduced to have a valid model to specify the columns. > This could be done, with a simple array of bean attribute names or using > reflection to extract bean getter ... or some other complex way .. > > > - Paolo (at fao.org) > > > > > On 8/10/07, Pantaleoni, Andrea (KCTU) <[EMAIL PROTECTED]> wrote: > > > > Hello, > > I have to implement a dynamic table: depending on user choices or values > > of > > fields in database, the number of columns could change. > > e.g. In same case I can have 3 columns containing Labels or in other > cases > > 5 > > containing Labels and form components(and so on). > > To do that I'm using a ListView inside a WebMarkupContainer(I need to > > implements some ajax behavior too) > > The problems is that wicket require a exact match between components > added > > to > > the form object or page and markup items inside the relative html page > > Someone of you has already faced that problems? > > Any suggestion? > > > > Many Thanks > > Andrea > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
