-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I am having some problems with tooltips for listitems that don't always open. I think the open event is not always being fired. The problem can be easily seen on the live-demo page with the following zul:
<listbox width="500px"> <listhead> <listheader label="Operation" width="200px" /> </listhead> <listitem tooltip="msg"> <listcell label=" Mouse hover - tooltip " /> </listitem> <listitem tooltip="msg"> <listcell label="Click - popup" /> </listitem> </listbox> <popup id="msg" width="300px"> <vbox> This user is online now ! <toolbarbutton label="Mail him/her"/> </vbox> </popup>
Any ideas for a work-around?
Thanks,
Marie
I think its because you are using the same popup for all listitems.
-> When you move mouse over a listitem, the popup will get visible.
-> When you move mover out of a listitem (and not towards the next listitem) the popup will get hidden. (i.e. it simply toggles the state of tooltip / popup as and when the moverover and mouseout event occurs)
-> But in case you are moving mouse out of a listitem, and moving it over another listitem, due to toggling of the visibility, the popup will get displayed once, and then it will hide
It can be considered as a problem, but I think there wont be any other way of achieving the toggling of the tooltip.
One way around that I am using for the same is to use separate popup for each listitem, so your code might look like -
<listbox width="500px"> <listhead> <listheader label="Operation" width="200px" /> </listhead> <listitem tooltip="msg1"> <listcell label=" Mouse hover - tooltip " /> </listitem> <listitem tooltip="msg2"> <listcell label="Click - popup" /> </listitem> </listbox> <popup id="msg1" width="300px"> <vbox> This user is online now ! <toolbarbutton label="Mail him/her"/> </vbox> </popup> <popup id="msg2" width="300px"> <vbox> This user is online now ! <toolbarbutton label="Mail him/her"/> </vbox> </popup>
Hello Niral,
Thanks for the reply. I don't think I can do it that way, though, because I am using databinding to generate the list - I don't know how long it will be. Also, my code worked fine with ZK3.6.2
Best Regards,
Marie
@603424
thanks for your answer, I think you are right
@meh
how about change to use onclick event
<listbox width="500px"> <listhead> <listheader label="Operation" width="200px" /> </listhead> <listitem onClick="msg.open(self)"> <listcell label=" Mouse hover - tooltip " /> </listitem> <listitem onClick="msg.open(self)"> <listcell label="Click - popup" /> </listitem> </listbox> <popup id="msg" width="300px"> <vbox> This user is online now ! <toolbarbutton label="Mail him/her"/> </vbox> </popup>
Was there ever an adequate solution/workaround for this?
We are rebuilding an existing app in ZK, and the old app shows a popup div on mouseover for list items in many places.
This has become a real problem for us, since the list may have tens or hundreds of databound entries and when you mouse off one list item onto the next the tooltip disappears and does not re-appear until you move the mouse around some more.
(We load the tooltip with new content based on the dataitem each time it opens.)
Changing to an onClick is not satisfactory, since it changes the feel & behaviour of the existing app.
I am the original poster to this thread and have still not found a solution. Since we are still in the prototype stage,I have some time and am hoping that the old 3.6.2 behavior will return in an upcoming version. I consider it a bug because it was working fine before...
Any workaround would still be appreciated, but onClick is also not an option for me.
Best,
Marie
With no response from the ZK people (hmmm) we have implemented a not-so-satisfactory workaround:
We have created two tooltip windows, and when the page is created we assign the tooltips to alternate rows. This way, when you move from one row to the next with the mouse, tooltip one is hidden, and tooltip two is shown. The conflict between the tooltip closing for row 1 and not being shown for row 2 is avoided, since we are flipping between two different panels.
Shouldn't be necessary, but seems to work quite well as a work around.
If the ZK guys could give a better solution, or acknowledge current behavior as a bug, I'd very much appreciate it.
Asked: 2010-05-21 05:15:11 +0800
Seen: 844 times
Last updated: Oct 13 '10