Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Layout/Img setWidth() with percentage doesn't work

    Hi,

    I'm using SmartGWT 1.3, and am unable to create a Layout (or Img, for that matter) whose width is set as a percentage.

    i.e. the following works:
    Code:
    Layout l = new VLayout();
    l.setWidth("30px");
    While the following doesn't:
    Code:
    Layout l = new Layout();
    l.setWidth("10%");
    The width is always 0 pixels when I use a percentage.

    Here is an EntryPoint's onModuleLoad() method reproducing the problem:
    Code:
    Layout l = new VLayout();
    l.setWidth("10%");
          
    Layout main = new HLayout();
    main.setWidth100();
    main.setHeight100();
    main.addMember(new Button("I'm on the left"));
    main.addMember(new Button("I'm on the right"));
    
    main.draw();
    I've tried to use a Img object with a transparent GIF instead of the empty Layout, but I got the same behaviour.

    Any hints on how I can get that working?
Working...
X