Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tonbeller.wcf.form
Class ButtonHandler

    java.lang.Object
      com.tonbeller.wcf.form.ButtonHandler

All Implemented Interfaces:
  NodeHandler, RequestListener

public class ButtonHandler
extends java.lang.Object
implements NodeHandler, RequestListener

Default ButtonHandler. TODO should be unified with ActionReference Code! Supports the following attributes

action="revert"
  calls revert() on the `Form`, i.e. formats the data from the bean for presentation.
action="validate"
  calls validate() on the `Form`, i.e. parses user input and writes the values to the bean properties
forward="/some/page.jsp"
  if validation succeeds forwards to another page. Paramers make sense here.
hide="true"
  if validation succeeds hides the component
successAttr="name-of-request-attribute"
  if validation succeeds a request attribute with value `true` is created.
scroller="true"
  keeps the current browser window scroll position after the request is finished

Author:
  av

Field Summary
`static java.lang.String` | `NO_ACTION`
`static java.lang.String` | `REVERT_ACTION`
`static java.lang.String` | `VALIDATE_ACTION`

Constructor Summary
`ButtonHandler()`

Method Summary
`void` | `destroy(javax.servlet.http.HttpSession session)`
`void` | `initialize(RequestContext context, XmlComponent comp, org.w3c.dom.Element element)` initializes the handler
`void` | `render(RequestContext context)` does nothing
`void` | `request(RequestContext context)` calls revert/validate on the form and sets the next view

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### NO_ACTION

    public static final java.lang.String NO_ACTION

See Also:
  Constant Field Values

### VALIDATE_ACTION

    public static final java.lang.String VALIDATE_ACTION

See Also:
  Constant Field Values

### REVERT_ACTION

    public static final java.lang.String REVERT_ACTION

See Also:
  Constant Field Values

Constructor Detail

### ButtonHandler

    public ButtonHandler()

Method Detail

### initialize

    public void initialize(RequestContext context,
                           XmlComponent comp,
                           org.w3c.dom.Element element)

  Description copied from interface: `NodeHandler`
  initializes the handler

  Specified by:
    `initialize` in interface `NodeHandler`
  Parameters:
    `context` - the current request
    `element` - the element that this handler is responsible for

### destroy

    public void destroy(javax.servlet.http.HttpSession session)

  Specified by:
    `destroy` in interface `NodeHandler`

### request

    public void request(RequestContext context)
                 throws java.lang.Exception

  calls revert/validate on the form and sets the next view

  Specified by:
    `request` in interface `RequestListener`
  Parameters:
    `context` - the current request
  Throws:
    `java.lang.Exception`

### render

    public void render(RequestContext context)
                throws java.lang.Exception

  does nothing

  Specified by:
    `render` in interface `NodeHandler`
  Throws:
    `java.lang.Exception`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD