ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

how to enable generated anchor links inside Html components to function as native links

hightu
7 Jan 2012 21:13:54 GMT
7 Jan 2012 21:13:54 GMT

I have several ZK Html components whose contents (all native HTML stuff)
are generated dynamically and some include native <a href="http..."> links.
However when they are clicked the events are caught by the Update Engine and
probably are sent to the server.

Is there anyway to signal ZK that it should pass those events to the browser
so they will behave like regular links?

Thanks.

hightu
7 Jan 2012 21:18:34 GMT
7 Jan 2012 21:18:34 GMT

Here is a simple example, in my ZUL file I have:

<html><![CDATA[
<a href="http://www.yahoo.com">yahoo</a>
]]></html>

Clicking at the link does nothing.

hightu
9 Jan 2012 20:37:07 GMT
9 Jan 2012 20:37:07 GMT

After I removed the method onClick() from my controller the links worked properly -- the ZK Client engine now sends
the event to the browser.

TonyQ
10 Jan 2012 09:26:22 GMT
10 Jan 2012 09:26:22 GMT

The given sample will redirect the page to yahoo.com when link is clicked.


index.zul
<html><![CDATA[
<a href="http://www.yahoo.com">yahoo</a>
]]></html>

Could you please provide a reproducible example ?


I can't image a click event in native html code will be caught by ZK , if it really did , that might be a bug.

We need a example to get what you are talking about.

hightu
11 Jan 2012 19:48:09 GMT
11 Jan 2012 19:48:09 GMT

As I have mentioned in my 12/30 post that the problem was gone once I removed onClick method from my Controller.
My guess is that if one declares onClick() in the controller ZK Client Engine will grab the event.

Thanks.

TonyQ
20 Jan 2012 08:04:11 GMT
20 Jan 2012 08:04:11 GMT

How do you define your onClick event?

RichardL
20 Jan 2012 10:01:35 GMT
20 Jan 2012 10:01:35 GMT

I think hightu means he had mistakenly put an onClick event listener on the Html component in his composer and then when he removed it the anchor links were working as expected.