org.barracudamvc.core.comp.renderer.html
Class HTMLActionRenderer

java.lang.Object
  extended by org.barracudamvc.core.comp.renderer.DOMComponentRenderer
      extended by org.barracudamvc.core.comp.renderer.html.HTMLComponentRenderer
          extended by org.barracudamvc.core.comp.renderer.html.HTMLActionRenderer
All Implemented Interfaces:
Renderer
Direct Known Subclasses:
HTMLLinkRenderer

public class HTMLActionRenderer
extends HTMLComponentRenderer

This class handles the default rendering of actions into an HTML view. Note that its possible for a <form> element to come in null even if the element lives in a form. Cases where this might happen: when you are returning a DOM fragment from another template, or when you are using a block iterator. In both of these cases, the component may be bound to a block of DOM that has not actually been added in as a child to the master template yet. In these cases, the form the element belongs to will be null. A warning should show up in the logs in these cases if log4j is appropriately configured.


Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
HTMLActionRenderer()
           
 
Method Summary
protected static void manipulateActionElement(Element el, BAction comp, ViewContext vc)
          Generic Element - cast elements to more specific elements in order to call the appropriate overloaded method.
protected static void manipulateActionElement(org.w3c.dom.html.HTMLAnchorElement el, BAction comp, ViewContext vc)
          HTMLAnchorElement - set the "href" attribute
protected static void manipulateActionElement(org.w3c.dom.html.HTMLButtonElement el, BAction comp, ViewContext vc)
          HTMLButtonElement
protected static void manipulateActionElement(org.w3c.dom.html.HTMLFormElement el, BAction comp, ViewContext vc)
          HTMLFormElement - set the "action" attribute
protected static void manipulateActionElement(org.w3c.dom.html.HTMLInputElement el, BAction comp, ViewContext vc)
          HTMLInputElement
protected static void manipulateActionElement(org.w3c.dom.html.HTMLSelectElement el, BAction comp, ViewContext vc)
          HTMLSelectElement
 void renderComponent(BComponent comp, View view, ViewContext vc)
          Render the data from the component into the view, taking into consideration the specified ViewContext
 
Methods inherited from class org.barracudamvc.core.comp.renderer.html.HTMLComponentRenderer
addChildToParent
 
Methods inherited from class org.barracudamvc.core.comp.renderer.DOMComponentRenderer
addDefaultView, bindChild, createDefaultNode, handleChildren, showNodeInterfaces
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
Constructor Detail

HTMLActionRenderer

public HTMLActionRenderer()
Method Detail

renderComponent

public void renderComponent(BComponent comp,
                            View view,
                            ViewContext vc)
                     throws RenderException
Render the data from the component into the view, taking into consideration the specified ViewContext

Specified by:
renderComponent in interface Renderer
Overrides:
renderComponent in class HTMLComponentRenderer
Parameters:
comp - the component to be rendered
view - the view the component should be rendered in
vc - the view context
Throws:
RenderException - if unable to render the component in the specified view

manipulateActionElement

protected static void manipulateActionElement(Element el,
                                              BAction comp,
                                              ViewContext vc)
                                       throws RenderException
Generic Element - cast elements to more specific elements in order to call the appropriate overloaded method. Throw an exception if the element is not supported.

Parameters:
el - the HTML element to be manipulated
comp - the BAction component containing information about the action to take on bound HTML element
vc - the current ViewContext
Throws:
RenderException

manipulateActionElement

protected static void manipulateActionElement(org.w3c.dom.html.HTMLAnchorElement el,
                                              BAction comp,
                                              ViewContext vc)
                                       throws RenderException
HTMLAnchorElement - set the "href" attribute

Throws:
RenderException
See Also:
manipulateActionElement(Element, BAction, ViewContext)

manipulateActionElement

protected static void manipulateActionElement(org.w3c.dom.html.HTMLFormElement el,
                                              BAction comp,
                                              ViewContext vc)
                                       throws RenderException
HTMLFormElement - set the "action" attribute

Throws:
RenderException
See Also:
manipulateActionElement(Element, BAction, ViewContext)

manipulateActionElement

protected static void manipulateActionElement(org.w3c.dom.html.HTMLInputElement el,
                                              BAction comp,
                                              ViewContext vc)
                                       throws RenderException
HTMLInputElement

Throws:
RenderException
See Also:
manipulateActionElement(Element, BAction, ViewContext)

manipulateActionElement

protected static void manipulateActionElement(org.w3c.dom.html.HTMLButtonElement el,
                                              BAction comp,
                                              ViewContext vc)
                                       throws RenderException
HTMLButtonElement

Throws:
RenderException
See Also:
manipulateActionElement(Element, BAction, ViewContext)

manipulateActionElement

protected static void manipulateActionElement(org.w3c.dom.html.HTMLSelectElement el,
                                              BAction comp,
                                              ViewContext vc)
                                       throws RenderException
HTMLSelectElement

Throws:
RenderException
See Also:
manipulateActionElement(Element, BAction, ViewContext)


Copyright © 2006 BarracudaMVC.org All Rights Reserved.