-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have an application in ZK providers in my database, and i have my DAO to return all the names of my database.
And i have this view in ZK:
<zk>
<window id="Mnos" border="normal" mode="modal" width="320px"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('operator')">
<listbox model="@load(vm.provider)" onClick="@command('provider', provider = each)"/>
</window>
</zk>
I need that when a user do click in some provider, save a session variable to use in my application, because i have a crud of services and when i create a service i need create the service related with the provider that the user choose in the menu, and i need create workers and i need create a worker related with the provider that the user choose in the menu,
and i have this java class:
public class operator {
Collection<String> provider = MnoDAO.getAllProvidersByName();
public Collection<String> getMno() {
return mno;
}
@Command
public void saludo(@BindingParam("provider") String provider){
Messagebox.show("Hola ... "+mnoList);
}
}
But each
is null, and second i do not know how can i save a sesion variable to use in all application, and this variable can be change when i select other provider.
Somebody can help me?
Hi,
I don't understand all you are talking about so I made you sample code run, and added functionality to save and load a session attribute. Please have a look at this example code in zk fiddle.
If you click the "run" button at the top you can see it in action. Also notice, that a value stored, will still be available if you close the sample an rerun it (because it is saved to the session).
Robert
Asked: 2013-10-01 00:59:02 +0800
Seen: 31 times
Last updated: Oct 02 '13