Just an idea :)
private final IModel yesNoState = new Model();
final TextField textField = new TextField("text", ...);
textField.setOutputMarkupId(true);
...
add(new AbstractBehavior() {
@Override
public void configure(Component component) {
component.setVisible(Boolean.TRUE.equals(yesNoState.getObject()));
}
});
add(textField);
RadioGroup yesNoGroup = new RadioGroup("yesNoGroup", yesNoState );
yesNoGroup.add(AjaxFormChoiceComponentUpdatingBehavior()) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
textField.setVisible(Boolean.TRUE.equals(yesNoState.getObject()));
target.addComponent(textField);
}
});
add(yesNoGroup);
yesNoGroup.add(new Radio("yes", Model.of(Boolean.TRUE));
yesNoGroup.add(new Radio("no", Model.of(Boolean.FALSE));
And markup:
-----
--
http://www.linkedin.com/in/amorozov
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Radio-button-selection-tp4085827p4088304.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]