0
final TextField<Double> regularPrice = new TextField<Double>("regular", new PropertyModel<Double>(listItem.getModel(), "price"))
{
private static final long serialVersionUID = 1L;
@Override
protected void onConfigure()
{
super.onConfigure();
setEnabled(cashflowStatus.compareTo(CashflowStatus.M_MANUAL) < 0);
}
};
listItem.add(regularPrice);
regularPrice.add(new AjaxFormComponentUpdatingBehavior("onChange")
{
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target)
{
Double updatedValue = listItem.getModelObject().getPrice());
}
});
我希望在更改时获得新的更新值,但我从模型中获取旧值。模型没有更新,它应该提供新的更新值。请让我知道,上面的代码中出现了什么问题,以及如何获取更新的值?如何从文本框/模型中获取更新值