-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi zk warriors !! 8D
Actually I'm newbie in ZK framework, I have some experience with php, and I was wondering if it is possible to establish communication between zul files using methods POST and GET to send information from a form, etc. I hope you can give me a clue, Thanks :D
Do you want to call a zk page passing params in the query string?
and you can display the parameters using ExpressionLanguage like this:
if you pass 3 parameters to index.zul:
index.zul?username=lovetide&age=100&p_a_r_a_meterN=hahaha
you can display these parameters in index.zul file via:
username: ${param.username} age: ${param.age} parameterN: ${param.p_a_r_a_meterN}
Hi again lovetide, I have tested using the ExpressionsLanguage version, but zk doesn't accept the ampersand (&) in the string of parameters, my example code is this:
<button label="click me" onClick='Executions.sendRedirect("second.zul?username=MyName&pass=MyPass");' />
With ampersand character the page doens't load, without it load correctly, but MyPass becomes one data, username, Am I doing something wrong or missing something else?
Thank you for your help.
@Pax, if you're are coming from zul and going to another zul why don't you use desktop attributes?
Desktop.setAttribute("username", MyName); ... Desktop.getAttribute("username");
You should get used with ZK fundamentals.
Regards,
see if this works:
<button label="click me" onClick='Executions.sendRedirect("second.zul?username=MyName&pass=MyPass");' />
It might be that the ampersand is getting hosed by the fact that ZUML is XML.
Wow, this code works fine:
<button label="click me" onClick='Executions.sendRedirect("second.zul?username=TheName&password=ThePassword");' />
Works fine representing the ampersand with & amp; and & #38 (html special chars); thank you so much (Y)
Example of fmcypriano also works fine.
Thank you lovetide, your example completes the target.
Now let's get fun with method POST!!
Regards!!
Asked: 2009-11-24 19:53:28 +0800
Seen: 5,110 times
Last updated: Sep 18 '12