Hello everyone!
I want to disable remove button when the list of selected choices is empty.
Below is my sublclass. But when I click on the button browser says that
"Component with id [[contentPanel_pupilForm_pupilPalette_addButton]] a was
not found while trying to perform markup update. ..." As you see I call
setOutputMarkupId(true). What's wrong?
[code]
private class PupilPalette extends Palette {
private Component addButton;
private Component removeButton;
public PupilPalette(final String id, final IModel model,
final IModel choicesModel, final
IChoiceRenderer choiceRenderer,
final int rows, final boolean allowOrder) {
super(id, model, choicesModel, choiceRenderer, rows,
allowOrder);
setOutputMarkupId(true);
getRecorderComponent().add(new
AjaxFormComponentUpdatingBehavior("onchange") {
@Override
protected void onUpdate(final AjaxRequestTarget
target) {
addButton.setEnabled(availablePupils.size() == selectedPupils.size());
removeButton.setEnabled(selectedPupils.isEmpty());
target.addComponent(addButton);
target.addComponent(removeButton);
}
});
}
/** [EMAIL PROTECTED] */
@Override
protected Component newAvailableHeader(final String
componentId) {
return new Label(componentId,
getString("available.pupils"));
}
/** [EMAIL PROTECTED] */
@Override
protected Component newSelectedHeader(final String componentId)
{
return new Label(componentId,
getString("selected.pupils"));
}
/** [EMAIL PROTECTED] */
@Override
protected Component newAddComponent() {
addButton = super.newAddComponent();
addButton.setOutputMarkupId(true);
return addButton;
}
/** [EMAIL PROTECTED] */
@Override
protected Component newRemoveComponent() {
removeButton = super.newRemoveComponent();
removeButton.setOutputMarkupId(true);
return removeButton;
}
}
[/code]
wheleph
--
View this message in context:
http://www.nabble.com/Disabling-Palette-buttons-tf4732206.html#a13531373
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]