hi fellow wicket users,
i have some trouble to access the currently selected item of a Palette
component. By selected i mean the item which is highlighted if a user
clicks on any of the items within the palette. i need that access
because i want to update an Image component which renders an image which
reflects the selected item
here is the (simplified) piece of code i use to get notified if the
palette is clicked:
final Palette palette = new Palette("palette", mediaModel, paletteModel
, renderer, 10, true) {
private static final long serialVersionUID =
-5683120408447757525L;
@Override
protected void onBeforeRender() {
super.onBeforeRender();
getChoicesComponent().add(new
AjaxFormComponentUpdatingBehavior("onclick") {
private static final long serialVersionUID =
-6216894553871444828L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
/**
I imagine something like this should do
the trick, but i can't find anything like it:
Media m = getSelectedItem();
imgPanel.setFilname(m.getFileName());
*/
target.addComponent(imgPanel);
}
});
}
};
max
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]