Hi!
I’ve got mainview and CountrySelector (JPAContainerCustomField) is part of it.
In MainView-java:
HorizontalLayout searchPanel = new HorizontalLayout();
searchPanel.setWidth("100%");
searchPanel.addComponent(new CountrySelector());
In CountrySelector I’ve got three dropBoxes and one button to search companies (Country-cities-companies):
public class CountrySelector extends JPAContainerCustomField implements ClickListener {
private JPAContainer cities;
private JPAContainer products;
private JPAContainer companies;
private JPAContainer countries;
private ComboBox countrySelect;
private ComboBox productSelect;
private ComboBox citySelect;
private Button searchButton;
…
countrySelect.addListener(new ValueChangeListener() {
public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
// Get the entity object of the selected row
Object itemId = event.getProperty().getValue();
EntityItem<Country> item = countries.getItem(itemId);
Country country = item.getEntity();
setValue(country, false);
getWindow().showNotification("Selected country: " + country.getCountry());
.......
and the Question is:
How can I get information of events to the mainview or everything what user has chosen in that searchPanel? Mainview should be reloaded after user selection in searchPanel.
Thanks a lot!
Sami