-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4326682
By: javacooperation
Hi,
we do have the following problem.
We have an image map and want to execute a link containing javascript as soon as the user clicks on the corresponding area of the image map (a behaviour similar to href in Button, which works fine): "javascript:document.jmol.script('select
10-100;')"
Ok, so what I did so far is that I implemented a new Component that extends org.zkoss.zul.Area and called it AreaHref. All it does is to overwrite the getOuterAttrs() method and to replace the part
final StringBuffer sb = new StringBuffer(64).append("
href=\"javascript:zkArea.onclick('").append(getUuid()).append("')\"");
by
final StringBuffer sb = new StringBuffer(64).append("
href=\"javascript:document.jmol.script('select 10-100;')\"");
Ok, that does not work...
Interestingly it works to open external links, i.e.
final StringBuffer sb = new StringBuffer(64).append("
href=\"http://www.google.de"");
opens google...
Any ideas how we could solve that or where I am wrong?
Thanks in advance
Fabian
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4327977
By: robbiecheng
Hi Fabian,
You could register an onClick event listener in the imagemap. If any area of this imagemap is clicked, an onClick event is send to the imagemap. You could declare an method to transfer this page, as follows.
<zk>
<imagemap src="/img/sun.jpg" onClick="go(event.area)">
<area id="a" tooltiptext="A" coords="60,123,220,330"/> <zscript><![CDATA[
void go(String areaid){
Executions.sendRedirect(areaid + ".zul");
}
]]>
</zscript>
</imagemap>
</zk>
You could test this at the demo site of zk.
/Robbie
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4328236
By: javacooperation
Hi,
thanks for the answer, I'll try it as soon as possible...
Best regards,
Fabian
Asked: 2007-05-23 14:36:18 +0800
Seen: 633 times
Last updated: May 24 '07