# Creating hyperlink with action listener

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 retag edit

## 3 Replies

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

You can use the A-Component:

<window id="container">
<zscript>
A button = new A("Click me");
public void onEvent(Event event) {
}
});
container.appendChild(button);
</zscript>
</window>


HTH, Maik

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.

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

[hide preview]