org.mmbase.bridge.jsp.taglib.typehandler
Class DataTypeHandler

java.lang.Object
  extended by org.mmbase.bridge.jsp.taglib.typehandler.DataTypeHandler
All Implemented Interfaces:
TypeHandler

public class DataTypeHandler
extends Object
implements TypeHandler

The DataType of the field can also itself specify how the input widgets must look like. This TypeHandler wraps this Handler object into a TypeHandler. Actually, as soon as all TypeHandler implementations are migrated to Handlers, this can become the only way to do it.

Since:
MMBase-1.9.1
Version:
$Id: DataTypeHandler.java 40933 2010-02-09 14:05:06Z michiel $
Author:
Michiel Meeuwisssen

Field Summary
protected  Handler<String> handler
           
protected  Request request
           
 
Constructor Summary
DataTypeHandler(Handler<String> h, FieldInfoTag tag)
           
 
Method Summary
 String checkHtmlInput(Node node, Field field, boolean errors)
          Produces a div, containing the error message for the current value, or the empty string if everything ok.
protected  String findString(Field field)
           
 String htmlInput(Node node, Field field, boolean search)
          Produces an form input field for the given Node, and Field.
 String htmlInputId(Node node, Field field)
           
 void init()
           
 void paramHtmlInput(ParamHandler handler, Field field)
           
 boolean useHtmlInput(Node node, Field field)
          returns true if setValue happened.
 String whereHtmlInput(Field field)
           
 Constraint whereHtmlInput(Field field, Query query)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handler

protected final Handler<String> handler

request

protected final Request request
Constructor Detail

DataTypeHandler

public DataTypeHandler(Handler<String> h,
                       FieldInfoTag tag)
Method Detail

htmlInput

public String htmlInput(Node node,
                        Field field,
                        boolean search)
                 throws JspTagException
Description copied from interface: TypeHandler
Produces an form input field for the given Node, and Field.

Specified by:
htmlInput in interface TypeHandler
search - if true, then a search field is produced.
Throws:
JspTagException

htmlInputId

public String htmlInputId(Node node,
                          Field field)
                   throws JspTagException
Specified by:
htmlInputId in interface TypeHandler
Throws:
JspTagException

checkHtmlInput

public String checkHtmlInput(Node node,
                             Field field,
                             boolean errors)
                      throws JspTagException
Description copied from interface: TypeHandler
Produces a div, containing the error message for the current value, or the empty string if everything ok.

Specified by:
checkHtmlInput in interface TypeHandler
errors - Whether to output the error messages (otherwises only invalidates form)
Throws:
JspTagException

useHtmlInput

public boolean useHtmlInput(Node node,
                            Field field)
                     throws JspTagException
Description copied from interface: TypeHandler
returns true if setValue happened.

Specified by:
useHtmlInput in interface TypeHandler
Throws:
JspTagException

whereHtmlInput

public String whereHtmlInput(Field field)
                      throws JspTagException
Specified by:
whereHtmlInput in interface TypeHandler
Returns:
Piece of SQL. null if no constraint.
Throws:
JspTagException

findString

protected final String findString(Field field)
                           throws JspTagException
Throws:
JspTagException

paramHtmlInput

public void paramHtmlInput(ParamHandler handler,
                           Field field)
                    throws JspTagException
Specified by:
paramHtmlInput in interface TypeHandler
Throws:
JspTagException

whereHtmlInput

public Constraint whereHtmlInput(Field field,
                                 Query query)
                          throws JspTagException
Specified by:
whereHtmlInput in interface TypeHandler
Throws:
JspTagException

init

public void init()
Specified by:
init in interface TypeHandler


MMBase 2.0-SNAPSHOT - null