Java Doc for FormBuilder.java in  » Web-Framework » rife-1.6.1 » com » uwyn » rife » site » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » rife 1.6.1 » com.uwyn.rife.site 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.uwyn.rife.site.FormBuilder

All known Subclasses:   com.uwyn.rife.site.FormBuilderXhtml,  com.uwyn.rife.site.FormBuilderXml,
FormBuilder
public interface FormBuilder extends Cloneable(Code)
This interface defines the methods for bean-centric form generation.

All the fields in a form can be generated at once by using the generateForm methods, or individual fields can be generated through the generateField method. It's also possible to remove the form generation for all the fields or for one field in particular through the removeForm and removeField methods.

When generating a form of a Validated bean instance, and associated ValidationBuilder will be used to also generate the validation errors and markings.

The form building works with a Template instance that it will analyze for the presence of certain values. The names of these will be in the following format: FORM:PREFIX:name where FORM:PREFIX: identifies which type of field has to be generated and name indicates the name of the property for which the form field will be generated.

The form builder will generally use the constraints on the bean property to generate the form field with the appropriate meta data information. Many times it's appropriate to add custom information to the form fields. This can be done by providing text in between the form field value begin and end tags. For example, for the XHTML form builder you can provide custom CSS style information:

 <!--V 'FORM:INPUT:firstname'-->style="border: 1px solid black;"<!--/V-->
 
If the custom attributes are dynamic and contain value tags, then you should use a dedicated block template tag that has an ATTRIBUTES: middle part, for example:
 <!--V 'FORM:INPUT:firstname'/-->
 <!--B 'FORM:INPUT:ATTRIBUTES:firstname'-->style="border: 1px solid ${v color/};"<!--/B-->
 

By default, the generation of the form fields only includes the field itself. You can however customize this by specifying a block tag that has the same name as the value tag that will be filled in with the generated form field. This bock tag supports the following value tags: FORM:LABEL, FORM:NAME, FORM:VALUE and FORM:FIELD. If one of these is present, it will be replaced respectively with: the label of the form field, the name of the property, the current value of the property, and the generated form fields. For example:

 <!--B 'FORM:INPUT:firstname'-->
 <!--V 'FORM:NAME'/-->-<!--V 'FORM:VALUE'/--> : <!--V 'FORM:FIELD'/-->
 <!--/B-->
 
could be rendered like this with the XHTML form builder:
 firstname-John : <input type="text" name="firstname" />
 

author:
   Geert Bevin (gbevin[remove] at uwyn dot com)
version:
   $Revision: 3697 $
See Also:   Validated
See Also:   ValidationBuilder
since:
   1.0


Field Summary
final public static  StringID_FORM_FIELD
     Template value tags with the FORM:FIELD name will be replaced by the actual generated form field if they are present inside block tags that have the same name as the template value that will contain the generated form field.
final public static  StringID_FORM_LABEL
     Template value tags with the FORM:LABEL name will be replaced by the label if they are present inside block tags that have the same name as the template value that will contain the generated form field.
final public static  StringID_FORM_NAME
     Template value tags with the FORM:NAME name will be replaced by the field name if they are present inside block tags that have the same name as the template value that will contain the generated form field.
final public static  StringID_FORM_VALUE
     Template value tags with the FORM:VALUE name will be replaced by the current field value if they are present inside block tags that have the same name as the template value that will contain the generated form field.
final public static  StringMIDDLE_ATTRIBUTES
     A template block with an ATTRIBUTES middle part after the standard form field prefix, allows for dynamic custom attributes specifications for the form field generation.
final public static  StringPREFIX_FORM_CHECKBOX
     Template values that start with FORM:CHECKBOX: will generate a checkbox group for the property name that follows the prefix.
final public static  StringPREFIX_FORM_DISPLAY
     Template values that start with FORM:DISPLAY: will not actually generate a form field but simply display the current value as text.
final public static  StringPREFIX_FORM_HIDDEN
     Template values that start with FORM:HIDDEN: will generate a hidden form field for the property name that follows the prefix.
final public static  StringPREFIX_FORM_INPUT
     Template values that start with FORM:INPUT: will generate a text input form field for the property name that follows the prefix.
final public static  StringPREFIX_FORM_LABEL
     Template blocks that start with FORM:LABEL: provide a textual label for a specific value for a property name.
final public static  StringPREFIX_FORM_RADIO
     Template values that start with FORM:RADIO: will generate a radio button group for the property name that follows the prefix.
final public static  StringPREFIX_FORM_SECRET
     Template values that start with FORM:SECRET: will generate a password input form field for the property name that follows the prefix.
final public static  StringPREFIX_FORM_SELECT
     Template values that start with FORM:SELECT: will generate a select list for the property name that follows the prefix.
final public static  StringPREFIX_FORM_TEXTAREA
     Template values that start with FORM:TEXTAREA: will generate a multi-line text form field for the property name that follows the prefix.
final public static  StringSUFFIX_CHECKED
    
final public static  StringSUFFIX_SELECTED
    
final public static  String[]VALUE_PREFIXES
     The array of standard form field prefixes.


Method Summary
public  Objectclone()
    
public  Collection<String>generateField(Template template, ConstrainedProperty property, String[] values, String prefix)
     Generates a form field for one particular property.

If content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  property - the constrained property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page.

public  Collection<String>generateField(Template template, Class propertyType, ConstrainedProperty property, String[] values, String prefix)
     Generates a form field for one particular property.

If content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  propertyType - the type of the property
Parameters:
  property - the constrained property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page.

public  Collection<String>generateField(Template template, String name, String[] values, String prefix)
     Generates a form field for one particular property name.

If content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  name - the name of the property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page.

public  Collection<String>generateField(Template template, Class propertyType, String name, String[] values, String prefix)
     Generates a form field for one particular property name.

If content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  propertyType - the type of the property
Parameters:
  name - the name of the property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page.

public  Collection<String>generateForm(Template template, Class beanClass, Map<String, String[]> values, String prefix)
     Generates all the form fields for a bean class.

If content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  beanClass - the bean class whose properties will be analyzed forthe form generation
Parameters:
  values - a map of name-value pairs that indicate the currentlyactive context for the form that will be generated, these are typicallythe values that have been submitted previously through a web page.

public  Collection<String>generateForm(Template template, Object bean, Map<String, String[]> values, String prefix)
     Generates all the form fields for a bean instance.

If content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  bean - the bean instance whose properties and validation errorswill be analyzed for the form generation
Parameters:
  values - a map of name-value pairs that indicate the currentlyactive context for the form that will be generated, these are typicallythe values that have been submitted previously through a web page.

public  ValidationBuildergetValidationBuilder()
     Returns the ValidationBuilder that is used by this FormBuilder.
public  voidremoveField(Template template, String name, String prefix)
     Removes the content of the template value that would otherwise be filled in with a generated form field through a FormBuilder.generateField method.
public  voidremoveField(Template template, String templateFieldName)
     Removes the content of the template value that would otherwise be filled in with a generated form field through a FormBuilder.replaceField method.
public  voidremoveForm(Template template, Class beanClass, String prefix)
     Removes the content of all the template values that would otherwise be filled in with generated form fields through the FormBuilder.generateForm(Template,Class,Map,String) method.
public  Collection<String>replaceField(Template template, String templateFieldName, ConstrainedProperty property, String[] values, String prefix)
     Generates a form field for one particular property and always replace the content of the template values that match the auto-generation name format.

This method also adds a templateFieldName parameter. It allows you to use another property name for the template values than the one of the actual bean property.

public  Collection<String>replaceField(Template template, String templateFieldName, Class propertyType, ConstrainedProperty property, String[] values, String prefix)
     Generates a form field for one particular property and always replace the content of the template values that match the auto-generation name format.

The documentation of the FormBuilder.replaceField(Template,String,ConstrainedProperty,String[],String) previous replaceField method contains more information about the functionality of this method.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  templateFieldName - the name of the form field that will be used tolook for supported value tags in the property template
Parameters:
  propertyType - the type of the property
Parameters:
  property - the constrained property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page.

public  Collection<String>replaceField(Template template, String templateFieldName, String name, String[] values, String prefix)
     Generates a form field for one particular property name and always replace the content of the template values that match the auto-generation name format.

The documentation of the FormBuilder.replaceField(Template,String,ConstrainedProperty,String[],String) previous replaceField method contains more information about the functionality of this method.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  templateFieldName - the name of the form field that will be used tolook for supported value tags in the property template
Parameters:
  name - the name of the property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page.

public  Collection<String>replaceField(Template template, String templateFieldName, Class propertyType, String name, String[] values, String prefix)
     Generates a form field for one particular property name and always replace the content of the template values that match the auto-generation name format.

The documentation of the FormBuilder.replaceField(Template,String,ConstrainedProperty,String[],String) previous replaceField method contains more information about the functionality of this method.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  templateFieldName - the name of the form field that will be used tolook for supported value tags in the property template
Parameters:
  propertyType - the type of the property
Parameters:
  name - the name of the property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page.

public  Collection<String>selectParameter(Template template, String name, String[] values)
     Generates the required attributes so that an existing form field indicates its checked or selected status.
public  voidunselectParameter(Template template, String name, String[] values)
    

Field Detail
ID_FORM_FIELD
final public static String ID_FORM_FIELD(Code)
Template value tags with the FORM:FIELD name will be replaced by the actual generated form field if they are present inside block tags that have the same name as the template value that will contain the generated form field. (More information in the FormBuilder interface Javadocs)
since:
   1.0



ID_FORM_LABEL
final public static String ID_FORM_LABEL(Code)
Template value tags with the FORM:LABEL name will be replaced by the label if they are present inside block tags that have the same name as the template value that will contain the generated form field. (More information in the FormBuilder interface Javadocs)
since:
   1.0



ID_FORM_NAME
final public static String ID_FORM_NAME(Code)
Template value tags with the FORM:NAME name will be replaced by the field name if they are present inside block tags that have the same name as the template value that will contain the generated form field. (More information in the FormBuilder interface Javadocs)
since:
   1.0



ID_FORM_VALUE
final public static String ID_FORM_VALUE(Code)
Template value tags with the FORM:VALUE name will be replaced by the current field value if they are present inside block tags that have the same name as the template value that will contain the generated form field. (More information in the FormBuilder interface Javadocs)
since:
   1.0



MIDDLE_ATTRIBUTES
final public static String MIDDLE_ATTRIBUTES(Code)
A template block with an ATTRIBUTES middle part after the standard form field prefix, allows for dynamic custom attributes specifications for the form field generation.
since:
   1.0



PREFIX_FORM_CHECKBOX
final public static String PREFIX_FORM_CHECKBOX(Code)
Template values that start with FORM:CHECKBOX: will generate a checkbox group for the property name that follows the prefix. The possible checkbox values will be obtain from the inList constraint,
since:
   1.0



PREFIX_FORM_DISPLAY
final public static String PREFIX_FORM_DISPLAY(Code)
Template values that start with FORM:DISPLAY: will not actually generate a form field but simply display the current value as text.
since:
   1.0



PREFIX_FORM_HIDDEN
final public static String PREFIX_FORM_HIDDEN(Code)
Template values that start with FORM:HIDDEN: will generate a hidden form field for the property name that follows the prefix.
since:
   1.0



PREFIX_FORM_INPUT
final public static String PREFIX_FORM_INPUT(Code)
Template values that start with FORM:INPUT: will generate a text input form field for the property name that follows the prefix. The maximum length of the allowed text will be obtained from the maxLength constraint.
since:
   1.0



PREFIX_FORM_LABEL
final public static String PREFIX_FORM_LABEL(Code)
Template blocks that start with FORM:LABEL: provide a textual label for a specific value for a property name. The format after the prefix is propertyname:propertyvalue.

For example:

 <!--B 'FORM:LABEL:options:1'-->the first option<!--/B-->
 <!--B 'FORM:LABEL:options:2'-->the second option<!--/B-->
 

since:
   1.0



PREFIX_FORM_RADIO
final public static String PREFIX_FORM_RADIO(Code)
Template values that start with FORM:RADIO: will generate a radio button group for the property name that follows the prefix. The possible radio button values will be obtain from the inList constraint,
since:
   1.0



PREFIX_FORM_SECRET
final public static String PREFIX_FORM_SECRET(Code)
Template values that start with FORM:SECRET: will generate a password input form field for the property name that follows the prefix. The maximum length of the allowed text will be obtained from the maxLength constraint.
since:
   1.0



PREFIX_FORM_SELECT
final public static String PREFIX_FORM_SELECT(Code)
Template values that start with FORM:SELECT: will generate a select list for the property name that follows the prefix. The possible select list options will be obtain from the inList constraint,
since:
   1.0



PREFIX_FORM_TEXTAREA
final public static String PREFIX_FORM_TEXTAREA(Code)
Template values that start with FORM:TEXTAREA: will generate a multi-line text form field for the property name that follows the prefix.
since:
   1.0



SUFFIX_CHECKED
final public static String SUFFIX_CHECKED(Code)



SUFFIX_SELECTED
final public static String SUFFIX_SELECTED(Code)



VALUE_PREFIXES
final public static String[] VALUE_PREFIXES(Code)
The array of standard form field prefixes.
since:
   1.0





Method Detail
clone
public Object clone()(Code)



generateField
public Collection<String> generateField(Template template, ConstrainedProperty property, String[] values, String prefix)(Code)
Generates a form field for one particular property.

If content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  property - the constrained property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page. Thevalues will be used to pre-populate the form field with content.
Parameters:
  prefix - the prefix of the bean property names that should be usedwhile generating the form, this is handy to use when the several formsare present that use the same bean class or that has overlappingproperty names the collection of template value names that have been generated
since:
   1.0




generateField
public Collection<String> generateField(Template template, Class propertyType, ConstrainedProperty property, String[] values, String prefix)(Code)
Generates a form field for one particular property.

If content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  propertyType - the type of the property
Parameters:
  property - the constrained property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page. Thevalues will be used to pre-populate the form field with content.
Parameters:
  prefix - the prefix of the bean property names that should be usedwhile generating the form, this is handy to use when the several formsare present that use the same bean class or that has overlappingproperty names the collection of template value names that have been generated
since:
   1.6




generateField
public Collection<String> generateField(Template template, String name, String[] values, String prefix)(Code)
Generates a form field for one particular property name.

If content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  name - the name of the property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page. Thevalues will be used to pre-populate the form field with content.
Parameters:
  prefix - the prefix of the bean property names that should be usedwhile generating the form, this is handy to use when the several formsare present that use the same bean class or that has overlappingproperty names the collection of template value names that have been generated
since:
   1.0




generateField
public Collection<String> generateField(Template template, Class propertyType, String name, String[] values, String prefix)(Code)
Generates a form field for one particular property name.

If content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  propertyType - the type of the property
Parameters:
  name - the name of the property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page. Thevalues will be used to pre-populate the form field with content.
Parameters:
  prefix - the prefix of the bean property names that should be usedwhile generating the form, this is handy to use when the several formsare present that use the same bean class or that has overlappingproperty names the collection of template value names that have been generated
since:
   1.6




generateForm
public Collection<String> generateForm(Template template, Class beanClass, Map<String, String[]> values, String prefix) throws BeanUtilsException(Code)
Generates all the form fields for a bean class.

If content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  beanClass - the bean class whose properties will be analyzed forthe form generation
Parameters:
  values - a map of name-value pairs that indicate the currentlyactive context for the form that will be generated, these are typicallythe values that have been submitted previously through a web page. Thevalues will be used to pre-populate the form fields with content.
Parameters:
  prefix - the prefix of the bean property names that should be usedwhile generating the form, this is handy to use when the several formsare present that use the same bean class or that has overlappingproperty names the collection of template value names that have been generated
throws:
  BeanUtilsException - when errors occurred during the formgeneration
since:
   1.0




generateForm
public Collection<String> generateForm(Template template, Object bean, Map<String, String[]> values, String prefix) throws BeanUtilsException(Code)
Generates all the form fields for a bean instance.

If content has already been filled in for any of the template values that are normally replaced with generated form fields, no generation will happen for those and the existing content will simply remain present.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  bean - the bean instance whose properties and validation errorswill be analyzed for the form generation
Parameters:
  values - a map of name-value pairs that indicate the currentlyactive context for the form that will be generated, these are typicallythe values that have been submitted previously through a web page. Thevalues will be used to pre-populate the form fields with content.
Parameters:
  prefix - the prefix of the bean property names that should be usedwhile generating the form, this is handy to use when the several formsare present that use the same bean class or that has overlappingproperty names the collection of template value names that have been generated
throws:
  BeanUtilsException - when errors occurred during the formgeneration
since:
   1.0




getValidationBuilder
public ValidationBuilder getValidationBuilder()(Code)
Returns the ValidationBuilder that is used by this FormBuilder. this FormBuilder's ValidationBuilder
since:
   1.0



removeField
public void removeField(Template template, String name, String prefix)(Code)
Removes the content of the template value that would otherwise be filled in with a generated form field through a FormBuilder.generateField method.
Parameters:
  template - the template instance whose values will be cleared
Parameters:
  name - the name of the property for which the template value willbe cleared
Parameters:
  prefix - the prefix of the bean property names that should be usedwhile clearing the form, this is handy to use when the several formsare present that use the same bean class or that has overlappingproperty names
See Also:   FormBuilder.generateField
since:
   1.0



removeField
public void removeField(Template template, String templateFieldName)(Code)
Removes the content of the template value that would otherwise be filled in with a generated form field through a FormBuilder.replaceField method.
Parameters:
  template - the template instance whose values will be cleared
Parameters:
  templateFieldName - the that is use in the template values toidentify the property that has to be cleared
See Also:   FormBuilder.replaceField(Template,String,ConstrainedProperty,String[],String)
since:
   1.6



removeForm
public void removeForm(Template template, Class beanClass, String prefix) throws BeanUtilsException(Code)
Removes the content of all the template values that would otherwise be filled in with generated form fields through the FormBuilder.generateForm(Template,Class,Map,String) method.
Parameters:
  template - the template instance whose values will be cleared
Parameters:
  beanClass - the bean class whose properties will be analyzed forclearing the form field values
Parameters:
  prefix - the prefix of the bean property names that should be usedwhile clearing the form, this is handy to use when the several formsare present that use the same bean class or that has overlappingproperty names
throws:
  BeanUtilsException - when errors occurred during the clearing ofthe form
See Also:   FormBuilder.generateForm
since:
   1.0



replaceField
public Collection<String> replaceField(Template template, String templateFieldName, ConstrainedProperty property, String[] values, String prefix)(Code)
Generates a form field for one particular property and always replace the content of the template values that match the auto-generation name format.

This method also adds a templateFieldName parameter. It allows you to use another property name for the template values than the one of the actual bean property. You will typically use this when you dynamically generate a form and iterate over the generation of certain fields. So, for example, when you have properties named answer1 and answer2, you can use this template snippet:

 <!--V 'answers'/-->
 <!--B 'answer'-->
 <!--V 'FORM:INPUT:answer'/-->
 <!--/B-->
 
By using the replaceField(template, "answer", property, null, null) method call for each answer property and appending the answer block to the answers value, you can benefit from the automatic form field generation but still dynamically aggregate the results into one area.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  templateFieldName - the name of the form field that will be used tolook for supported value tags in the property template
Parameters:
  property - the constrained property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page. Thevalues will be used to pre-populate the form field with content.
Parameters:
  prefix - the prefix of the bean property names that should be usedwhile generating the form, this is handy to use when the several formsare present that use the same bean class or that has overlappingproperty names the collection of template value names that have been generated
since:
   1.6



replaceField
public Collection<String> replaceField(Template template, String templateFieldName, Class propertyType, ConstrainedProperty property, String[] values, String prefix)(Code)
Generates a form field for one particular property and always replace the content of the template values that match the auto-generation name format.

The documentation of the FormBuilder.replaceField(Template,String,ConstrainedProperty,String[],String) previous replaceField method contains more information about the functionality of this method.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  templateFieldName - the name of the form field that will be used tolook for supported value tags in the property template
Parameters:
  propertyType - the type of the property
Parameters:
  property - the constrained property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page. Thevalues will be used to pre-populate the form field with content.
Parameters:
  prefix - the prefix of the bean property names that should be usedwhile generating the form, this is handy to use when the several formsare present that use the same bean class or that has overlappingproperty names the collection of template value names that have been generated
since:
   1.6




replaceField
public Collection<String> replaceField(Template template, String templateFieldName, String name, String[] values, String prefix)(Code)
Generates a form field for one particular property name and always replace the content of the template values that match the auto-generation name format.

The documentation of the FormBuilder.replaceField(Template,String,ConstrainedProperty,String[],String) previous replaceField method contains more information about the functionality of this method.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  templateFieldName - the name of the form field that will be used tolook for supported value tags in the property template
Parameters:
  name - the name of the property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page. Thevalues will be used to pre-populate the form field with content.
Parameters:
  prefix - the prefix of the bean property names that should be usedwhile generating the form, this is handy to use when the several formsare present that use the same bean class or that has overlappingproperty names the collection of template value names that have been generated
See Also:   FormBuilder.replaceField(Template,String,ConstrainedProperty,String[],String)
since:
   1.6




replaceField
public Collection<String> replaceField(Template template, String templateFieldName, Class propertyType, String name, String[] values, String prefix)(Code)
Generates a form field for one particular property name and always replace the content of the template values that match the auto-generation name format.

The documentation of the FormBuilder.replaceField(Template,String,ConstrainedProperty,String[],String) previous replaceField method contains more information about the functionality of this method.
Parameters:
  template - the template instance that will be used for the formgeneration
Parameters:
  templateFieldName - the name of the form field that will be used tolook for supported value tags in the property template
Parameters:
  propertyType - the type of the property
Parameters:
  name - the name of the property that the form field will begenerated for
Parameters:
  values - the current values of the property, these are typicallythe values that have been submitted previously through a web page. Thevalues will be used to pre-populate the form field with content.
Parameters:
  prefix - the prefix of the bean property names that should be usedwhile generating the form, this is handy to use when the several formsare present that use the same bean class or that has overlappingproperty names the collection of template value names that have been generated
See Also:   FormBuilder.replaceField(Template,String,ConstrainedProperty,String[],String)
since:
   1.6




selectParameter
public Collection<String> selectParameter(Template template, String name, String[] values)(Code)
Generates the required attributes so that an existing form field indicates its checked or selected status.
Parameters:
  template - the template instance that will be used for thegeneration
Parameters:
  name - the name of the parameter
Parameters:
  values - the values of the parameter the collection of template value names that have been generated



unselectParameter
public void unselectParameter(Template template, String name, String[] values)(Code)
Removes the generated attributes that indicate that an existing form field is checked or selected
Parameters:
  template - the template instance that will be used for the clearing
Parameters:
  name - the name of the parameter
Parameters:
  values - the values of the parameter



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.