-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
You can use an global command :
the caller code :
Map<String,Object> args = new HashMap<String,Object>();
args.put("data", "postX");
BindUtils.postGlobalCommand(null, null, "doSomeThing", args);
the receiver code :
@GlobalCommand
public void doSomeThing(@BindingParam("data") String data){
//Data is now filled in and you can use here.
}
Take attention that default scope is Desktop, but that is normally good enough.
Greetz chill.
2 | No.2 Revision |
You can use an global command :
the caller code :
Map<String,Object> args = new HashMap<String,Object>();
args.put("data", "postX");
BindUtils.postGlobalCommand(null, null, "doSomeThing", args);
the receiver code :
@GlobalCommand
public void doSomeThing(@BindingParam("data") String data){
//Data is now filled in and you can use here.
}
Take attention that default scope is Desktop, but that is normally good enough.
if you want to use eventQueue see this page :
http://books.zkoss.org/wiki/ZKDeveloper'sReference/EventHandling/EventQueues
Greetz chill.
3 | No.3 Revision |
You can use an global command Oke, now I get it.
If you are gonna do a sendRedirect to another page, you some options.
Option 1: Do a GET to that zul :
the caller code sender :
Map<String,Object> args = new HashMap<String,Object>();
args.put("data", "postX");
BindUtils.postGlobalCommand(null, null, "doSomeThing", args);
Executions.sendRedirect("second.zul?username=MyName");
the receiver code :
@GlobalCommand
public void doSomeThing(@BindingParam("data") String data){
//Data is now filled in and you can use here.
}
Executions.getCurrent().getParameterMap().get("username");
Take attention that default Option 2 : Store it in your session scope is Desktop, but that is normally good enough.
if you want to use eventQueue see this page :
http://books.zkoss.org/wiki/ZKDeveloper'sReference/EventHandling/EventQueuesstore it :
User currentUser = new User();
Session session = Sessions.getCurrent();
session.setAttribute("user", currentUser);
get it from session :
Session session = Sessions.getCurrent();
User currentUser =(User) session.getAttribute("user");
Option 3 : Do a POST method :
well, search for yourself and you will find it how to do it, lots of examples online and with one of the 2 above it will work also.
Hope this helps you.
Greetz chill.
4 | No.4 Revision |
Oke, now I get it.
If you are gonna do a sendRedirect to another page, you some options.
Option 1: Do a GET to that zul :
sender :
Executions.sendRedirect("second.zul?username=MyName");
receiver :
Executions.getCurrent().getParameterMap().get("username");
String username = Executions.getCurrent().getParameter("username");
Option 2 : Store it in your session scope :
store it : User currentUser = new User(); Session session = Sessions.getCurrent(); session.setAttribute("user", currentUser);
get it from session :
Session session = Sessions.getCurrent();
User currentUser =(User) session.getAttribute("user");
Option 3 : Do a POST method :
well, search for yourself and you will find it how to do it, lots of examples online and with one of the 2 above it will work also.
Hope this helps you.
Greetz chill.
5 | No.5 Revision |
Oke, now I get it.
If you are gonna do a sendRedirect to another page, you some options.
Option 1: Do a GET to that zul :
sender :
Executions.sendRedirect("second.zul?username=MyName");
receiver :
String username = Executions.getCurrent().getParameter("username");
Option 2 : Store it in your session scope :
store it :
:
User currentUser = new User();
Session session = Sessions.getCurrent();
session.setAttribute("user", currentUser);currentUser);
get it from session :
Session session = Sessions.getCurrent();
User currentUser =(User) session.getAttribute("user");
Option 3 : Do a POST method :
well, search for yourself and you will find it how to do it, lots of examples online and with one of the 2 above it will work also.
Hope this helps you.
Greetz chill.