echopoint.ui.util
Class ValidationHelper

java.lang.Object
  extended by echopoint.ui.util.ValidationHelper

public class ValidationHelper
extends java.lang.Object

ValidationHelper is used by UI peers to place validation JS support into the resultant web pages.


Field Summary
static StaticText SERVICE_VALIDATION
           
static StaticText SERVICE_VALIDATION_DATE
           
static StaticText SERVICE_VALIDATION_FUNCS
           
 
Constructor Summary
ValidationHelper()
           
 
Method Summary
static void addValidationSupport(RenderingContext rc, java.lang.String htmlId, Validateable validateable)
          Adds validation UI support for a Validateable.
static java.lang.String getOnBlurRule(RenderingContext rc, java.lang.String htmlId, Validateable validateable)
          Called to return the onblur function to support validation.
static java.lang.String getOnChangeRule(RenderingContext rc, java.lang.String htmlId, Validateable validateable)
          Called to return the onchange function to support validation.
static java.lang.String getSubmitterActionCommand(RenderingContext rc, ValidationSubmitter submitter, java.lang.String id, java.lang.String command)
           
static java.lang.String getSubmitterActionCommand(RenderingContext rc, ValidationSubmitter submitter, java.lang.String id, java.lang.String command, boolean async)
          This adds support for a ValidationSubmitter for running validation when submitting the page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_VALIDATION

public static final StaticText SERVICE_VALIDATION

SERVICE_VALIDATION_FUNCS

public static final StaticText SERVICE_VALIDATION_FUNCS

SERVICE_VALIDATION_DATE

public static final StaticText SERVICE_VALIDATION_DATE
Constructor Detail

ValidationHelper

public ValidationHelper()
Method Detail

addValidationSupport

public static void addValidationSupport(RenderingContext rc,
                                        java.lang.String htmlId,
                                        Validateable validateable)
Adds validation UI support for a Validateable. This loads up the required scripts and creates the JavaScript entries for client side validation

Parameters:
rc - - the current RenderingContext
htmlId - - the htmlId of the element
validateable -

getOnBlurRule

public static java.lang.String getOnBlurRule(RenderingContext rc,
                                             java.lang.String htmlId,
                                             Validateable validateable)
Called to return the onblur function to support validation. If it not requires, because there is no rules, then an empty string is returned. You can append it to any other onblur script that may save the state of the component such as E_setParameter.

Parameters:
rc - - the rendering context in play
htmlId - - the base HTML in play
validateable - - the validateable itself
Returns:
the onblur script or "" is not required

getOnChangeRule

public static java.lang.String getOnChangeRule(RenderingContext rc,
                                               java.lang.String htmlId,
                                               Validateable validateable)
Called to return the onchange function to support validation. If it not requires, because there is no rules, then an empty string is returned. You can append it to any other onchange script that may save the state of the component such as E_setParameter.

Parameters:
rc - - the rendering context in play
htmlId - - the base HTML in play
validateable - - the validateable itself
Returns:
the onchange script or "" is not required

getSubmitterActionCommand

public static java.lang.String getSubmitterActionCommand(RenderingContext rc,
                                                         ValidationSubmitter submitter,
                                                         java.lang.String id,
                                                         java.lang.String command)

getSubmitterActionCommand

public static java.lang.String getSubmitterActionCommand(RenderingContext rc,
                                                         ValidationSubmitter submitter,
                                                         java.lang.String id,
                                                         java.lang.String command,
                                                         boolean async)
This adds support for a ValidationSubmitter for running validation when submitting the page.

Parameters:
rc - - the rendering context in place
submitter - - the ValidationSubmitter in question
id - - the unqiue id string to sue
command - - the command string to use
Returns:
a valid JavaScript action command call