Call function after event block has executed in GWT -


i'm using gwt , have button upon being clicked should filter data being displayed in celltable , hide of columns.

filterbutton.addclickhandler(new clickhandler() {     public void onclick (clickevent event) {         //some working code here minimum , maximum         filter(min, max);         hidecols();     } }); 

my problem here. i've found (from https://developers.google.com/web-toolkit/doc/latest/devguideuicellwidgets#celllist) listdataprovider binds celltable list , changes list reflected in views. views updated @ end of current event block, causes problem. call hidecols() in current event block , hides columns then, far understand, view updated upon exiting block , columns redrawn. there way have hidecols() run after listdataprovider has finished?

filter(int min, int max) {     (siteinfo site : displayedlist)         if (site.num_zones >= min && site.num_zones <= max)             filteredlist.add(site);     dataprovider.getlist().clear();     dataprovider.getlist().addall(filteredlist);     sitetable.setrowcount(filteredlist.size()); } 

lastly here hidecols() function. know works because call elsewhere in code. first line hides column headers , second line takes care of rows respective columns.

private native void hidecols()/*-{     $wnd.jquery("span.tohide").parent().hide();     $wnd.jquery(".tohide").hide(); }-*/; 

any appreciated.

you can redraw synchronously using flush().

but imo should fix hidecols: use addcolumnstylename add class visibility: collapse, or alternately remove cols celltable.

and answer question, can use scheduler.get().schedulefinally (or scheduledeferred if finally not late enough).


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -