Frank
On 11/9/06, Flemming Seerup
<[EMAIL PROTECTED]> wrote:
CheckGroup sounds right ... but I'm not sure where ICellPopulator should be
used.
And I keep getting Invalid boolean value "MasterReference". somehow I
missing a
method to tell wicket if the checkbox should be checked, right?
My code is currently:
------------------------------------------------------------
TestModel inputModel = new TestModel();
CheckGroup imageGroup = new CheckGroup(
"imagesSelected",
new PropertyModel(inputModel, "selected"));
add(imageGroup);
GridView gridView = new GridView("rows", provider) {
private static final long serialVersionUID = 4252215707308269580L;
protected void populateItem(Item item) {
final ImageReference reference = (ImageReference) item.getModelObject();
log.info("adding thumbnail: " + reference);
ThumbnailImageFragment thumbnail = new ThumbnailImageFragment(
"thumbnail",
reference,
item.getModel());
item.add(thumbnail);
}
protected void populateEmptyItem(Item item) {
ThumbnailEmptyFragment thumbnail = new ThumbnailEmptyFragment("thumbnail");
log.info("adding filler");
item.add(thumbnail);
}
};
gridView.setRows(3);
gridView.setColumns(3);
imageGroup.add(gridView);
------------------------------------------------------------
public ThumbnailImageFragment(String id, final ImageReference
reference, IModel
itemModel) {
super(id);
CheckBox checkBox = new CheckBox("select", itemModel);
add(checkBox);
BookmarkablePageLink imageLink = InboxDisplay.link("imagelink", reference);
imageLink.add(new Image("image", getThumbnailResource(reference)));
add(imageLink);
BookmarkablePageLink textLink = InboxDisplay.link("textlink", reference);
textLink.add(new Label("imagename", reference.getImage().getUniqueName()));
add(textLink);
}
------------------------------------------------------------
Quoting Frank Bille <[EMAIL PROTECTED]>:
> I have never used GridView myself, but how about putting a CheckGroup around
> the GridView and then add a Check in the ICellPopulator? Something like
> this:
>
> public class PojoForTellingWhichChecksHasBeenClicked {
> private Set selectedChecks;
> // Getters and setters
> }
>
> PojoForTellingWhichChecksHasBeenClicked pojo = new
> PojoForTellingWhichChecksHasBeenClicked();
> CheckGroup cg = new CheckGroup("checkGroup", new PropertyModel(pojo,
> "selectedChecks"));
> GridView gv = new GridView("gw", SOME_PARAMETERS);
> cg.add(gv);
>
> And then a ICellPopulator:
>
> new ICellPopulator() {
> public void populateItem(final Item cellItem, final String componentId,
> final IModel rowModel) {
> cellItem.add(new Check(componentId, rowModel));
> }
> };
>
>
> Makes sense?
>
> Frank
>
>
> On 11/9/06, Flemming Seerup < [EMAIL PROTECTED]> wrote:
>>
>> How do I use CheckBox in a GridView component, and find the seleted in the
>> onSubmit method ?
>>
>> /Flemming
>>
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>> -------------------------------------------------------------------------
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job
>> easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> _______________________________________________
>> Wicket-user mailing list
>> Wicket-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
>
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user