availableGridSets = new DropDownChoice<String>("availableGridsets", new Model<String>(),
availableModel);
availableGridSets.setOutputMarkupId(true);
add(availableGridSets);
GeoServerAjaxFormLink addGridsubsetLink = new GeoServerAjaxFormLink("addGridset") {
private static final long serialVersionUID = 1L;
@Override
protected void onClick(AjaxRequestTarget target, Form form) {
availableGridSets.processInput();
final String selectedGridset = availableGridSets.getModelObject();
if (null == selectedGridset) {
return;
}
List<String> choices = new ArrayList<String>(availableGridSets.getChoices());
choices.remove(selectedGridset);
availableGridSets.setChoices(choices);
availableGridSets.setEnabled(!choices.isEmpty());
List<String> selectedIds = selection.getObject();
selectedIds.add(selectedGridset);
// Execute setPageable() in order to re-create the inner record list updated.
defaultGridsetsTable.setPageable(false);
target.addComponent(defaultGridsetsTable);
target.addComponent(availableGridSets);
}
};
addGridsubsetLink.add(new Icon("addIcon", GWCIconFactory.ADD_ICON));
add(addGridsubsetLink);
}