org.hippoecm.hst.component.support.forms
Class FormMap

java.lang.Object
  extended by org.hippoecm.hst.component.support.forms.FormMap

public class FormMap
extends Object

A simple Form object just holding a fieldname <--> fields HashMap


Constructor Summary
FormMap()
           
FormMap(HstRequest request, List<String> fieldNames)
           
FormMap(HstRequest request, String[] fieldNames)
           
FormMap(Map<String,FormField> paramMap)
           
 
Method Summary
 void addFormField(FormField field)
           
 void addMessage(String name, String value)
           
 FormField getField(String name)
           
 String[] getFieldNames()
           
 Map<String,FormField> getFormMap()
           
 Map<String,String> getMessage()
          For each of th fields we only fetch it's first error message (if field contains error message(s)).
 String getMessageKeyPrefix()
          Deprecated. 
 Map<String,List<String>> getMessages()
          Returns all field (error) messages.
 String getPrevious()
           
 Map<String,FormField> getValue()
           
 boolean isSealed()
           
 void setPrevious(String uuid)
           
 void setSealed(boolean sealed)
          Seal this form data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormMap

public FormMap()

FormMap

public FormMap(HstRequest request,
               List<String> fieldNames)

FormMap

public FormMap(HstRequest request,
               String[] fieldNames)

FormMap

public FormMap(Map<String,FormField> paramMap)
Method Detail

getFieldNames

public String[] getFieldNames()

addFormField

public void addFormField(FormField field)

addMessage

public void addMessage(String name,
                       String value)

setPrevious

public void setPrevious(String uuid)

getField

public FormField getField(String name)

getValue

public Map<String,FormField> getValue()

getMessage

public Map<String,String> getMessage()
For each of th fields we only fetch it's first error message (if field contains error message(s)).

Returns:
map containing (single) field (error) messages
See Also:
FormField.getMessages()

getMessages

public Map<String,List<String>> getMessages()
Returns all field (error) messages. If you only need to display one message, per form field please see getMessage()

Returns:
empty map or map of error messages

getPrevious

public String getPrevious()

getFormMap

public Map<String,FormField> getFormMap()

isSealed

public boolean isSealed()

setSealed

public void setSealed(boolean sealed)
Seal this form data. Once sealed, data will not be read anymore when user reloads the page

Parameters:
sealed - boolean, if true, we'll finalize our form

getMessageKeyPrefix

@Deprecated
public String getMessageKeyPrefix()
Deprecated. 

Override this method if you need a different prefix

Returns:
the message prefix.


Copyright © 2008-2012 Hippo. All Rights Reserved.