You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Tauren Mills <ta...@groovee.com> on 2007/08/12 22:09:40 UTC

DataTable with two TR's per row of data?

I would like to display two table rows for each row of data within a
DataTable and would like suggestions on a good way to do that.

Basically, I want output like this for each row of data:

<tr>
  <td>id</td>
  <td>name</td>
  <td>edit</td>
  <td>delete</td>
</tr>
<tr>
  <td>&nbsp</td>
  <td colspan="3">long description</td>
</tr>

This is a very simplified version, but it illustrates what I want to do.

In reality, I'd like to have an ajax link in the 1st row that reveals
the second row when selected.  The 2nd row would have all sorts of
additional details about that row of data, but would only display them
if the user selects the "full details" link.

BTW, I'm building this application by starting with wicket-phonebook.
So any suggestions that would work for it will work for me.

Thanks!
Tauren

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: DataTable with two TR's per row of data?

Posted by Tauren Mills <ta...@groovee.com>.
Thanks Eelco,

That's what I have done using DataViews in wicket 1.2.6, and then set
the span to not render so the html validates.  But using a DataTable,
the html markup is just this:

<table wicket:id="data" cellspacing="0" cellpadding="2" class="grid">
</table>

I wasn't sure if there was an easy way to get the behavior I want.  I
like that DataTable has sorting/filtering/etc all ready to go, so it
would be nice if I could somehow still use it and not have to use a
DataView.  It looks like DataTable is based on columns, not rows, so I
couldn't subclass a row object with my own markup. But maybe I'm
mistaken.

I have a feeling that DataTable is only suited for the most common
uses, but if there are any ideas on how to do it, I'd love to hear
them.

Thanks again,
Tauren


On 8/12/07, Eelco Hillenius <ee...@gmail.com> wrote:
> > I would like to display two table rows for each row of data within a
> > DataTable and would like suggestions on a good way to do that.
> >
> > Basically, I want output like this for each row of data:
> >
> > <tr>
> >   <td>id</td>
> >   <td>name</td>
> >   <td>edit</td>
> >   <td>delete</td>
> > </tr>
> > <tr>
> >   <td>&nbsp</td>
> >   <td colspan="3">long description</td>
> > </tr>
> >
> > This is a very simplified version, but it illustrates what I want to do.
>
> Do something like:
>
> <span wicket:id="rows">
>   <tr><td>id</td><td>name</td><td>edit</td><td>delete</td></tr>
>   <tr><td>&nbsp</td><td colspan="3">long description</td></tr>
> </span>
>
> > In reality, I'd like to have an ajax link in the 1st row that reveals
> > the second row when selected.  The 2nd row would have all sorts of
> > additional details about that row of data, but would only display them
> > if the user selects the "full details" link.
>
> Same idea.
>
> Eelco
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: DataTable with two TR's per row of data?

Posted by Eelco Hillenius <ee...@gmail.com>.
> I would like to display two table rows for each row of data within a
> DataTable and would like suggestions on a good way to do that.
>
> Basically, I want output like this for each row of data:
>
> <tr>
>   <td>id</td>
>   <td>name</td>
>   <td>edit</td>
>   <td>delete</td>
> </tr>
> <tr>
>   <td>&nbsp</td>
>   <td colspan="3">long description</td>
> </tr>
>
> This is a very simplified version, but it illustrates what I want to do.

Do something like:

<span wicket:id="rows">
  <tr><td>id</td><td>name</td><td>edit</td><td>delete</td></tr>
  <tr><td>&nbsp</td><td colspan="3">long description</td></tr>
</span>

> In reality, I'd like to have an ajax link in the 1st row that reveals
> the second row when selected.  The 2nd row would have all sorts of
> additional details about that row of data, but would only display them
> if the user selects the "full details" link.

Same idea.

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org