0

Creating hyperlink with action listener

asked 2011-02-03 13:10:16 +0800

Janio gravatar image Janio
15

Hi!

I must create a hyperlink with an action listener to show some editor component in the same window of the html (in a new componente over the html with the link), preferably using only pure Java code, but I dunno how.
ZK have the Link class, but I have not figured out how to use that.

Any help is welcome.

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2011-02-03 16:20:41 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

You can use the A-Component:

<window id="container">
<zscript>
	A button = new A("Click me");
        button.addEventListener(Events.ON_CLICK, new EventListener() {
             public void onEvent(Event event) {
 		alert("Clicked");
             }
        });
      container.appendChild(button);
</zscript>
</window>

HTH, Maik

link publish delete flag offensive edit

answered 2011-02-07 04:51:33 +0800

Janio gravatar image Janio
15

Thanks!

Have been seeking how to do something like that without using zul pages, using only java classes, but perhaps I have no choice.

link publish delete flag offensive edit

answered 2011-02-07 05:17:07 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

Hi,

the Java-code above works in Java too, you don't need ZUL pages for this. It was just added for demonstration purposes so you can try it directly in ZK-Sandbox.

Cheers, Maik

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: 2011-02-03 13:10:16 +0800

Seen: 501 times

Last updated: Feb 07 '11

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