-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hi guys,,
can u help me to find the way of getting a Composer instance..
because i wan to use the attributes or functions which is defined in the composer..
for Example i have the instance of a Window
that Window apply class AldianComposer
can i get the AldianComposer's instance that is used by the Window.
in this case i just can access the instance of the Window..
anyone can help me? i need it very much..
Thx before for helping..
Regards,,
Aldian Bagya
In the GenericForwardComposer is only ONE methode that you can access.
You can override it in your own Controller:
public class BranchListCtrl extends GenericForwardComposer implements Serializable { protected Window windowBranchList; // autowired @Override public void doAfterCompose(Component window) throws Exception { super.doAfterCompose(window); /** * 1. Set an 'alias' for this composer name to access it in the * zul-file.<br> * 2. Set the parameter 'recurse' to 'false' to avoid problems with * managing more than one zul-file in one page. Otherwise it would be * overridden and can ends in curious error messages. */ self.setAttribute("controller", this, false); . . . } . . . }
Hi aldian,
Once you set your controller using the way stephan pointed out
self.setAttribute("controller", this, false);
you can retrieve the controller using your window instance with
BranchListCtrl ctrl = (BranchListCtrl ) window.getAttribute("controller");
Asked: 2010-08-11 04:24:36 +0800
Seen: 483 times
Last updated: Aug 12 '10