-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
There is only one session for all tabs and each tab has different desktop, you can check it by the sample below:
<zk xmlns:w="client">
<textbox id="tbx" rows="6" width="300px" />
<button label="test">
<attribute name="onClick"><![CDATA[
tbx.setValue("desktop: " + self.getDesktop() +
"\n\nsession: " + Sessions.getCurrent().getNativeSession());
]]></attribute>
</button>
</zk>
Regarding your issue, there are several possible ways to go:
1. Store data with some UNIQUE ids, e.g., Session.setAttribute("USER_NAME", userName); This way you will always keep only one instance of specific data in session.
2. Pass variables by Execution (request scope), e.g., Executions.getCurrent().setAttribute(...) This way those data will only exists while making a request.
3. Handle some specific class (e.g., a map) to store data your self.
4. Avoid opening multiple tabs, I've done a simple sample: full project at github article at my blog
2 | No.2 Revision |
There is only one session for all tabs and each tab has different desktop, you can check it by the sample below:
<zk xmlns:w="client">
<textbox id="tbx" rows="6" width="300px" />
<button label="test">
<attribute name="onClick"><![CDATA[
tbx.setValue("desktop: " + self.getDesktop() +
"\n\nsession: " + Sessions.getCurrent().getNativeSession());
]]></attribute>
</button>
</zk>
Regarding your issue, there are several possible ways to go:
1. Store data with some UNIQUE ids, e.g., Session.setAttribute("USER_NAME", userName); This way you will always keep only one instance of specific data in session.
2. Pass variables by Execution (request scope), e.g., Executions.getCurrent().setAttribute(...) This way those data will only exists while making a request.
3. Handle some specific class (e.g., a map) to store data your self.
4.
Avoid opening multiple tabs, I've done a simple sample:
sample: