How to add EL expression in javascript code?

asked 2009-12-08 10:04:30 +0800

kesavkolla gravatar image kesavkolla
180 3

I have to pass some information to client side scripting so I want to use EL expression to render certain information. My code is like the following:

<zk forEach="${mpiview$composer.examDates }">
<toolbarbutton label="${fmt:format(each) }">
<attribute w:name="onClick">
//Here I want to get some value from the each value
var val = ${each.time};

The ${each.time} doesn't work. How can I pass information to client side script during page generation?

Thanks in advance.

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2011-03-24 04:43:22 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16


link publish delete flag offensive edit

answered 2011-03-25 00:23:59 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

It was supported since 5.0.2 (feature 2979894: Widget's client script supports EL).

For example,

<window xmlns:w="http://www.zkoss.org/2005/zk/client" title="Hello" w:xtitle='"title:${self.title}"'>
  <button label="test1" w:onClick="jq.alert(this.parent.xtitle)"/>
  <button label="test2" w:onClick="jq.alert('${self.parent.title}')"/>
  <button label="test3" w:onClick="jq.alert('\n$\{self.parent.title\}')"/>

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




Asked: 2009-12-08 10:04:30 +0800

Seen: 1,590 times

Last updated: Mar 25 '11

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