add(new ListView("rows", Arrays.asList(pick.getPickDetails()))
{
protected IModel getListItemModel(IModel arg0, int arg1) {
return new
CompoundPropertyModel(super.getListItemModel(arg0, arg1));
}
protected void populateItem(final ListItem item) {
final PickDetail pickDet =
(PickDetail)item.getModelObject();
item.add(new Label("numberOfItems"));
item.add(new Label("batchCode"));
}
});
Rename the ID of the first label. See the documentation on
CompoundPropertyModel for more information.
Martijn
Huy Do wrote:
Hi,
Please see code below in relation to my question
add(new ListView("rows", Arrays.asList(pick.getPickDetails()))
{
protected void populateItem(final ListItem item) {
final PickDetail pickDet =
(PickDetail)item.getModelObject();
item.add(new Label("items",
pickDet.getNumberOfItems().toString()));
item.add(new Label("batchCode",
pickDet.getBatchCode()));
}
});
Is there some sort of shortcut for the list view to use java bean
properties which can then be accessed in the html
as <span wicket:id="bean.getProperty()">blah</span> this would
simplify things alot without the verbose Label code.
Of course the existing method is still useful when you need more
control but most of the time, it just adds additional code which I
really don't want to write :-)
Regards,
Huy
-------------------------------------------------------
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
Wicket-user@lists.sourceforge.net
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user