0

how to make a label look like a link?

asked 2007-02-05 16:38:57 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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

By: manuel_moreno

I'm trying that when the mouse is over the label, the mouse looks like a link (the browser shows a hand for the mouse pointer) It must look like a link but it doesn't redirect to any url, it just generates an event.

This is my current code:

<?xml version="1.0" encoding="UTF-8"?>
<?page language="xul/html" ?>
<x:window
xmlns="http://www.w3.org/1999/xhtml"
xmlns:x="http://www.zkoss.org/2005/zul"
xmlns:zk="http://www.zkoss.org/2005/zk"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul
http://www.zkoss.org/2005/zul/zul.xsd">

<x:vbox>
<x:div height="1000px"/>

<a href="#"><x:label value="click me!" onClick="doSomething(event)"/></a>

</x:vbox>

<x:zscript>
public void doSomething(event) {
// do something here
}
</x:zscript>
</x:window>

But the problem with this code, is that when I click on the label, the scroll goes to the top of the page!!

Is there another way to get the same results, but with no scroll? (maybe not with a label...)

Thanks,
Manuel.

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2007-02-06 00:57:14 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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

By: moab_dabomb

Try setting the style to something like this:

color: #0000ff; text-decoration: underline; cursor: pointer;

And in your doSomething(event) block you would change the page or whatnot....

link publish delete flag offensive edit

answered 2007-02-06 12:36:00 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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

By: manuel_moreno

Thanks for the help. It works!!
Manuel.


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: 2007-02-05 16:38:57 +0800

Seen: 1,066 times

Last updated: Feb 06 '07

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