0

href in html component

asked 2008-04-05 16:40:17 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: varan78

How do you specify eventlisteners for links in the contents of an html component?
I am constructing my components using plain java and have code like this:

Html html=new Html();
html.setContent(content)
html.setParent(window)

Here content is a (long) string containing a lot of elements to which I want to add eventlisteners, and window is the parent component of the Html component.


delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2008-04-07 01:48:59 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: jebberwocky

Refer to javadoc
http://www.zkoss.org/javadoc/3.0.4/zul/

addEventListener method

link publish delete flag offensive edit

answered 2008-04-07 07:12:46 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: varan78

I don't see how that works unless you change the Html to a group of other components.

For example, of the string content is


"This is a test link of ZK"

and I want to link ZK to something else, i.e., have the same effect as


"This is a test link of <a href='http://www.zkoss.org'>ZK</a>"


and set html.setContent(content) where content is the string above, what kind of event should the EventListener be added for?



link publish delete flag offensive edit

answered 2008-04-11 04:11:44 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: henrichen

I am afraid that you cannot add event listener under such context. The <html> component is used to "show" native html "AS IS". Meaning ZK does not have control in its contents. ZK simply "output" them "AS IS".

However, you can use <toolbarbutton> to simulate something like that.

<label pre="true" value="This is a test link of "/><toolbarbutton label="ZK"
href="http://www.zkoss.org"/>

And you should be able to add event listener on <toolbarbutton> component.

/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: 2008-04-05 16:40:17 +0800

Seen: 487 times

Last updated: Apr 11 '08

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