-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello everyone,
I am displaying protein-sequences in a ListBox (enabled multiselection with checkmarks)..Since sequences are pretty long , i only display 25 characters and want to display the full sequence in a Popup window when user move the mouse over the ListCell.
Problem is,the popups wont appear during a mouse over.. ???
What could be the problem.
Thanks in advance,
umanga
My code in as follows :
...create cell row ..etc String val=getProteinsSequence(); Listcell acell = new Listcell(); acell.setStyle("font-size:10px"); if (val.length() > 25) { Popup popup = new Popup(); popup.setWidth("200px"); popup.setHeight("100px"); Vbox vbox = new Vbox(); Label lbl = new Label("`"+); vbox.appendChild(lbl); popup.appendChild(vbox); acell.appendChild(popup); acell.setTooltip(popup); //acell.setPopup(popup); val = val.substring(0, 20) + "..."; } acell.setLabel(val);
Sorry .. its in the Label (lbl) .. i have mistakenly deleted that seems..
its shoud be:
Label lbl = new Label("Sequence "+ val);
Anyway..this code doesnt popup even the empty Window..Basically nothing happens ????
Anyone...please?
try to assign popup's parent to an outer or inner one. don't assign it directly to a cell.
image that form this xml <acell><adiv><alabel value="val"/><popup/></advi><another_column_of_cell/></acell>
in this case, don't call acell.setLabel(val) , cause of you want to append another component in it.
hi dennis,
thank you for the tip.I set the parent of popup as <adiv> as in your form.but it didnt work.
Anyway, when i set the popup [using div.setPopup(popup); ] and once i click on the lable, the Popup opens and suddenly closes.Anyway this didnt work for setTooltip(); method !
Any tips?
regards
umanga
Hi all,
I tested same logic use ZK-Demo site as follows , it works fine....Wonder why its not working when same logic is done programatically..
My Zul likes follows and it works well??
<window title="Checkmark" border="normal"> <panel> <panelchildren> <button label="Toggle checkmark" onClick="box.checkmark = !box.checkmark"/> <button label="Toggle multiple" onClick="box.multiple = !box.multiple"/> <separator bar="true"/> <listbox id="box" width="460px" multiple="true" checkmark="true"> <listhead> <listheader label="Name"/> <listheader label="Gender"/> <listheader label="Age"/> <listheader label="Description"/> </listhead> <listitem> <listcell > <div tooltip="any"> <label value="tooltiphere"/> </div> <popup id="any" width="300px"> <vbox> ZK simply rich. <toolbarbutton label="ZK your killer Web application now!" href="http://www.zkoss.org"/> </vbox> </popup> </listcell> <listcell label="FEMALE"/> <listcell label="18"/> <listcell label="A young lady."/> </listitem> <listitem> <listcell label="John"/> <listcell label="MALE"/> <listcell label="20"/> <listcell label="A college student."/> </listitem> <listitem> <listcell label="Jane"/> <listcell label="FEMALE"/> <listcell label="32"/> <listcell label="A remarkable artist."/> </listitem> <listitem> <listcell label="Henry"/> <listcell label="MALE"/> <listcell label="29"/> <listcell label="A graduate."/> </listitem> </listbox> </panelchildren> </panel> </window>
hi guys..
seems theres no solution for this...
I want to know whether there is a 'onMouseOver' event for Div or ListCell.?
Now my solution is, to use a normal Window (instead of a Popup)to be displayed on a mouve over event.
thanks in advance,
umanga
umanga, what i mean is
<listcell > <div tooltip="any"> <label value="tooltiphere"/> <popup id="any" width="300px"> <vbox> ZK simply rich. <toolbarbutton label="ZK your killer Web application now!" href="http://www.zkoss.org"/> </vbox> </popup> </div> </listcell >
could you modify the code to above structure and try again?
hi dennis,
yes i tried that also ,but noluck..I tried almost all possible combinations ..nothing is working..
following is the code for above structure..
. . Listcell acell = new Listcell(); String val=getProtienSequence(...); Div div=new Div(); if (val.length() > 25) { //enable tooltip only if the string is too long Popup popup = new Popup(); popup.setHeight("100px"); Vbox vbox = new Vbox(); Label lbl = new Label(val); vbox.appendChild(lbl); popup.appendChild(vbox); popup.setParent(div); div.appendChild(popup); div.setTooltip(popup); val = val.substring(0, 20) + "..."; } div.appendChild(new Label(val)); acell.appendChild(div); . . litem.appendChild(acell);
Any idea?
thanks
umanga
umanga,
don't put a popup inside a component whose's tooltip assign to this popup.
and, when you try to compare some thing, you should make sure the main logic is the same.
you code doesn't equals to xml to construct the component, isn't it?
here a example works from me.
<window title="Checkmark" border="normal"> <panel> <panelchildren> <button label="Toggle checkmark" onClick="box.checkmark = !box.checkmark"/> <button label="Toggle multiple" onClick="box.multiple = !box.multiple"/> <separator bar="true"/> <listbox id="box" width="460px" multiple="true" checkmark="true"> <listhead> <listheader label="Name"/> <listheader label="Gender"/> <listheader label="Age"/> <listheader label="Description"/> </listhead> <listitem> <listcell id="cell"> <zscript> Popup popup = new Popup(); popup.setHeight("100px"); Vbox vbox = new Vbox(); Label lbl = new Label("the tips"); vbox.appendChild(lbl); popup.appendChild(vbox); Div div = new Div(); Label target = new Label("Tooltips"); target.setTooltip(popup); target.setParent(div); popup.setParent(div); div.setParent(cell); </zscript> </listcell> <listcell label="FEMALE"/> <listcell label="18"/> <listcell label="A young lady."/> </listitem> <listitem> <listcell label="John"/> <listcell label="MALE"/> <listcell label="20"/> <listcell label="A college student."/> </listitem> <listitem> <listcell label="Jane"/> <listcell label="FEMALE"/> <listcell label="32"/> <listcell label="A remarkable artist."/> </listitem> <listitem> <listcell label="Henry"/> <listcell label="MALE"/> <listcell label="29"/> <listcell label="A graduate."/> </listitem> </listbox> </panelchildren> </panel> </window>
hi dennis,
thank you for the help.But it didnt work.
I tried by setting the parent of popup to its topmost 'Window' using:
popup.setParent(getParent().getParent().getParent()..//Till it reach the 'Window' container );
But instead of lable.setTooltip(popup) , i used label.setContext(popup) ..and it works well..
Guess I have to stick with rightclick-context menu...
thank you for your help
umanga
Asked: 2008-11-11 05:16:38 +0800
Seen: 1,945 times
Last updated: Nov 06 '10