0

tooltip problem with listitem

asked 2010-05-21 05:15:11 +0800

meh gravatar image meh
57 1

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

delete flag offensive retag edit

9 Replies

Sort by ยป oldest newest

answered 2010-05-21 08:42:24 +0800

603424 gravatar image 603424
127 3

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>


Thanks & Regards,
Niral Soni

link publish delete flag offensive edit

answered 2010-05-21 17:42:40 +0800

meh gravatar image meh
57 1

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

link publish delete flag offensive edit

answered 2010-05-23 09:47:20 +0800

samchuang gravatar image samchuang
4084 4

@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>

link publish delete flag offensive edit

answered 2010-05-24 01:05:57 +0800

603424 gravatar image 603424
127 3

Hi,
I think, using onClick="msg.open(self)" is equivalent to using popup="msg"

Thanks & Regards,
Niral Soni

link publish delete flag offensive edit

answered 2010-10-06 12:32:27 +0800

red3 gravatar image red3
84 2

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.

link publish delete flag offensive edit

answered 2010-10-10 14:34:13 +0800

meh gravatar image meh
57 1

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

link publish delete flag offensive edit

answered 2010-10-12 18:19:41 +0800

red3 gravatar image red3
84 2

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.

link publish delete flag offensive edit

answered 2010-10-12 21:41:26 +0800

samchuang gravatar image samchuang
4084 4

Hi

after trace code, it's a bug, and I post here, please wait for next freshly release

link publish delete flag offensive edit

answered 2010-10-13 10:04:03 +0800

red3 gravatar image red3
84 2

Excellent - thank you!

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: 2010-05-21 05:15:11 +0800

Seen: 844 times

Last updated: Oct 13 '10

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