If your each
is a String
, which it appears to be as you set it as the column label, just go ahead and pass it as a URL parameter to the iframe
.
<window apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('pkg$.DynamicColumnModel')">
<grid >
<columns>
<column forEach="${vm.columnList}" label="${each}">
<iframe src="test.zul?myValue=${each}" />
</column>
</columns>
</grid>
</window>
Note that when you are using an iframe
component, you are stepping outside ZK. True, the iframe
itself points to a ZK page, but it's a not within the same ZK environment. The iframe
could just as easily include www.google.com
and so there is no specific ZK support for passing values to ZK pages included in this manner.
If you're only including ZK pages and want to pass information to these pages more fluidly, you'll want to use ZK's include
tag. Have a look at the documentation on how to pass values to included ZK pages.
Edit
If going the iframe
route, you can access URL parameter values from test.zul
using ZK's Execution
class:
Execution execution = Executions.getCurrent();
execution.getParameter("myValue");