Package org.opencms.gwt.client.property
Class CmsPropertySubmitHandler
java.lang.Object
org.opencms.gwt.client.property.CmsPropertySubmitHandler
- All Implemented Interfaces:
I_CmsFormSubmitHandler
This class handles form submits from property forms and passes the form data to a property editor handler.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetAndRemoveValue(Map<String, String> map, String key) Helper method which retrieves a value for a given key from a map and then deletes the entry for the key.protected List<org.opencms.gwt.shared.property.CmsPropertyModification> getPropertyChanges(Map<String, String> fieldValues) Converts a map of field values to a list of property changes.voidThe method which should be called when aCmsFormis submitted.protected StringremoveTabSuffix(String fieldId) Removes the tab suffix from a field id.removeTabSuffixes(Collection<String> fieldIds) Removes the tab suffixes from each field id of a collection.removeTabSuffixes(Map<String, String> fieldValues) Removes the tab suffixes from the keys of a map.
-
Constructor Details
-
CmsPropertySubmitHandler
Creates a new instance.- Parameters:
handler- the property editor handler
-
-
Method Details
-
onSubmitForm
Description copied from interface:I_CmsFormSubmitHandlerThe method which should be called when aCmsFormis submitted.The map passed as a parameter will contain key-value pairs where the key is the name of the field and the value is the value obtained from the field. It is explicitly allowed that the value is null; this means that the property is set to 'default'.
- Specified by:
onSubmitFormin interfaceI_CmsFormSubmitHandler- Parameters:
form- the formfieldValues- a map of field valueseditedFields- the fields which have been edited- See Also:
-
getAndRemoveValue
Helper method which retrieves a value for a given key from a map and then deletes the entry for the key.- Parameters:
map- the map from which to retrieve the valuekey- the key- Returns:
- the removed value
-
getPropertyChanges
protected List<org.opencms.gwt.shared.property.CmsPropertyModification> getPropertyChanges(Map<String, String> fieldValues) Converts a map of field values to a list of property changes.- Parameters:
fieldValues- the field values- Returns:
- the property changes
-
removeTabSuffix
Removes the tab suffix from a field id.- Parameters:
fieldId- a field id- Returns:
- the field id without the suffix
-
removeTabSuffixes
Removes the tab suffixes from each field id of a collection.- Parameters:
fieldIds- the field ids from which to remove the tab suffix- Returns:
- a new collection of field ids without tab suffixes
-
removeTabSuffixes
Removes the tab suffixes from the keys of a map.- Parameters:
fieldValues- a map of field values- Returns:
- a new map of field values, with tab suffixes removed from the keys
-