0

popup not shown when created in zscript

asked 2010-09-16 05:12:20 +0800

dis gravatar image dis flag of Switzerland
140 4

Hi

Following zul code shows two simple labels. The first label is created with a label tag in the zul page. The second label is created in zscript. Both labels have a popup which should appear automatically when the mouse moves over the label.

For the first label it works perfectly. But not for the second label which is created in zscript. The popup does not appear when the mouse moves over the label. However, the popup appears with a click on the mouse.

Here the zul code:

<zk>
    <window id="theWindow" border="none">

        <label value="Label 1 with popup1" tooltip="popup1"/>
        <separator orient="horizontal" />

        <popup id="popup1">
            <label value="Hello, I am popup 1" />
        </popup>

        <zscript>
            import org.zkoss.zul;

            Label l2 = new Label("Label 2 with popup2");
            theWindow.appendChild(l2);

            Popup popup2 = new Popup();
            popup2.appendChild(new Label("Hello, I am popup2"));
            popup2.setParent(theWindow);

            l2.setPopup(popup2);

        </zscript>

    </window>
</zk>

Is there a workaround for this behaviour?

Thank you
Regards
Dieter

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2010-09-19 23:16:01 +0800

TonyQ gravatar image TonyQ
642
https://www.masterbranch....

updated 2010-09-19 23:28:31 +0800

Hello , the popup shows up when you click , and the tooltip shows up when your mouse over ,

May be you could try this ?

l2.setTooltip(popup2);

I try the both on zk user guide , it work fine. :D

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-09-16 05:12:20 +0800

Seen: 190 times

Last updated: Sep 19 '10

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