com.silverpeas.form.displayers
Class AbstractTextFieldDisplayer<T extends Field>
java.lang.Object
com.silverpeas.form.displayers.AbstractFieldDisplayer<TextField>
com.silverpeas.form.displayers.AbstractTextFieldDisplayer<T>
- All Implemented Interfaces:
- FieldDisplayer<TextField>
- Direct Known Subclasses:
- EmailFieldDisplayer, MapFieldDisplayer, TextAreaFieldDisplayer, TextFieldDisplayer, UrlFieldDisplayer
public abstract class AbstractTextFieldDisplayer<T extends Field>
- extends AbstractFieldDisplayer<TextField>
Method Summary |
protected void |
addMandatoryScript(StringBuilder script,
FieldTemplate template,
PagesContext pageContext)
|
protected void |
addSpecificScript(PrintWriter out,
FieldTemplate template,
PagesContext pageContext)
|
void |
displayScripts(PrintWriter out,
FieldTemplate template,
PagesContext pagesContext)
Prints the javascripts which will be used to control the new value given to the named field. |
String[] |
getManagedTypes()
Returns the name of the managed types. |
int |
getNbHtmlObjectsDisplayed(FieldTemplate template,
PagesContext pagesContext)
Return the number of HTML Objects displayed by the displayer. |
boolean |
isDisplayedMandatory()
|
List<String> |
update(String newValue,
TextField field,
FieldTemplate template,
PagesContext PagesContext)
Updates the value of the field. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractTextFieldDisplayer
public AbstractTextFieldDisplayer()
getManagedTypes
public String[] getManagedTypes()
- Returns the name of the managed types.
addMandatoryScript
protected void addMandatoryScript(StringBuilder script,
FieldTemplate template,
PagesContext pageContext)
addSpecificScript
protected void addSpecificScript(PrintWriter out,
FieldTemplate template,
PagesContext pageContext)
displayScripts
public void displayScripts(PrintWriter out,
FieldTemplate template,
PagesContext pagesContext)
throws IOException
- Prints the javascripts which will be used to control the new value given to the named field.
The error messages may be adapted to a local language. The FieldTemplate gives the field type
and constraints. The FieldTemplate gives the local labeld too. Never throws an Exception but
log a silvertrace and writes an empty string when :
- the fieldName is unknown by the template.
- the field type is not a managed type.
- Throws:
IOException
isDisplayedMandatory
public boolean isDisplayedMandatory()
getNbHtmlObjectsDisplayed
public int getNbHtmlObjectsDisplayed(FieldTemplate template,
PagesContext pagesContext)
- Description copied from interface:
FieldDisplayer
- Return the number of HTML Objects displayed by the displayer.
- Returns:
- the number of HTML Objects displayed by the displayer.
update
public List<String> update(String newValue,
TextField field,
FieldTemplate template,
PagesContext PagesContext)
throws FormException
- Description copied from interface:
FieldDisplayer
- Updates the value of the field. The fieldName must be used to retrieve the HTTP parameter from
the request. @throw FormException if the field type is not a managed type. @throw FormException
if the field doesn't accept the new value.
- Returns:
-
- Throws:
FormException
Copyright © 2016 Silverpeas. All Rights Reserved.