0

Pass values from javscript to ZK elements in JSP

asked 2009-08-14 07:14:24 +0800

ramyaguptha gravatar image ramyaguptha
27

Hi,
I need some help. I have embedded ZK component in JSP page. I used to pass variables from om JSP to ZK by setting request parameter
<% requestParameter.setAttribute("info","abcd") %> and access it through requestscope in Zk component like
<z:button id="btn" label="click">
<z:attribute name="onClick">{
Window win = Path.getComponent(mainScr_win,"main_win");
Desktop d = win.getDesktop();
String info= requestScope.get("info")+"";
d.setAttribute("info",info);
com.tcs.travel.ticketing.SeatMap sh= new com.tcs.travel.ticketing.SeatMap();
sh.call(d);

}</z:attribute>
</z:button>
This works perfetly fine.
Now the case is 1: The "info" attribute is not static it changes based on users action on the page so its value is needs to be set in javascript. so i cant use <% %>
2: The ZK button is replaced by flash component. So i want to know how can i invoke Zscript from javascript.

Could you please help me . I m using ZK 3.6.1

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2009-08-18 09:23:22 +0800

PeterKuo gravatar image PeterKuo
481 2

I haven't tried, but I believe Similar trick can help you.
http://docs.zkoss.org/wiki/ZK/How-Tos/Concepts-and-Tricks#Pass_JavaScript_variable_value_to_ZK_Server

link publish delete flag offensive edit

answered 2009-08-18 16:01:18 +0800

ramyaguptha gravatar image ramyaguptha
27

Hi Peter,

Thanks a lot. I also came across this in the forum
http://www.zkoss.org/forum/index.zul#path%3DlistComment%3BdiscussionId%3D3730%3BcategoryId%3D14%3B

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-08-14 07:14:24 +0800

Seen: 326 times

Last updated: Aug 18 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More