org.apache.myfaces.custom.dynaForm.component.dynaForm
Class DynaFormRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by org.apache.myfaces.custom.dynaForm.component.dynaForm.DynaFormRenderer

public class DynaFormRenderer
extends javax.faces.render.Renderer

the dynaForm renderer
regardles what the component told you, this is where the work happens ;-)


Nested Class Summary
protected static class DynaFormRenderer.AddComponentSimple
           
 
Field Summary
static java.lang.String CONTEXT_GUI_BUILDER
           
 
Constructor Summary
DynaFormRenderer()
           
 
Method Summary
protected  void addComponents(javax.faces.context.FacesContext context, DynaForm dynaForm, javax.faces.component.UIComponent layoutComponent, ViewType viewType)
          create and add the components to the layout component
protected  void collectInputComponents(java.util.List<javax.faces.component.UIInput> components, javax.faces.component.UIComponent baseComponent)
          collect all input components recursiv starting with component
protected  JsfGuiBuilder createGuiBuilder(javax.faces.context.FacesContext facesContext)
           
 void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          on create view or in development mode this will build the component tree
 void encodeChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
protected  javax.faces.component.UIComponent findComponentEx(javax.faces.component.UIComponent base, java.lang.String id)
          find a component "by id" by simply traversing the tree
protected  javax.faces.component.UIComponent findLayoutComponent(DynaForm dynaForm)
           
 boolean getRendersChildren()
           
protected  java.lang.String getValueBindingPrefix(DynaForm dynaForm, javax.faces.component.UIComponent layoutComponent)
           
protected  ViewType getViewType(javax.faces.component.UIComponent startComponent)
          determine the current view type "list" means: the layout component "is a" or "is embedded in an" list component (UIData) "form" means: anything else
protected  boolean processPreviouslyAdded(javax.faces.context.FacesContext context, javax.faces.component.UIComponent root)
          check if we already added components to the layout component.
if this is the case then: keep them cached and avoid readd in development mode: remove the components in production mode: keep them cached TODO: need to figure out whats the best way to recreate the components
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, decode, encodeEnd, getConvertedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTEXT_GUI_BUILDER

public static final java.lang.String CONTEXT_GUI_BUILDER
See Also:
Constant Field Values
Constructor Detail

DynaFormRenderer

public DynaFormRenderer()
Method Detail

getRendersChildren

public boolean getRendersChildren()
Overrides:
getRendersChildren in class javax.faces.render.Renderer

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context,
                        javax.faces.component.UIComponent component)
                 throws java.io.IOException
on create view or in development mode this will build the component tree

Overrides:
encodeBegin in class javax.faces.render.Renderer
Throws:
java.io.IOException

getViewType

protected ViewType getViewType(javax.faces.component.UIComponent startComponent)
determine the current view type


findLayoutComponent

protected javax.faces.component.UIComponent findLayoutComponent(DynaForm dynaForm)

findComponentEx

protected javax.faces.component.UIComponent findComponentEx(javax.faces.component.UIComponent base,
                                                            java.lang.String id)
find a component "by id" by simply traversing the tree


collectInputComponents

protected void collectInputComponents(java.util.List<javax.faces.component.UIInput> components,
                                      javax.faces.component.UIComponent baseComponent)
collect all input components recursiv starting with component


addComponents

protected void addComponents(javax.faces.context.FacesContext context,
                             DynaForm dynaForm,
                             javax.faces.component.UIComponent layoutComponent,
                             ViewType viewType)
create and add the components to the layout component


getValueBindingPrefix

protected java.lang.String getValueBindingPrefix(DynaForm dynaForm,
                                                 javax.faces.component.UIComponent layoutComponent)

createGuiBuilder

protected JsfGuiBuilder createGuiBuilder(javax.faces.context.FacesContext facesContext)

processPreviouslyAdded

protected boolean processPreviouslyAdded(javax.faces.context.FacesContext context,
                                         javax.faces.component.UIComponent root)
check if we already added components to the layout component.
if this is the case then: TODO: need to figure out whats the best way to recreate the components

Returns:
true if we have to add our components again

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context,
                           javax.faces.component.UIComponent component)
                    throws java.io.IOException
Overrides:
encodeChildren in class javax.faces.render.Renderer
Throws:
java.io.IOException


Copyright © 2011. All Rights Reserved.