java - What is the different between using TextChangeEvent getText() and TextField getValue() in TextChangeListener -
i new vaadin, try filter out data on table. add textfield declared isocode
, add textchangelistener it.
when use isocode.getvalue()
value filter string, didn't work.
but when use textchangeevent event.gettext()
value work perfectly. can explain me tell why?
final textfield isocode = new textfield(); isocode.setinputprompt("iso code"); isocode.addtextchangelistener(new textchangelistener(){ private static final long serialversionuid = 1l; simplestringfilter filter = null; @override public void textchange(textchangeevent event) { /** * code not working * if(isocode.getvalue().trim().length() > 0){ filter = new simplestringfilter("iso code", event.gettext(),true, false); appn0010form.removeallcontainerfilters(); appn0010form.addcontainerfilter(filter); } */ /** * code working */ if(event.gettext().trim().length() > 0){ filter = new simplestringfilter("iso code", event.gettext(),true, false); appn0010form.removeallcontainerfilters(); appn0010form.addcontainerfilter(filter); } } });
isocode.getvalue()
gives value of textfield before binding latest value.
where event.gettext()
gives value after binding latest value.
newly typed value bind after blur of textfield.
Comments
Post a Comment