Announcement

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

    IE does not show Icon in Listgrid (bug?)

    I have the following code in a listgrid, to show a twitter button in a listgrid column. This works in FF, Safari and Chrome

    Build: Smart GWT Power / Nightly build 13-12-2010

    But on IE8, I don't see the image.

    My code:

    Code:
    //instance variable
    final ListGrid grid = new ListGrid() {
           
            /** not relevant for the bug, since it acts on different column, but pasted here for completion */
            @Override
    	protected String getCellCSSText(ListGridRecord record, int rowNum,
    				int colNum) {
    		final String fieldName = this.getFieldName(colNum);
    		if (fieldName.equals("Colour")) {
    			String code = record.getAttribute("Colour");
    			return "background-color: " + code + "; color: " + code + ;";
    		}
    			return "";
    	}
    
    };
    
    protected void init() {
        ...
    	grid.setWidth100();
    	grid.setHeight100();
    	grid.setAlternateRecordStyles(true);
    	grid.setCellHeight(22);
    	grid.setDataSource(dataSource);
    	grid.setAutoFetchData(false);
    	grid.setCanEdit(true);
    	grid.setModalEditing(true);
    	grid.setShowFilterEditor(true);
    	grid.setDoubleClickDelay(100);
    	grid.setEditEvent(ListGridEditEvent.DOUBLECLICK);
    	grid.setListEndEditAction(RowEndEditAction.NEXT);
    	grid.setCanRemoveRecords(true);
    	grid.setAutoSaveEdits(true);
    	grid.setShowRecordComponents(true);
    	grid.setShowRecordComponentsByCell(true);
    	grid.setRecordComponentHeight(22);
       
            ...
    
            TwitterField.setShowHover(false);
    	TwitterField.setCanEdit(false); //twitter fields cannot be edited.
    	TwitterField.setWidth(22);
    	TwitterField.setCanDragResize(false);
    	TwitterField.setIcon("twitter-icon.png");
           
    	grid.addCellClickHandler(new CellClickHandler() {
    		public void onCellClick(CellClickEvent event) {
    			final ListGridRecord record = event.getRecord();
    			final String fieldName = grid.getFieldName(event.getColNum());
    
    			if ("Twitter".equals(fieldName)) {
    				FlavourTwitterTweetWindow w = new FlavourTwitterTweetWindow(
    						record, fieldName);
    				w.show();
    				w.bringToFront();
    			}
    		}
    	});
    }
    the connected datasource field looks like this:
    Code:
        
    <field name="Twitter" title="Twitter" type="icon" required="false" />
    Last edited by Sytematic; 3 Jan 2011, 04:36.

    #2
    You can see icon fields working normally in IE8 in the showcase. Start by seeing if IE is requesting the image from the same path as the others (use Fiddler). You may be seeing the effect of caching with the other browsers.

    Comment


      #3
      Aha, after I cleared the cache and temp files on IE8, it actually worked.

      Great!

      Comment

      Working...
      X