1. #1
    Ext User andrey's Avatar
    Join Date
    May 2008
    Location
    Boston
    Posts
    34
    Vote Rating
    0
    andrey is on a distinguished road

      0  

    Default [CLOSED] [beta2] ViewerCell.getItem() returns null

    [CLOSED] [beta2] ViewerCell.getItem() returns null


    Hi,

    I would expect that ViewerCell.getItem(), as called from within CellLabelProvider.update(ViewerCell), would return the current TableItem, but it returns null instead:

    Code:
            CellLabelProvider labelProvider = new CellLabelProvider() {
                public void update(ViewerCell cell) {
                     TableItem item = (TableItem)cell.getItem(); // Returns null - why?
                }
            }
            tableViewer.getViewerColumn(0).setLabelProvider(labelProvider);
    Looking at the beta2 TableViewer.java, there is this code:
    Code:
      protected void renderItem(Object element, int index) {
        int cols = table.getColumnCount();
        String[] values = new String[cols];
        String[] toolTips = new String[cols];
    
        for (int j = 0; j < cols; j++) {
          CellLabelProvider lp = getCellLabelProvider(j);
          viewerCell.reset(element, null, j, table.getColumn(j).getId());
          lp.update(viewerCell);
          values[j] = viewerCell.getText();
          toolTips[j] = viewerCell.getToolTipText();
        }
        TableItem item = new TableItem(values);
    
        item.setData(element);
        item.setCellToolTips(toolTips);
    
        table.insert(item, index);
        update(element);
      }
    Notice that the viewerCell.reset() call is passing null as the item and then the TableItem is created later but never updated in the ViewerCell - is this right?

    BTW, if ViewerCell.getItem() did return the current TableItem, then this would be a way to set the widget for a column (until ViewerCell.setWidget() is supported as it was in MyGWT 5.2).

    Thanks,
    Andre

  2. #2
    Ext User andrey's Avatar
    Join Date
    May 2008
    Location
    Boston
    Posts
    34
    Vote Rating
    0
    andrey is on a distinguished road

      0  

    Default deprecated...

    deprecated...


    I saw on another thread that the viewer-related code is being removed because of license issues. So feel free to close this. However, hopefully setting widgets in tables will be possible somehow in beta3.

    - Andre

  3. #3
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    Yes, the viewer code is now removed. You can add widgets to Tables by passing them into the TableItem constructor or calling setWidget on TableItem. This is the same as in beta2. The ticket is being closed.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi