Menu

#747 Component always returns the same id automatically

3.0.0
closed-fixed
nobody
5
2007-11-29
2007-11-28
Godmar Back
No

The following test shows the wrong tooltip popup for label l2.

<?xml version="1.0" encoding="UTF-8"?>

<window xmlns:html="http://www.w3.org/1999/xhtml">
<vbox>
<label id="l1" value="Label l1 - Hover here, should show Popup #1" />
<label id="l2" value="Label l2 - Hover here, should show Popup #2 - but shows #1" />
</vbox>
<zscript>
// bug in ZK 3.0.0
import org.zkoss.zul.*;
p = new Popup();
p.appendChild(new Html("Popup #1 - id=" + p.getId()));
l1.setTooltip(p.getId());
l1.getParent().appendChild(p);

p = new Popup();
p.appendChild(new Html("Popup #2 - id=" + p.getId()));
l2.setTooltip(p.getId());
l2.getParent().appendChild(p);
</zscript>
</window>

Discussion

  • Godmar Back

    Godmar Back - 2007-11-28

    Logged In: YES
    user_id=587090
    Originator: YES

    PS: this code worked in 2.4.0.

    Also, could you please provide a work-around for 3.0.0 if possible (or release a bug fix update?)?

    - Godmar

     
  • Jumper Chen

    Jumper Chen - 2007-11-29
    • status: open --> closed-fixed
     
  • Jumper Chen

    Jumper Chen - 2007-11-29

    Logged In: YES
    user_id=1684431
    Originator: NO

    Fixed since 11/29.

     
  • Jumper Chen

    Jumper Chen - 2007-11-29
    • summary: wrong tooltip shown --> Component always returns the same id automatically
     
  • Jumper Chen

    Jumper Chen - 2007-11-29

    Logged In: YES
    user_id=1684431
    Originator: NO

    Cause: Both components are rendered the same id automatically.

    /Jumper

     
  • Godmar Back

    Godmar Back - 2007-11-29

    Logged In: YES
    user_id=587090
    Originator: YES

    How did you fix it?

    I work around the bug by implementing RawId:

    import org.zkoss.zk.ui.ext.RawId;

    // work-around
    class RawIdPopup extends Popup implements RawId { }
    p = new RawIdPopup();

    Is this safe?

     

Log in to post a comment.