Please post messages like this on the users list in the future.
On Tue, 02 Sep 2008, wch2001 wrote:
> I have one ListView , inside need to add checkbox for users to select, only
> can select one, how can i do? thanks a lot.
Shouldn't it be a RadioButton instead of CheckBox, then?
I would try something like
chkPhotoMain.add(newAjaxFormComponentUpdatingBehavior("onClick") {
@Override
protected void onUpdate(final AjaxRequestTarget target) {
ListView fileList = (ListView) findParent(ListView.class);
fileList.visitChildren(CheckBox.class, new IVisitor() {
public Object component(Component checkbox) {
doDisableOrSetModelObjectFalseOrWhatEverYouWantWith(checkbox);
target.addComponent(component);
}
});
}
});
> item.add(new AttributeModifier("class", true, new
> AbstractReadOnlyModel() {
>
> @Override
> public Object getObject() {
> return ((item.getIndex() % 2) == 1) ? "even" :
> "odd";
> }
I think that OddEvenRowItem or something like that provides
this part out of the box.
Best wishes,
Timo
--
Timo Rantalaiho
Reaktor Innovations Oy <URL: http://www.ri.fi/ >