net.sf.tacos.formatter
Class FormatterUtils

java.lang.Object
  extended by net.sf.tacos.formatter.FormatterUtils

public class FormatterUtils
extends Object

User: andyhot


Constructor Summary
FormatterUtils()
           
 
Method Summary
static void linkFormatter(org.apache.tapestry.IRequestCycle cycle, org.apache.tapestry.engine.IScriptSource scriptSource, org.apache.tapestry.IComponent comp, JsFormatter formatter, String uniqueId)
          Connects a given IFormComponent to a client-side javascript formatter that will bind events to a form field to mask input and format values on change events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatterUtils

public FormatterUtils()
Method Detail

linkFormatter

public static void linkFormatter(org.apache.tapestry.IRequestCycle cycle,
                                 org.apache.tapestry.engine.IScriptSource scriptSource,
                                 org.apache.tapestry.IComponent comp,
                                 JsFormatter formatter,
                                 String uniqueId)
Connects a given IFormComponent to a client-side javascript formatter that will bind events to a form field to mask input and format values on change events.

The incoming expression should be a valid bean locator exp, that looks like "number,places=0;decimal=.;separator=,". The general format is <formatter-type>,<initializer>, where the initializer is a formatter specific string (for example, the above initializer sets number formatting params - note that semicolons are used in the initializer, while the locator itself expects a comma).

For formatter specific instructions of the initializer, see its javadoc.

Parameters:
cycle - The current request.
scriptSource - Tapestry script source.
comp - component being referenced.
formatter - javascript formatter.
uniqueId - optional overriden unique id for the component.