Announcement

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

    Possible bug with ListGridField.setShouldPrint

    I've noticed that calling setShouldPrint(false) into a field changes alignment of another.

    Using SmartGWT 2.4, you can check that by creating a listgrid with the following fields

    Code:
    ListGridField camposGrid[] = new ListGridField[4];
    
    ListGridField campoNumero = new ListGridField("num", "Número", 70);
    campoNumero.setAlign(Alignment.RIGHT);
    		
    ListGridField campoDocn = new ListGridField("docn", "DOCN", 100);
    campoDocn.setHidden(true);
    		
    ListGridField campoItemToc = new ListGridField("itemToc", "Documento");
    //campoItemToc.setAlign(Alignment.LEFT); 
    //campoItemToc.setCellAlign(Alignment.LEFT);
    		
    ListGridField campoSelecionado = new ListGridField("selecionado", " ");
    campoSelecionado.setCanEdit(true);
    campoSelecionado.setCanToggle(true);
    campoSelecionado.setType(ListGridFieldType.BOOLEAN);
    campoSelecionado.setWidth("50");
    If I try to print this grid, with Canvas.showPrintPreview, I get field "campoItemToc" aligned to left. But if I call
    Code:
    campoSelecionado.setShouldPrint(false);
    after the code above, and try to print the grid again, the field "campoItemToc" appears right aligned in the print preview.

    I checked with firebug and in fact, after a call to setShouldPrint(false) in campoSelecionado, the ''align'' attribute of each cell corresponding to "campoItemToc" field is changed from
    Code:
    <td class="cell" align="left" style="overflow: hidden; height: 22px;">PL. 106 1999 PROPOSIÇÃO </td>
    to
    Code:
    <td class="cell" align="right" style="overflow: hidden; height: 22px;">PL. 106 1999 PROPOSIÇÃO </td>
    Is it really a bug or is there any way I can solve that? I tried to call setAlign and setCellAlign to keep "campoItemToc" aligned to left, without success.

    The following attachments show the canvas preview windows when all three fields are printable (align_left1.png) and after I call campoSelecionado.setShouldPrint(false) (align_right1.png)

    Thanks,
    Matheus
    Attached Files

    #2
    This was indeed a bug. We've now fixed it in our mainline code base - please give it a try with the next nightly build and let us know if you still see it

    Thanks
    Isomorphic Software

    Comment


      #3
      Thanks for the quick response!

      But I tried the jars in
      http://www.smartclient.com/builds/SmartGWT/2.x/LGPL/2011-01-17/smartgwt-2.5.zip
      and
      http://www.smartclient.com/builds/SmartGWT/2.x/LGPL/2011-01-18/smartgwt-2.5.zip

      and had no differences (IE 8/ FF 3.6). Is it the right place to get the builds?

      Matheus

      Comment

      Working...
      X