I do it using a behavior. For Components i want to keep enabled i need to
make fields. Then i pass them to the behavior in the constructor.
public class ComponentEnabledBehavior extends Behavior {
private final Component[] notDisabledComponents;
public ComponentEnabledBehavior (Component... notDisabledComponent) {
notDisabledComponents = notDisabledComponent;
}
public ComponentEnabledBehavior () {
notDisabledComponents = null;
}
@Override
public void onConfigure(Component component) {
super.onConfigure(component);
if (someCondition) {
for (Iterator it = ((WebMarkupContainer) component).iterator();
it.hasNext();) {
Component comp = (Component) (it.next());
comp.setEnabled(ArrayUtils.contains(notDisabledComponents,
comp));
}
}
}
}
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/One-field-enabled-in-a-disabled-container-tp4665156p4665180.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]