I don't think so, or at least it's the step beyond that that I'm not
seeing. My tries with a ListView gave me a repeated set of
<td>item</td> blocks, (using a Label for the item), but I can't see
how I can generate something like:-
<td>
item1<br>
item2<br>
..
item10<br>
</td><td>
item11<br>
item12<br>
..
</td>
I think that if the original 1-row format isn't kept, I might be able
to do something similar, where the key might be to explicitly re-map
the input list into a list of 'horizontal' lists, then use a series of
<tr>'s enclosing <td>'s, each enclosing a single item, but that didn't
seem to be all that simple/clean and I wondered if I was missing
something obvious... (Maybe I need to investigate extending
ListMultipleChoice or it's parent, and see where that gets me.)
/Gwyn
On 16/08/05, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> First a Form. The a ListView. And for each row a Label and a CheckBox
> component? As the checkboxes paths are unique for each row, you should
> have no problems there.
>
> Doesn't that work for you?
>
> Eelco
>
> Gwyn Evans wrote:
>
> > Hi,
> > I'm currently trying to 'mirror' a quick & dirty JSP page in Wicket
> > & wondering how best do a particular thing...
> >
> > I've got a list of Services, with basically a String ('name') and a
> > boolean attribute ('free'). There are 90-odd of these, and I need to
> > display them as checkboxes in a set of columns. The Q&D JSP method
> > puts them in a table, with a set of checkboxes making up a column in a
> > <td>...</td>, as below...
> >
> > String generateServiceTable(List services, int colSize, String
> > listName) {
> > int cols = (services.size() / colSize) + 1;
> > StringBuffer sb = new StringBuffer();
> > sb.append("<table ><tr>\n");
> > int rows = 0;
> > for (int i = 0, ; i < services.size(); i++) {
> > Service service = (Service) services.get(i);
> > if (rows == 0) {
> > sb.append("<td valign=top width=\"" + 100 / cols +
> > "%\">\n");
> > }
> > rows++;
> > sb.append("<input type=\"checkbox\" name=\"" + listName +
> > "\" value=\"");
> > sb.append(service.getName());
> > sb.append("\"");
> > if (service.isFree()) {
> > sb.append(" checked");
> > }
> > sb.append(">");
> > sb.append(service.getName());
> > sb.append("<br>\n");
> > if (rows == colSize) {
> > sb.append("</td>\n");
> > rows = 0;
> > }
> > }
> > sb.append("</tr>\n");
> > sb.append("</table>\n");
> > return sb.toString();
> > }
> >
> > so I get a
> >
> > a1[] a11[] a21[] a31[] ...
> > a2[] a12[] a22[] a32[] ...
> > ...
> > a10[] a20[] a30[] a40[] ...
> >
> > effect, but I'm having difficulty working out a good/clean/simple way
> > of achieving the same result with Wicket.
> > (Note that using the same name on the checkboxes results in them
> > behaving in the same way as a multiple-choice list does, in terms of
> > what the browser dispatches, at least.)
> >
> > I had this all working happily, using a ListMultipleChoice, so I've
> > got the 'surrounding' form/model, etc, it's just how best to do this
> > that's unclear...
> >
> > /Gwyn
>
>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user