java - How to avoid cache issue between switching web application versions when using the SmartGwt ListGrid Offline storage? -
i new smart gwt. help of listgrid unique id storing state of listgrid in offline storage. using bundle com.smartgwt.client.util.offline
store state of listgrid. after storing state of listgrid in version1
of software, when upload new version isversion2
,some how listgrid state not changing. using state of version1 though have uploaded new version2 new compiled smart gwt modules. but, when clear browser cache able new state of listgrid. questions is:
is there way new state of listgrid without clearing browser cache when upload new version?
please check sample code form below
public abstract class webuilistgrid extends listgrid { protected grouptypeinfo grouptypeinfo; public final fieldnames fieldnames = fieldnames.getinstance(); public resourcestring resourcestring = null; // constructor of webuilistgrid public webuilistgrid(grouptypeinfo grouptypeinfo) { resourcestring = resourcestring.getinstance(); this.grouptypeinfo = grouptypeinfo; this.groupid = grouptypeinfo.getgroupid(); setlistgridproperties(); } /** * set basic properties */ private void setlistgridproperties() { // id used offline storage setid(getlistgridid() + groupid); addlistgridfield(); // code add together datasorce addds(); // apply state of field using offline storage applyfieldstate(); } /** * store list grid column fields in off line */ public void storefieldstate(){ // here storing state of listgrid. offline.put(getlistgridid(), getviewstate()); } /** * apply list grid column state */ public void applyfieldstate(){ try{ final string viewstate = (string) offline.get(getid()); if (viewstate != null) { adddrawhandler(new drawhandler() { @override public void ondraw(drawevent event) { //restore saved view state grid setviewstate(viewstate); } }); } } catch(exception e) { } fieldstatechangedhandler fieldstatechangedhandler = new fieldstatechangedhandler() { @override public void onfieldstatechanged(fieldstatechangedevent event) { offline.put(getid(), getviewstate()); updatefieldchangecallback(); } }; addfieldstatechangedhandler(fieldstatechangedhandler); } /* * id of offline storage */ private string getid(){ homecoming logininfo.getloginid()+"_"+getlistgridid(); } }
any suggestions appreciated.
java smartgwt
No comments:
Post a Comment