IDEMPIERE-231 Zk6: Improve the tablet experience. Fixed ClientInfo NPE when user refresh browser.
This commit is contained in:
parent
581f458ddf
commit
e813293d21
|
@ -87,7 +87,7 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
||||||
|
|
||||||
private IDesktop appDesktop;
|
private IDesktop appDesktop;
|
||||||
|
|
||||||
private ClientInfo clientInfo;
|
private ClientInfo clientInfo = new ClientInfo();
|
||||||
|
|
||||||
private String langSession;
|
private String langSession;
|
||||||
|
|
||||||
|
@ -99,6 +99,8 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
||||||
|
|
||||||
public static final String ZK_DESKTOP_SESSION_KEY = "zk.desktop";
|
public static final String ZK_DESKTOP_SESSION_KEY = "zk.desktop";
|
||||||
|
|
||||||
|
private static final String CLIENT_INFO = "client.info";
|
||||||
|
|
||||||
public AdempiereWebUI()
|
public AdempiereWebUI()
|
||||||
{
|
{
|
||||||
this.addEventListener(Events.ON_CLIENT_INFO, this);
|
this.addEventListener(Events.ON_CLIENT_INFO, this);
|
||||||
|
@ -256,6 +258,10 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
||||||
|
|
||||||
currSess.setAttribute(ZK_DESKTOP_SESSION_KEY, this.getPage().getDesktop());
|
currSess.setAttribute(ZK_DESKTOP_SESSION_KEY, this.getPage().getDesktop());
|
||||||
ctx.put(ZK_DESKTOP_SESSION_KEY, this.getPage().getDesktop());
|
ctx.put(ZK_DESKTOP_SESSION_KEY, this.getPage().getDesktop());
|
||||||
|
ClientInfo sessionClientInfo = (ClientInfo) currSess.getAttribute(CLIENT_INFO);
|
||||||
|
if (sessionClientInfo != null) {
|
||||||
|
clientInfo = sessionClientInfo;
|
||||||
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
//restore fail
|
//restore fail
|
||||||
appDesktop = null;
|
appDesktop = null;
|
||||||
|
@ -359,6 +365,9 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
||||||
clientInfo.tablet = true;
|
clientInfo.tablet = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (getDesktop() != null && getDesktop().getSession() != null) {
|
||||||
|
getDesktop().getSession().setAttribute(CLIENT_INFO, clientInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue