On 6/24/07, James Law <[EMAIL PROTECTED]> wrote:
Hi,
I am currently evaluating using wicket on my next project. So far I am
really impressed with wicket!
Quick question- After using it for a few days, it seems there must
always be items in the markup(html) for each associated component in a
webpage java file. In some screens we have built in the past, due to the
complexity, the widgets are database driven. That is to say, the number
of select boxes, is driven off a db. It is more complicated than this,
but basically in struts, we would use nested beans with a lot of nasty
conditional logic so there would not need a static placeholder in the
.html file. (jsp).
Is this possible to do with wicket?
Thanks
James
sure. the basic idea is this
add a RepeatingView that is bound to a generic div tag. then into this
repeater add fragments/panel dynamically.
so lets say your db lists: selecbox,label,selectbox
you would have a fragment/panel that has a selectbox and one that has a
label.
then just do
RepeatingView rv=new RepeatingView("rv");
for (item:items) {
WebMarkupContainer rvitem=new WebMarkupContainer(rv.newChildId());
rv.add(rvitem);
switch (item.gettype()) {
case seletbox: rvitem.add(new selectboxfragment("sb"); break;
case label: rvitem.add(new labelfragment("lbl"));
}}
fragments can contain other repeating views with other fragments. nest to
your heart's content.
-igor
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user