com.silverpeas.form
Interface FieldDisplayer<T extends Field>

Type Parameters:
T - the type of field.
All Known Implementing Classes:
AbstractFieldDisplayer, AbstractFileFieldDisplayer, AbstractTextFieldDisplayer, AccessPathFieldDisplayer, CheckBoxDisplayer, DateFieldDisplayer, EmailFieldDisplayer, ExplorerFieldDisplayer, FileFieldDisplayer, GroupFieldDisplayer, ImageFieldDisplayer, JdbcFieldDisplayer, JdbcRefFieldDisplayer, LdapFieldDisplayer, ListBoxFieldDisplayer, MapFieldDisplayer, MultipleUserFieldDisplayer, PdcFieldDisplayer, PdcPositionsFieldDisplayer, PdcUserFieldDisplayer, RadioButtonDisplayer, SequenceFieldDisplayer, TextAreaFieldDisplayer, TextDisplayer, TextFieldDisplayer, TimeFieldDisplayer, UniqueIdFieldDisplayer, UrlFieldDisplayer, UserFieldDisplayer, VideoFieldDisplayer, WysiwygFCKFieldDisplayer

public interface FieldDisplayer<T extends Field>

A FieldDisplayer is an object which can display in HTML the content of a field to a end user and can retrieve via HTTP any updated value. A FieldDisplayer can only manage fields of a specific type. The links between Fields and FieldDisplayers are managed by a FormField. FieldDisplayers are grouped in Form in order to display each fields of a DataRecord.

See Also:
Field, Form

Method Summary
 void display(PrintWriter out, T field, FieldTemplate template, PagesContext pagesContext)
          Prints the HTML value of the field.
 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.
 int getNbHtmlObjectsDisplayed(FieldTemplate template, PagesContext pagesContext)
          Return the number of HTML Objects displayed by the displayer.
 void index(FullIndexEntry indexEntry, String key, String fieldName, T field, String language, boolean stored)
          Add the content of the field to the index entry
 boolean isDisplayedMandatory()
           
 List<String> update(List<org.apache.commons.fileupload.FileItem> items, T field, FieldTemplate template, PagesContext pagesContext)
          Updates the value of the field.
 List<String> update(String value, T field, FieldTemplate template, PagesContext pagesContext)
          Updates the value of the field.
 

Method Detail

displayScripts

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 FormField gives the field type and constraints. The FormField gives the local labeld too. Never throws an Exception but log a silvertrace and writes an empty string when :

Parameters:
out -
template -
pagesContext -
Throws:
IOException

display

void display(PrintWriter out,
             T field,
             FieldTemplate template,
             PagesContext pagesContext)
             throws FormException
Prints the HTML value of the field. The value format may be adapted to a local language. The fieldName must be used to name the html form input. Never throws an Exception but log a silvertrace and writes an empty string when :

Parameters:
out -
field -
template -
pagesContext -
Throws:
FormException

update

List<String> update(List<org.apache.commons.fileupload.FileItem> items,
                    T field,
                    FieldTemplate template,
                    PagesContext pagesContext)
                    throws FormException
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.

Parameters:
items -
field -
template -
pagesContext -
Returns:
Throws:
FormException

update

List<String> update(String value,
                    T field,
                    FieldTemplate template,
                    PagesContext pagesContext)
                    throws FormException
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.

Parameters:
value -
field -
template -
pagesContext -
Returns:
Throws:
FormException

isDisplayedMandatory

boolean isDisplayedMandatory()

getNbHtmlObjectsDisplayed

int getNbHtmlObjectsDisplayed(FieldTemplate template,
                              PagesContext pagesContext)
Return the number of HTML Objects displayed by the displayer.

Parameters:
template -
pagesContext -
Returns:
the number of HTML Objects displayed by the displayer.

index

void index(FullIndexEntry indexEntry,
           String key,
           String fieldName,
           T field,
           String language,
           boolean stored)
Add the content of the field to the index entry

Parameters:
indexEntry -
key -
fieldName -
field -
language -


Copyright © 2016 Silverpeas. All Rights Reserved.