row heights not available after row expansion

Hello,

I am using smartgwt 2.4 and firefox 3.6.

The application draws a grid of records which rows can be expanded to show another grid of entries that have been matched to the clicked record.

both table are using the same DataSource.

productsTable = new ListGrid() {
            @Override
            protected Canvas getExpansionComponent(final ListGridRecord record) {

            	VLayout layout = new VLayout(5);  
                layout.setPadding(2);
                
            	final ListGrid matchedProductsGrid = new ListGrid();
            	matchedProductsGrid.setWidth(500);
            	matchedProductsGrid.setHeight(224);
            	matchedProductsGrid.setCellHeight(22);
            	matchedProductsGrid.setDataFetchMode(FetchMode.BASIC);
            	matchedProductsGrid.setFields(makeGridFields());
            	matchedProductsGrid.setDataSource(pds);
            	matchedProductsGrid.fetchRelatedData(record, pds);
                
            	layout.addMember(matchedProductsGrid);
            	
                return layout;
            }
        };
productsTable.setAutoFetchData(true);
productsTable.setCanExpandRecords(true);
productsTable.setDataSource(pds);  
productsTable.setDataPageSize(20);
productsTable.setFields(makeGridFields());
productsTable.setDataFetchMode(FetchMode.PAGED);

After expanding one row and scrolling down in the productsTable (outer grid), which means that the productsTable fetches new Data from the Server, the following error is thrown and the newly fetched records are not loaded into the grid (but the data has already arrived the client).

21:27:22.266 [ERROR] [productloader] 21:27:22.056:TMR1:WARN:GridBody:isc_ProductList_2_0_body:row heights not yet available; returning all zeroes
com.smartgwt.client.core.JsObject$SGWT_WARN: 21:27:22.056:TMR1:WARN:GridBody:isc_ProductList_2_0_body:row heights not yet available; returning all zeroes
    at sun.reflect.GeneratedConstructorAccessor23.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Thread.java:636)

After reloading the page, everything is fine again.
What is the source of the error and how can I resolve it?

This code is basically similar to the sample and doesn’t cause this error. Can you try to isolate the actual cause? As a hint, this would tend to happen if you tried to call APIs that need to access the heights of drawn rows when the grid is not yet drawn yet - you may be doing so in a constructor.

i am able to isolate this problem by removing the overridden method getExpansionComponent(..). Because the error is gone afterwards.

As far as I understand, the overriden method is called for each row when smartgwt is building the ListGrid or after scrolling down. But I do not see, why it needs the row height before it is drawn.

In contrast to the sample from the showcase, new data needs to be loaded from the server after scrolling down in my case (I noticed that the DrawAheadRatio is set to 4 and thus I assume that the showcase records are only loaded once and not again after scrolling to the end .. ?).

Is it possible that the initial load of the ListGrid happens without errors, but subsequent adding of rows will cause the problem because the getExpansionComponent(..) method does not wait until the rows are drawn?

btw, there is no error, if no row was expanded.

Sorry, no, none of those explanations make sense, and the problem is still most likely what was described previously - grid APIs that require row heights being called on an undrawn grid or at another invalid time. The problem is basically somewhere in code you haven’t shown, so the next thing to do is isolate the problem on your end.