+ -
当前位置:首页 → 问答吧 → ZK fisheye onclick event 无法使用window.open

ZK fisheye onclick event 无法使用window.open

时间:2009-02-22

来源:互联网

第一次接触使用zk,发现这是有趣又方便的东西
在测试fisheye时,发现onClick 无法使用window.open
1
2
<fisheye image="/img/Centigrade-Widget-Icons/Spyglass-128x128.png" label="Spyglass"
        onClick='window.open("http://www.google.com")' /> 

不知是哪里有问题

作者: chunfutung   发布时间: 2009-02-22

才po文,自己就找到解法了 ( from zk forum)

1
2
<fisheye image="/img/Centigrade-Widget-Icons/Spyglass-128x128.png" label="Spyglass"
        onClick='Executions.getCurrent().sendRedirect("http://www.google.com");' />


不过还是想问,为什么不可以使用window.open呢??

作者: chunfutung   发布时间: 2009-02-22

你得先搞懂,onClick里面的程式码是在哪边执行的?

就是说你写的程式码是给Server端的直译器执行呢,还是Browser端的Javascript Engine执行?

先弄清楚吧

作者: zanyking   发布时间: 2009-02-23

试试看这几行
1
2
3
4
5
<button label="另开视窗去某个zul Page" > <attribute name="onClick"> Clients.evalJavaScript("window.open('xxx.zul', '_blank');"); </attribute> </button>

作者: joy6811   发布时间: 2011-01-07

热门下载

更多