This is even weirder, something changed in vaadin 6.34, i copied over ExampleUtil and used getHardware(), but instead of the names, i get the numbers of the ids:
EDIT: in the sampler on jetty it works, just not on tomcat 6.2
getFilterHierarchicalContainer.addContainerProperty("FILTER_NAME", String.class, null);
item.getItemProperty(FILTER_NAME).setValue(filterImpactTypes[ i ]
);
In the first one you are using the string “FILTER_NAME” and in the second you are using the same named field. The first one shouldn’t have quotes.
You are seeing numbers in the tree because you haven’t specified which property should be used as the caption and hence the item id is used as the caption. You need to call
setItemCaptionPropertyId() for the tree.
Tree tree = new Tree("a;oigha;ogh");
tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
tree.setContainerDataSource(ExampleUtil.getHardwareContainer());
tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
getMainWindow().getContent().addComponent(tree);
for the test with ExampleUtil.getHardwareContainer()
and i got this internal error now:
java.lang.NullPointerException: Container item or property ids can not be null
at com.vaadin.data.util.IndexedContainer$IndexedContainerProperty.<init>(IndexedContainer.java:1230)
at com.vaadin.data.util.IndexedContainer$IndexedContainerProperty.<init>(IndexedContainer.java:1203)
at com.vaadin.data.util.IndexedContainer.getContainerProperty(IndexedContainer.java:214)
at com.vaadin.ui.AbstractSelect.getContainerProperty(AbstractSelect.java:731)
at com.vaadin.ui.AbstractSelect.getItemCaption(AbstractSelect.java:1066)
at com.vaadin.ui.Tree.paintContent(Tree.java:532)
at com.vaadin.ui.AbstractComponent.paint(AbstractComponent.java:746)
at com.vaadin.ui.AbstractOrderedLayout.paintContent(AbstractOrderedLayout.java:146)
at com.vaadin.ui.AbstractComponent.paint(AbstractComponent.java:746)
at com.vaadin.ui.Panel.paintContent(Panel.java:250)
at com.vaadin.ui.Window.paintContent(Window.java:564)
at com.vaadin.ui.AbstractComponent.paint(AbstractComponent.java:746)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.paintAfterVariableChanges(AbstractCommunicationManager.java:804)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:618)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:265)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:482)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
This is so counterintuitive it makes me want to shoot myself for using it. It needs an interface… i have to start all the way down from the TreeSingleSelectExample, and work what i want from there. There’s danger jumping from all over the place