DEMO variant sqlcontainer size is 37 rows only 15 visible

Hi Folks,

my SQLcontainer has 37 (SQLcontainer .size()) rows of data - of those only about 15 rows are visible in the web table
Where can I see (in debug) what the contents of the container are, or what is gone bad so I can debug it please.

I have manually run a select * from tablename and get all 37 rows - so I know that there are 37 rows of valid data.

Hi,

Just run the server as debug…and set breakpoint after the sqlcontainer created,
the you can see any value/props.

Cheers,
ef

The table component has a default page size of 15 rows.
Normally you should see a scrollbar, though - if not, maybe something is wrong with your layouts or theme.

Note that the table and SQLContainer both perform lazy loading on different levels, so if the last rows are not in the scroll buffer, they might not exist in memory at all but only in the database.
Add debug code to your application that asks for the size of the container etc. to check such things.

Hi Henri -

the container size is 37 lines and the scroll bars are working.

when I click on “Show all” I get an additional two rows then an exception - syntax error missing ] … and a whole lot more. I have searched my code and my database for a “]” and I don’t have any.

I do not see a way to set table size other than setSizeFull() which is for a percentile, how would you set

Hi Folks,
if I remove the addGeneratedColumn method that adds the cityId then it displays all 37 rows in the table - so something in the data base request or this method is the cause of the issues.

this is the exception output:
(SyntaxError): missing ] after element list stack: jV@http://monitor.jagmobile.co.za:8080/html/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet/A2124BAD3EF2FE9720E50702DCB7F4F7.cache.html:1746 wV@http://monitor.jagmobile.co.za:8080/html/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet/A2124BAD3EF2FE9720E50702DCB7F4F7.cache.html:3128 pm@http://monitor.jagmobile.co.za:8080/html/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet/A2124BAD3EF2FE9720E50702DCB7F4F7.cache.html:2374 Pm@http://monitor.jagmobile.co.za:8080/html/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet/A2124BAD3EF2FE9720E50702DCB7F4F7.cache.html:3125 d.onreadystatechange<@http://monitor.jagmobile.co.za:8080/html/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet/A2124BAD3EF2FE9720E50702DCB7F4F7.cache.html:1717 Pb@http://monitor.jagmobile.co.za:8080/html/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet/A2124BAD3EF2FE9720E50702DCB7F4F7.cache.html:1357 Sb@http://monitor.jagmobile.co.za:8080/html/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet/A2124BAD3EF2FE9720E50702DCB7F4F7.cache.html:2610 @http://monitor.jagmobile.co.za:8080/html/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet/A2124BAD3EF2FE9720E50702DCB7F4F7.cache.html:1855 fileName: http://monitor.jagmobile.co.za:8080/html/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet/A2124BAD3EF2FE9720E50702DCB7F4F7.cache.html lineNumber: 1746 columnNumber: 0 - Original JSON-text:{“changes”:[[“change”,{“format”: “uidl”,“pid”: “PID9”},[“6”,{“id”: “PID9”,“eventListeners”:[“itemClick”]
,“selectmode”: “single”,“error”:[“error”,{},[“div”,{“xmlns”: “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”},"
Exception</h3>

com.vaadin.event.ListenerMethod$MethodException
Cause: java.lang.NullPointerException
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:532)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
at com.vaadin.ui.Tree.changeVariables(Tree.java:406)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1451)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1399)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1318)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:763)
at com.vaadin.terminal.gwt.server.PortletCommunicationManager.handleUidlRequest(PortletCommunicationManager.java:242)
at com.vaadin.terminal.gwt.server.AbstractApplicationPortlet.handleRequest(AbstractApplicationPortlet.java:465)
at com.vaadin.terminal.gwt.server.AbstractApplicationPortlet.serveResource(AbstractApplicationPortlet.java:747)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:118)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:531)
at com.liferay.portlet.InvokerPortletImpl.invokeResource(InvokerPortletImpl.java:626)
at com.liferay.portlet.InvokerPortletImpl.serveResource(InvokerPortletImpl.java:436)
at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:1075)
at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:719)
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:249)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:176)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:560)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:537)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:163)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:294)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFfor(;;);[{“changes”:
, “meta” : {“appError”: {“caption”:“Internal error”,“message” : “Please notify the administrator.
Take note of any unsaved data, and click here to continue.”,“url” : null}}, “resources”: {}, “locales”:}

Could you include the method that causes the problem?

this is the standard AddGeneratedColumn from the demo - the relationship is
campaign table has foreign key productid and the product table’s primary key is productid - which is an integer/unique and all that

addGeneratedColumn(“productid”, new ColumnGenerator() {
public Component generateCell(Table source, Object itemId, Object columnId) {
if (getItem(itemId).getItemProperty(“productid”).getValue() != null) {
Label l = new Label();
int productid = (Integer) getItem(itemId).getItemProperty(“productid”).getValue();
l.setValue(app.getDbHelp().getProductName(productid));
l.setSizeUndefined();
return l;
}
return null;
}
});

public String getProductName(int productid) {
Object productItemId = productContainer.getIdByIndex(productid);
return productContainer.getItem(productItemId).getItemProperty(“productname”).getValue().toString();
}