Thanks sooo much for all your efforts - this concept is going in totally the right direction for my brain.
Here is a simple answer to some recent posts by newbies (as i am one):
You loved the demo - it did not compile? No worries - going from six to seven requires a couple simple mods:
method call for theme becomes an annotation.
to make catfinder work in seven, you need to choose a different method - it is no longer the ‘tree->addToContainer’
//menuContainer.addComponent(menu); //addComponent is not a method anymore in Panel
menuContainer.getContent().setWidth(“-1px”); //cgg: this works now because object has content
oops - i just noticed the replacement for menuContainer.AddComponent(menu) was missing
I found in my code that the following worked great:
menuContainer.setContent(menu);
I am however having some challenges with themes - reindeer and runo work as advertized, however the custom theme for catfinder seems to not be active - defaults to a black title (even though I set it to blue) and seems to remove the scroll bar on the tree menu. So I am sticking with runo just to get our back-end logic implemented - we can make it look pretty afterwards.
I am noting that this post is not generating a whole lot of interest ;-0
But I am making headway. Today I discovered that we should separate our themes into named theme and ‘styles.scss’. The really important bit is to add a mixin. Then I was able to find my cat just like in the Book of Vaadin.
Moving on a bit, I decided to change the implementation of the simple planets object… and merge in the hierarchical container example (in preparation for a sqlcontainer effort later next week). It went well until i tried to put a listener on Tree object. What eventually worked well for me was the following:
tree.addItemClickListener(new ItemClickEvent.ItemClickListener() {
@Override
public void itemClick(ItemClickEvent itemClickEvent) {
if (itemClickEvent.getItem() != null) {
//location.setValue("The cat is in " + itemClickEvent.getItem().getItemProperty("name"));
location.setValue("The cat is in " + itemClickEvent.getItem().getItemProperty("name").getValue());
}
}
} );
tree.setImmediate(true);
This is very different from the original example (which did work) - maybe due to my passing it down as a reference:
(of course, bear in mind i changed the ‘menu’ below to ‘tree’ above - but same object.
menu.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
if (event.getProperty() != null && event.getProperty().getValue() != null) { location.setValue("The cat is in " + event.getProperty().getValue());
} } });
menu.setImmediate(true);
You may note that I had to change the method from ‘addLIstener’ (which compiler barked at me that it was deprecated) to addItemClickListener. And also the getProperty seems to prefer a series of methods starting with getItem
Am I doing something stupid here - or is this an indication of change for approach within version 7?
Anyways - here is my final screen - and we don’t get any nasty runtime messages about casting…