I have a ZUL using the ZK framework. I have something like this
<window>
<iframe width="100%" height="100%" src='http://anotherserver/zules/otherzul.zul?parameter=24'/>
</window>
The zul I want to show is on a different server which is using the same philosophy this means is using the ZK framework as well. in fact I can see the zul using my current code. but I need to pass a parameter a simple String
as the show above.
How can I retrieve the parameter in the target ZUL otherzul.zul in the example?
You can do that 2 ways.
In the zul directly :
<label value="${arg.parameter}"/>
The better solution is to do it in the controller/viewmodel.
With this you have a fallback if the arg isn't provided.
You have to do it in the doAfterCompose
For MVC extending the SelectorComposer
the arg is already defined.
private int parameter;
@Override
public void doAfterCompose(Component window) throws Exception {
super.doAfterCompose(window);
if (arg.containsKey("parameter")) {
parameter = (int) arg.get("parameter"));
} else {
//Declare what is is when you don't have the arg
}
}
For MVVM :
String queryParam;
@Init
public void init(@QueryParam("parameter") int parm1){
queryParam = parm1;
}