org.riotfamily.forms.element
Class NestedForm

java.lang.Object
  extended by org.riotfamily.forms.AbstractElement
      extended by org.riotfamily.forms.AbstractEditorBase
          extended by org.riotfamily.forms.CompositeElement
              extended by org.riotfamily.forms.element.TemplateElement
                  extended by org.riotfamily.forms.element.NestedForm
All Implemented Interfaces:
BackingObjectAware, BeanEditor, ContainerElement, Editor, Element, NestedEditor, BeanFactoryAware
Direct Known Subclasses:
ContentMapEditor

public class NestedForm
extends TemplateElement
implements ContainerElement, Editor, BeanEditor

Element to edit nested beans.


Field Summary
 
Fields inherited from class org.riotfamily.forms.AbstractElement
log
 
Constructor Summary
NestedForm()
           
 
Method Summary
 void addElement(Editor element, String property)
           
 void addElement(Element element)
           
protected  void afterBindingSet()
          Invoked by AbstractEditorBase.setEditorBinding(org.riotfamily.forms.EditorBinding) when the nested form is bound to a property.
protected  void afterFormContextSet()
           
 void bind(Editor editor, String property)
           
 Class<?> getBeanClass()
           
 Editor getEditor(String property)
           
 List<Element> getElements()
           
 String getLabel()
          Returns the label.
 String getProperty()
           
 Object getValue()
          Invokes the EditorBinder to populate the backingObject and returns the populated instance.
 boolean isPresent()
           
 void processRequest(FormRequest request)
          Calls processRequestInternal() and afterwards processRequestComponents() to process the components.
 void removeElement(Element element)
           
 void setBackingObject(Object value)
           
 void setBeanClass(Class<?> beanClass)
           
 void setEditorBinder(EditorBinder editorBinder)
           
 void setIndent(boolean indent)
           
 void setValue(Object value)
          Sets the given value as backingObject on the internal EditorBinder and initializes the bound editors.
protected  void toggle()
           
 
Methods inherited from class org.riotfamily.forms.element.TemplateElement
addComponent, getAttribute, getRenderModel, getTemplate, renderInternal, renderTemplate, setAttribute, setTemplate
 
Methods inherited from class org.riotfamily.forms.CompositeElement
addComponent, afterFormSet, focus, getComponents, initComponent, initCompositeElement, isCompositeElement, isEmpty, processRequestCompontents, processRequestInternal, removeComponent, setBeanFactory
 
Methods inherited from class org.riotfamily.forms.AbstractEditorBase
addChangeListener, fireChangeEvent, getEditorBinding, getFieldName, getHint, getParamName, hasListeners, setEditorBinding, setFieldName, setParamName
 
Methods inherited from class org.riotfamily.forms.AbstractElement
getEventTriggerId, getForm, getFormContext, getFormListener, getId, getParent, getStyleClass, getSystemStyleClass, getWrapperStyleClass, isEnabled, isRequired, isVisible, render, render, setEnabled, setForm, setFormContext, setHint, setId, setInline, setLabel, setParent, setReadOnly, setRequired, setStyleClass, setVisible, setWrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.riotfamily.forms.Element
focus, getEventTriggerId, getForm, getFormContext, getId, getParent, getStyleClass, isCompositeElement, isEnabled, isRequired, isVisible, render, setEnabled, setForm, setFormContext, setId, setParent, setRequired
 
Methods inherited from interface org.riotfamily.forms.Editor
addChangeListener, getEditorBinding, getFieldName, setEditorBinding, setFieldName
 
Methods inherited from interface org.riotfamily.forms.Element
focus, getEventTriggerId, getForm, getFormContext, getId, getParent, getStyleClass, isCompositeElement, isEnabled, isRequired, isVisible, render, setEnabled, setForm, setFormContext, setId, setParent, setRequired
 

Constructor Detail

NestedForm

public NestedForm()
Method Detail

setIndent

public void setIndent(boolean indent)

setEditorBinder

public void setEditorBinder(EditorBinder editorBinder)

setBackingObject

public void setBackingObject(Object value)
Specified by:
setBackingObject in interface BackingObjectAware

setBeanClass

public void setBeanClass(Class<?> beanClass)
Specified by:
setBeanClass in interface BeanEditor

getBeanClass

public Class<?> getBeanClass()

afterBindingSet

protected void afterBindingSet()
Invoked by AbstractEditorBase.setEditorBinding(org.riotfamily.forms.EditorBinding) when the nested form is bound to a property.

Overrides:
afterBindingSet in class AbstractEditorBase

getEditor

public Editor getEditor(String property)
Specified by:
getEditor in interface NestedEditor

afterFormContextSet

protected void afterFormContextSet()
Overrides:
afterFormContextSet in class TemplateElement

getLabel

public String getLabel()
Description copied from interface: Editor
Returns the label.

Specified by:
getLabel in interface Editor
Overrides:
getLabel in class AbstractEditorBase

isPresent

public boolean isPresent()

toggle

protected void toggle()

processRequest

public void processRequest(FormRequest request)
Description copied from class: CompositeElement
Calls processRequestInternal() and afterwards processRequestComponents() to process the components.

Specified by:
processRequest in interface Element
Overrides:
processRequest in class CompositeElement

setValue

public void setValue(Object value)
Sets the given value as backingObject on the internal EditorBinder and initializes the bound editors.

Specified by:
setValue in interface Editor
See Also:
Editor.setValue(java.lang.Object)

getValue

public Object getValue()
Invokes the EditorBinder to populate the backingObject and returns the populated instance.

Specified by:
getValue in interface Editor
See Also:
Editor.getValue()

bind

public void bind(Editor editor,
                 String property)
Specified by:
bind in interface BeanEditor

addElement

public void addElement(Element element)
Specified by:
addElement in interface ContainerElement

addElement

public void addElement(Editor element,
                       String property)

removeElement

public void removeElement(Element element)
Specified by:
removeElement in interface ContainerElement

getElements

public List<Element> getElements()
Specified by:
getElements in interface ContainerElement

getProperty

public String getProperty()