Call javascript function in ZK ?

asked 2013-11-06 15:37:06 +0800

sitansu gravatar image sitansu
2254 13

In ZK framework, inside zul file i want to call javascript function but it does not happens.

<a label="Click" onClick="popUp();">

I have that popUp() function also. But when I click on

<script type="text/javascript">
    function createPopUp(url)
        var w = 600;
        var h = 500;
        var left = (screen.width/2)-(w/2);
        var top = (screen.height/2)-(h/2);
        window.open(url,'name','scrollbars=yes,width='+w+', height='+h+', top='+top+', left='+left);

But when I click on that link it dispalys following error:

Sourced file: inline evaluation of: `` popUp();'' : 
Command not found: popUp() : at Line: 13 : 
in file: inline evaluation of: `` popUp();'' : popUp ( )
delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-11-07 04:41:19 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8

You can call like this

<a label="Click" xmlns:w="http://www.zkoss.org/2005/zk/client" w:onClick="createPopUp('http://www.someUrl.com');"/>
link publish delete flag offensive edit
Your answer
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

1 follower



Asked: 2013-11-06 15:37:06 +0800

Seen: 68 times

Last updated: Nov 07 '13

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