0

onClick event and Toolbarbutton

asked 2006-02-06 11:07:09 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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

By: nobody


Hi

First, the framework is amazing ! Great work ! I use it without the tags, coding directly against the api like I used to do with swing, simpel, easy and, off course, rich !

I am still learning, so maybe someone can help me with the following:

I use toolbarbuttons with only an image, no label and wrote a eventlistener for the onClick event:
it didn't work, after some code changing and puffing, I tryed to use a button, then everyting just worked fine (I mean the eventlistener), so I tryed again the toolbarbutton and used a label with it:
clicking on the label works, on the image not:

Question: is this the normal behavior of the toolbarbutton (becose it renders itself with a <a> tag (=label) with an <img> tag, or could it be a bug ?

Allready thanks and keep on doing the good work !!

Eduard
Brussels, Belgium


delete flag offensive retag edit

7 Replies

Sort by ยป oldest newest

answered 2006-02-07 01:43:33 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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

By: henrichen

Hi,

It should work both on label and image on our spec.

Can you give an example code so we can test it and understand the situation in detail. Thanks.

/henri


link publish delete flag offensive edit

answered 2006-02-07 08:10:37 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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

By: nobody


Hi, the method I use:
too make the toolbarbutton/button

public static Hbox makeToolbar(Window window){


hbox = new Hbox();
hbox.setStyle("background-color: #000000;border: none;");

button = new Toolbarbutton(); (or new Button() = works)
button.setId("button");
button.addEventListener("onClick", new Toolbarlistener(window));
button.setImage("res/folder.gif");
button.setLabel(null);
button.setStyle("background-color: #000000;border: none;");

//

hbox.appendChild(album);
//
return hbox;

}

the listener:

public class Toolbarlistener implements EventListener {

Window window;

public Toolbarlistener(Window window){
this.window = window;
}


public void onEvent(Event e) {

if (e.getTarget().getId().equalsIgnoreCase("button")){
window.thumbs.setVisible(false);
window.view.setVisible(true);

}

//

}

public boolean isAsap() {

return false;
}

}

thankx
eduard
Brussels, Belgium


link publish delete flag offensive edit

answered 2006-02-08 00:41:18 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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

By: henrichen

Hi!,

It looks like a bug in toolbarbutton. Can you file this bug into bug list so we can track it?

In the meantime, please use the <button/> or <toolbarbutton/> with label only as a workaround.

/henri

link publish delete flag offensive edit

answered 2006-02-08 07:22:39 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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

By: nobody


okAc, it's done
(hopefully the wright way, let me know if I should do it differently)

eduard
Brussels, Belgium

link publish delete flag offensive edit

answered 2006-02-08 07:40:13 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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

By: henrichen

Yes, it is in the bug list.

/henri

link publish delete flag offensive edit

answered 2006-04-12 10:02:11 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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

By: nobody

I would like to put the label of a toolbarbutton invisible and visible when the mouse pass over. Is it possible? How can I do this?


thanks,

link publish delete flag offensive edit

answered 2006-04-12 13:48:51 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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

By: henrichen

It is a mouse rollover effect that would be inefficient to pass that event back to server. A reasonable way to do it is by CSA (Client Side Action) but you have to write the javascript.

/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: 2006-02-06 11:07:09 +0800

Seen: 594 times

Last updated: Apr 12 '06

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