Announcement

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

    getRowHeight()

    Hi,

    I'm using a grouped ListGrid and would like the group node to be taller than the other normal rows. As suggested in other posts, I overloaded the getRowHeight() method to return the one I need...
    The problem is that my getRowHeight() does not seem to be called, here is a code sample:

    Code:
    public class BUGroupListGrid extends ListGrid {
    
    	private int groupHeight = 40;
    	
    	public BUGroupListGrid() {
    		this.initList();
    	}
    
    	public BUGroupListGrid(DataSource ds) {
    		super(ds);
    		this.initList();
    	}
    	
    	protected void initList() {
    		this.setGroupByField("BUNIT_NAME");
    		this.setFixedRecordHeights(false);
    	}
    	
    	@Override
    	public int getRowHeight(ListGridRecord record, int rowNum) {
    		if (isGroupNode(record))
    			return groupHeight;
    		else
    			return super.getRowHeight(record, rowNum);
    	}
    }
    Am I missing something ?
    Thanks,

    Thomas

    #2
    getRowHeight() is not an override point in SmartGWT - in other words, when called internally by SmartClient JavaScript code, it won't call an override applied to the Java class.
    We agree that this is not ideal and are making it an override point. This change will be present in the next nightly build on the 4.1d branch.

    Regards
    Isomorphic Software

    Comment


      #3
      could this be the reason why we are getting this exception on the current nightly build?

      regards, ITB

      com.google.gwt.dev.shell.HostedModeException: Something other than an int was returned from JSNI method '@com.smartgwt.client.widgets.grid.ListGrid::getRowHeight(Lcom/smartgwt/client/widgets/grid/ListGridRecord;I)': JS value of type null, expected int
      at com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266)
      at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
      at com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt(ModuleSpace.java:257)
      at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java:75)
      at com.smartgwt.client.widgets.grid.ListGrid.getRowHeight(ListGrid.java)
      at sun.reflect.GeneratedMethodAccessor408.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      Comment


        #4
        We're not seeing this exception in our testing, and it's not obvious what would cause it.
        Can you show us a test case? Ideally an entry point class we can actually run with no modification.

        As an aside, it looks like there may be a problem with the "isGroupNode()" API in some cases - that should be fixed in the next nightly build (Nov 27)

        Regards
        Isomorphic Software

        Comment

        Working...
        X