0

Use javascript in zul component

asked 2006-10-28 22:33:27 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3985470

By: nobody

I have a zhtml file with the following:

<script>
goHelp() {
......
}
</script>

...
<x:toolbarbutton id="help" image="img/help.png" onClick="goHelp()" /> ...

I want to call "goHelp()" javascript function inside the "toolbarbutton". Is there a way to support it? Appreciate your helps.


--Richard

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2006-10-29 16:06:50 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3985996

By: henrichen

You have to use CSA. See Developer's Guide.

/henri

link publish delete flag offensive edit

answered 2006-10-31 22:08:30 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3990429

By: nobody

Hi Henri,

I followed the CSA to define the client event listener as follows:

<x:toolbarbutton id="help" image="img/help.png" action="click: goHelp();" />
...
<script>
function goHelp(){
alert("it's goHelp");
}
</script>

It does not get the alert message window. The page is rendered as:

<a id="_pcm1" zk_type="zul.widget.Tbtn" href="javascript:;" click="goHelp();"><img src="/aunm/img/help.png" align="middle"/></a>

The javascript function goHelp() isn't called. Could you help me to figure out anything wrong? thanks.


--richard


link publish delete flag offensive edit

answered 2006-11-01 02:55:54 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3990656

By: henrichen

<x:toolbarbutton id="help" image="img/help.png" action="onclick: goHelp();" />

click -> onclick

in action

/henri

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: 2006-10-28 22:33:27 +0800

Seen: 1,399 times

Last updated: Nov 01 '06

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