/**
* <p>
* A class representing a selection of items the user has selected in a UI. The
- * set of choices is presented as a set of {@link com.vaadin.data.Item}s
- * in a {@link com.vaadin.data.Container}.
+ * set of choices is presented as a set of {@link com.vaadin.data.Item}s in a
+ * {@link com.vaadin.data.Container}.
* </p>
*
* <p>
super.changeVariables(source, variables);
// New option entered (and it is allowed)
- final String newitem = (String) variables.get("newitem");
- if (newitem != null && newitem.length() > 0) {
- getNewItemHandler().addNewItem(newitem);
+ if (isNewItemsAllowed()) {
+ final String newitem = (String) variables.get("newitem");
+ if (newitem != null && newitem.length() > 0) {
+ getNewItemHandler().addNewItem(newitem);
+ }
}
// Selection change
* Gets the Property identified by the given itemId and propertyId from the
* Container
*
- * @see com.vaadin.data.Container#getContainerProperty(Object,
- * Object)
+ * @see com.vaadin.data.Container#getContainerProperty(Object, Object)
*/
public Property getContainerProperty(Object itemId, Object propertyId) {
return items.getContainerProperty(itemId, propertyId);
}
}
- public void valueChange(
- com.vaadin.data.Property.ValueChangeEvent event) {
+ public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
requestRepaint();
}
}
// New option entered (and it is allowed)
- final String newitem = (String) variables.get("newitem");
- if (newitem != null && newitem.length() > 0) {
- getNewItemHandler().addNewItem(newitem);
- // rebuild list
- filterstring = null;
- prevfilterstring = null;
+ if (isNewItemsAllowed()) {
+ final String newitem = (String) variables.get("newitem");
+ if (newitem != null && newitem.length() > 0) {
+ getNewItemHandler().addNewItem(newitem);
+ // rebuild list
+ filterstring = null;
+ prevfilterstring = null;
+ }
}
}