Thanks for looking into this. Here's my ugly hack to get around the problem:
DropDownChoice elevationSelect = new DropDownChoice("elevationSelect") {
private float oldElevation = 0.0f;
public List getChoices() {
return ((HwddcState)
parent.getModelObject()).getElevationList();
}
protected boolean wantOnSelectionChangedNotifications() {
// The following is a hack to be able to record the
// change from the old version. Unfortunately, the old
// version is not available by the time
// onSelectionChanged is called, so it needs to be saved
// here.
HwddcState hwddcState = (HwddcState) parent.getModelObject();
oldElevation = hwddcState.getPpiImageParams().getElevation();
return true;
}
protected void onSelectionChanged(final Object newSelection) {
HwddcState hwddcState = (HwddcState) parent.getModelObject();
final float oldElevation = this.oldElevation;
((PpiPage) getPage()).recordChange(new Change() {
public void undo() {
((HwddcState)
parent.getModelObject()).getPpiImageParams().setElevation(oldElevation);
}
});
hwddcState.getPpiImageParams().setElevation((Float)
newSelection);
((PpiPage) getPage()).updateMapImages();
}
};
elevationSelect.setChoiceRenderer(new ElevationChoiceRenderer());
boundModel.bind(elevationSelect, "ppiImageParams.elevation");
add(elevationSelect);
--
View this message in context:
http://www.nabble.com/DropDownChoice%27s-onSelectionChanged-called-too-late-tf2186138.html#a6058680
Sent from the Wicket - User forum at Nabble.com.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user