Menu

#15 setParent does not work correctly in Javascript

v1.0.0-m4
closed-fixed
5
2007-03-18
2006-11-22
No

See attached program. It behaves correctly when run
as an SWT program, but when run as Java2Script application it displays a blank shell. If you examine
the resulting HTML, of course, it is incorrect:

<div class="shell-content" style="width:105px;height:143px;">

<div class="composite-default" style="display:none;left:5px;visibility:hidden;width:64px;direction:ltr;top:5px;height:64px;">
<div class="label-default"
style="display:inline;left:0px;width:30px;direction:ltr;top:0px;height:30px;">TEST</div>
</div>

<div class="composite-default"
style="left:5px;width:64px;direction:ltr;top:74px;height:64px;">
</div></div>

(As you can see, Label's div remains the child
of the invisible Composite's div, even after setting
it to the other one).

Discussion

  • Gregory Golberg

    Gregory Golberg - 2006-11-22
     
  • Josson Smith

    Josson Smith - 2006-11-23
    • milestone: --> v1.0.0-m4
    • assigned_to: nobody --> soheil_h_y
     
  • Gregory Golberg

    Gregory Golberg - 2006-11-24

    Logged In: YES
    user_id=1038790
    Originator: YES

    I took a brief look at the source (I am very new to J2S; started work with GWT and now I see
    this was probably a better alternative). This might be complicated to change -- no IDs are given
    to DIV elements, so how to get the appropriate one from the DOM? Perhaps IDs should be given, based
    on, say, hashCode() -- but then, hashCode in the Javascript version is all the same, it's a
    hashcode of toString(). This may be a separate feature request, but I think it would be useful,
    and facilitate fixing of this bug.

     
  • Soheil Hassas Yeganeh

    Logged In: YES
    user_id=1462864
    Originator: NO

    Fixed! Please check out the head of SVN.

     
  • Soheil Hassas Yeganeh

    • status: open --> open-fixed
     
  • Zhou Renjian

    Zhou Renjian - 2007-03-18
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.