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]

Reply via email to