-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hi,
i have two controllers (classes that extends SelectorComposer<Component>
)
how can i wire the first controller to the second?
What i actually need is the first controller to access the components of the second
You can save your first controller in the session in the doAfterCompose
like this :
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
Sessions.getCurrent().setAttribute("controllerX", this);
}
and in the other controller you can do the following :
private ControllerX controllerX;
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
controlerX = (ControllerX)Sessions.getCurrent().getAttribute("controllerX");
}
This will work when ControllerX is created before the other controller.
Otherwise shall controllerX be null
.
Hope this can help you.
Greetz chill.
Asked: 2014-03-20 15:43:16 +0800
Seen: 14 times
Last updated: Mar 24 '14
ZK Calendar Wire Spring-managed Beans Failed [closed]
onBookmarkChange and update component via ajax
Wire variables in view model : Null pointer exception
@WireVariable can be replaced by @Configurable without side effects?
How to properly wire variable?