Re: Problem: Check within a ListView

2008-06-21 Thread Kai Mütz
I have no idea how to implement such a model. Do you have any hint? I am not
sure where/when exactly the IModel.getObject() method is called and where
the missing values can be inserted.

Regards, Kai

2008/6/5 Igor Vaynberg [EMAIL PROTECTED]:

 right, so like that its not going to work. you need a model in between
 that can buffer values and insert missing checked by disabled values.

 -igor

 On Thu, Jun 5, 2008 at 4:36 AM, Kai Mütz [EMAIL PROTECTED] wrote:
  Igor Vaynberg mailto:[EMAIL PROTECTED] wrote:
  it is possible, just depends on how you set up your models. it is not
  possible by directly reading the collection of checkgroup, but you
  can come up with a different way.
 
 
  The checkgroup is part of a form based on a CompoundPropertyModel
 wrapping a
  User object which has a roles property (List). Nothing special.
 
  Kai
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




RE: Problem: Check within a ListView

2008-06-05 Thread Kai Mütz
Igor Vaynberg mailto:[EMAIL PROTECTED] wrote:
 it is possible, just depends on how you set up your models. it is not
 possible by directly reading the collection of checkgroup, but you
 can come up with a different way.


The checkgroup is part of a form based on a CompoundPropertyModel wrapping a
User object which has a roles property (List). Nothing special.

Kai


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem: Check within a ListView

2008-06-05 Thread Igor Vaynberg
right, so like that its not going to work. you need a model in between
that can buffer values and insert missing checked by disabled values.

-igor

On Thu, Jun 5, 2008 at 4:36 AM, Kai Mütz [EMAIL PROTECTED] wrote:
 Igor Vaynberg mailto:[EMAIL PROTECTED] wrote:
 it is possible, just depends on how you set up your models. it is not
 possible by directly reading the collection of checkgroup, but you
 can come up with a different way.


 The checkgroup is part of a form based on a CompoundPropertyModel wrapping a
 User object which has a roles property (List). Nothing special.

 Kai


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem: Check within a ListView

2008-06-04 Thread Kai Mütz
Hi,

I have a ListView nested in a CheckGroup which works actually fine. In some
cases I have to disable (or make invisible) a certain Check within the
Checkgroup. e.g.

CheckGroup roleGroup = new CheckGroup(roles);
add(roleGroup);
roleGroup.add(new CheckGroupSelector(selector));
ListView roleList = new ListView(role-list, new DetachableRolesModel()) {
@Override
protected void populateItem(final ListItem item) {
Check check = new Check(check, item.getModel());
item.add(check);
item.add(new Label(role,
new PropertyModel(item.getModel(), value)));
if (condition) {
check.setEnabled(false);
}
}
};
roleList.setReuseItems(true);
roleGroup.add(roleList);

The problem is that the disabled item is removed from my model while
submitting the form although the disabled checkbox is checked. A disabled
and checked checkbox should not yield to the same result as a enabled and
unchecked checkbox. If I modify it to check.setEnabled(true); everything
works fine. Same with setVisibiliy().

What am I doing wrong?

Kai



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Problem: Check within a ListView

2008-06-04 Thread Kai Mütz
Igor Vaynberg mailto:[EMAIL PROTECTED] wrote:
 you are not doing anything wrong, that is how things are meant to
 work.


So, isn't it possible to add a disabled checkbox to a listview without
removing the item from the corresponding collection?

Kai


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem: Check within a ListView

2008-06-04 Thread Igor Vaynberg
it is possible, just depends on how you set up your models. it is not
possible by directly reading the collection of checkgroup, but you can
come up with a different way.

-igor

On Wed, Jun 4, 2008 at 8:29 AM, Kai Mütz [EMAIL PROTECTED] wrote:
 Igor Vaynberg mailto:[EMAIL PROTECTED] wrote:
 you are not doing anything wrong, that is how things are meant to
 work.


 So, isn't it possible to add a disabled checkbox to a listview without
 removing the item from the corresponding collection?

 Kai


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]