i have dialog show values. need know if user has changed something.
all fields wrapped in eclipse databindingcontext.
... bindingcontext.bindvalue(process_observable_milage, process_bean_mileage, new updatevaluestrategy(), null); ... if change fields, propertychangesupport listener inside model gets fired. (setter of property called).
this.firepropertychange(signalentity.signalname, this.signalname, this.signalname = name); now need global listener detect if value changed.
i tried following without success:
iobservablevalue globalvalidity = new writablevalue(); globalvalidity.addchangelistener(new ichangelistener() { @override public void handlechange(changeevent event) { dirty = true; } }); bindingcontext.bindvalue(globalvalidity, new aggregatevalidationstatus(bindingcontext.getbindings(), aggregatevalidationstatus.max_severity), null, null); this class afterconvertvalidators added. thought have use "addvaluechangelistener" instead not working.
iobservablevalue globalvalidity = new writablevalue(); globalvalidity.addvaluechangelistener(new ivaluechangelistener() { @override public void handlevaluechange(valuechangeevent event) { dirty = true; } }); bindingcontext.bindvalue(globalvalidity, new aggregatevalidationstatus(bindingcontext.getbindings(), aggregatevalidationstatus.max_severity), null, null); any ideas how achieve this?
best regards
i use:
iobservablevalue seterror = pojoproperties.value("error").observe(new seterror()); bindingcontext.bindvalue(seterror, new aggregatevalidationstatus(bindingcontext.getbindings(), aggregatevalidationstatus.max_severity)); private class seterror { public istatus geterror() { return validationstatus.ok(); } public void seterror(final istatus status) { final string msg = status.isok() ? null : status.getmessage(); // todo deal message / status } }
Comments
Post a Comment