Table of contents
- 1 Constructors
- 2 Methods
- 2.1 TextFieldValue(String target, Object value) : String
- 2.2 TextFieldValue(String target, Object value, IDictionary attributes) : String
- 2.3 TextField(String target) : String
- 2.4 TextField(String target, IDictionary attributes) : String
- 2.5 TextArea(String target) : String
- 2.6 TextArea(String target, IDictionary attributes) : String
- 2.7 PasswordField(String target) : String
- 2.8 PasswordField(String target, IDictionary attributes) : String
- 2.9 TextFieldFormat(String target, String formatString) : String
- 2.10 TextFieldFormat(String target, String formatString, IDictionary attributes) : String
- 2.11 LabelFor(String target, String label) : String
- 2.12 LabelFor(String target, String label, IDictionary attributes) : String
- 2.13 HiddenField(String target) : String
- 2.14 HiddenField(String target, IDictionary attributes) : String
- 2.15 CreateCheckboxList(String target, IEnumerable dataSource) : CheckboxList
- 2.16 CreateCheckboxList(String target, IEnumerable dataSource, IDictionary attributes) : CheckboxList
- 2.17 CheckboxField(String target) : String
- 2.18 CheckboxField(String target, IDictionary attributes) : String
- 2.19 RadioField(String target, Object valueToSend) : String
- 2.20 RadioField(String target, Object valueToSend, IDictionary attributes) : String
- 2.21 Select(String target, IEnumerable dataSource) : String
- 2.22 Select(String target, IEnumerable dataSource, IDictionary attributes) : String
- 2.23 Select(String target, Object selectedValue, IEnumerable dataSource, IDictionary attributes) : String
- 2.24 CreateInputElement(String type, String target, Object value, IDictionary attributes) : String
- 2.25 CreateInputElement(String type, String id, String target, String value, IDictionary attributes) : String
- 2.26 ObtainValue(String target) : Object
- 2.27 ObtainValue(RequestContext context, String target) : Object
- 2.28 QueryPropertyRecursive(Object rootInstance, String[] propertyPath, Int32 piece) : Object
- 2.29 ObtainRootInstance(RequestContext context, String target) : Object
- 2.30 CreateHtmlId(IDictionary attributes, String target) : String
- 2.31 CreateHtmlId(IDictionary attributes, String target, Boolean removeEntry) : String
- 2.32 ObtainEntry(IDictionary attributes, String key) : String
- 2.33 ObtainEntryAndRemove(IDictionary attributes, String key, String defaultValue) : String
- 2.34 ObtainEntryAndRemove(IDictionary attributes, String key) : String
- 2.35 IsPresent(Object value, Object initialSetValue, PropertyInfo propertyOnInitialSet, Boolean isMultiple) : Boolean
- 2.36 GetMethod(Object elem, String property) : PropertyInfo
- 2.37 GetMethod(Type type, String property) : PropertyInfo
FormHelper API Document
The FormHelper allows you to output Html Input elements using the conventions necessary to use the DataBinder on the server side.
It also query the objects available on the context to show property values correctly, saving you the burden of filling text inputs, selects, checkboxes and radios.
Constructors
FormHelper()
Initializes a new instance of the Castle.MonoRail.Framework.Helpers.FormHelper class.
Methods
TextFieldValue(String target, Object value) : String
Generates an input text form element with the supplied value
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| value | Value to supply to the element (instead of querying the target) |
TextFieldValue(String target, Object value, IDictionary attributes) : String
Generates an input text form element with the supplied value
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| value | Value to supply to the element (instead of querying the target) |
| attributes | Attributes for the FormHelper method and for the html element it generates |
TextField(String target) : String
Generates an input text element.
The value is extracted from the target (if available)
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
TextField(String target, IDictionary attributes) : String
Generates an input text element.
The value is extracted from the target (if available)
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| attributes | Attributes for the FormHelper method and for the html element it generates |
TextArea(String target) : String
Generates a textarea element.
The value is extracted from the target (if available)
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
TextArea(String target, IDictionary attributes) : String
Generates a textarea element.
The value is extracted from the target (if available)
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| attributes | Attributes for the FormHelper method and for the html element it generates |
PasswordField(String target) : String
Generates a password input field.
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
PasswordField(String target, IDictionary attributes) : String
Generates a password input field.
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| attributes | Attributes for the FormHelper method and for the html element it generates |
TextFieldFormat(String target, String formatString) : String
Generates an input text element and formats the value with the specified format
The value is extracted from the target (if available)
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| formatString | The format string |
TextFieldFormat(String target, String formatString, IDictionary attributes) : String
Generates an input text element and formats the value with the specified format
The value is extracted from the target (if available)
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| formatString | The format string |
| attributes | Attributes for the FormHelper method and for the html element it generates |
LabelFor(String target, String label) : String
Generates a label element.
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| label | Legend |
LabelFor(String target, String label, IDictionary attributes) : String
Generates a label element.
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| label | Legend |
| attributes | Attributes for the FormHelper method and for the html element it generates |
HiddenField(String target) : String
Generates a hidden form element.
The value is extracted from the target (if available)
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
HiddenField(String target, IDictionary attributes) : String
Generates a hidden form element.
The value is extracted from the target (if available)
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| attributes | Attributes for the FormHelper method and for the html element it generates |
CreateCheckboxList(String target, IEnumerable dataSource) : CheckboxList
Creates a Castle.MonoRail.Framework.Helpers.FormHelper.CheckboxList instance which is enumerable. For each interaction you can invoke Castle.MonoRail.Framework.Helpers.FormHelper.CheckboxList.Item which will correctly render a checkbox input element for the current element on the supplied set (dataSource).
The enumerable item will be an element of the dataSource.
If the dataSource elements are complex objects (ie not string or primitives), supply the parameters value and text to the dictionary to make the helper use the specified properties to extract the option value and content respectively.Usually both the target and obviously the dataSource are sets with multiple items. The element types tend to be the same. If they are not, you might have to specify the suffix parameters on the attributes as it would not be inferred.
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| dataSource | The set of available elements |
CreateCheckboxList(String target, IEnumerable dataSource, IDictionary attributes) : CheckboxList
Creates a Castle.MonoRail.Framework.Helpers.FormHelper.CheckboxList instance which is enumerable. For each interaction you can invoke Castle.MonoRail.Framework.Helpers.FormHelper.CheckboxList.Item which will correctly render a checkbox input element for the current element on the supplied set (dataSource).
The enumerable item will be an element of the dataSource.
If the dataSource elements are complex objects (ie not string or primitives), supply the parameters value and text to the dictionary to make the helper use the specified properties to extract the option value and content respectively.Usually both the target and obviously the dataSource are sets with multiple items. The element types tend to be the same. If they are not, you might have to specify the suffix parameters on the attributes as it would not be inferred.
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| dataSource | The set of available elements |
| attributes | Attributes for the FormHelper method and for the html element it generates |
CheckboxField(String target) : String
Generates a checkbox field. In fact it generates two as a way to send a value if the primary checkbox is not checked. This allow the process the be aware of the unchecked value and act accordingly.
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
CheckboxField(String target, IDictionary attributes) : String
Generates a checkbox field. In fact it generates two as a way to send a value if the primary checkbox is not checked. This allow the process the be aware of the unchecked value and act accordingly.
The checked and unchecked values sent to the server defaults to true and false. You can override them using the parameters trueValue and falseValue.
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| attributes | Attributes for the FormHelper method and for the html element it generates |
RadioField(String target, Object valueToSend) : String
Generates a radio input type with the specified value to send to the served in case the element in checked. It will automatically check the radio if the target evaluated value is equal to the specified valueToSend.
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| valueToSend |
RadioField(String target, Object valueToSend, IDictionary attributes) : String
Generates a radio input type with the specified value to send to the served in case the element in checked. It will automatically check the radio if the target evaluated value is equal to the specified valueToSend.
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| valueToSend | |
| attributes | Attributes for the FormHelper method and for the html element it generates |
Select(String target, IEnumerable dataSource) : String
Creates a select element and its options based on the dataSource. If the dataSource elements are complex objects (ie not string or primitives), supply the parameters value and text to the dictionary to make the helper use the specified properties to extract the option value and content respectively.
You can also specify the attribute firstoption to force the first option be something like 'please select'.
Usually the target is a single value and the dataSource is obviously a set with multiple items. The element types tend to be the same. If they are not, you might have to specify the suffix parameters on the attributes as it would not be inferred.
The target can also be a set. In this case the intersection will be the initially selected elements.
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| dataSource | The set of available elements |
Select(String target, IEnumerable dataSource, IDictionary attributes) : String
Creates a select element and its options based on the dataSource. If the dataSource elements are complex objects (ie not string or primitives), supply the parameters value and text to the dictionary to make the helper use the specified properties to extract the option value and content respectively.
You can also specify the attribute firstoption to force the first option be something like 'please select'.
Usually the target is a single value and the dataSource is obviously a set with multiple items. The element types tend to be the same. If they are not, you might have to specify the suffix parameters on the attributes as it would not be inferred.
The target can also be a set. In this case the intersection will be the initially selected elements.
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| dataSource | The set of available elements |
| attributes | Attributes for the FormHelper method and for the html element it generates |
Select(String target, Object selectedValue, IEnumerable dataSource, IDictionary attributes) : String
Creates a select element and its options based on the dataSource. If the dataSource elements are complex objects (ie not string or primitives), supply the parameters value and text to the dictionary to make the helper use the specified properties to extract the option value and content respectively.
You can also specify the attribute firstoption to force the first option be something like 'please select'.
Usually the target is a single value and the dataSource is obviously a set with multiple items. The element types tend to be the same. If they are not, you might have to specify the suffix parameters on the attributes as it would not be inferred.
The target can also be a set. In this case the intersection will be the initially selected elements.
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
| selectedValue | |
| dataSource | The set of available elements |
| attributes | Attributes for the FormHelper method and for the html element it generates |
CreateInputElement(String type, String target, Object value, IDictionary attributes) : String
Creates the specified input element using the specified parameters to supply the name, value, id and others html attributes.
| Parameter | Description |
|---|---|
| type | |
| target | The object to get the value from and to be based on to create the element name. |
| value | |
| attributes | Attributes for the FormHelper method and for the html element it generates |
CreateInputElement(String type, String id, String target, String value, IDictionary attributes) : String
Creates the specified input element using the specified parameters to supply the name, value, id and others html attributes.
| Parameter | Description |
|---|---|
| type | |
| id | |
| target | The object to get the value from and to be based on to create the element name. |
| value | |
| attributes | Attributes for the FormHelper method and for the html element it generates |
ObtainValue(String target) : Object
Queries the context for the target value
| Parameter | Description |
|---|---|
| target | The object to get the value from and to be based on to create the element name. |
ObtainValue(RequestContext context, String target) : Object
Queries the context for the target value
| Parameter | Description |
|---|---|
| context | |
| target | The object to get the value from and to be based on to create the element name. |
QueryPropertyRecursive(Object rootInstance, String[] propertyPath, Int32 piece) : Object
| Parameter | Description |
|---|---|
| rootInstance | |
| propertyPath | |
| piece |
ObtainRootInstance(RequestContext context, String target) : Object
| Parameter | Description |
|---|---|
| context | |
| target | The object to get the value from and to be based on to create the element name. |
CreateHtmlId(IDictionary attributes, String target) : String
Creates the HTML id.
| Parameter | Description |
|---|---|
| attributes | The attributes. |
| target | The target. |
CreateHtmlId(IDictionary attributes, String target, Boolean removeEntry) : String
Creates the HTML id.
| Parameter | Description |
|---|---|
| attributes | The attributes. |
| target | The target. |
| removeEntry | if set to true [remove entry]. |
ObtainEntry(IDictionary attributes, String key) : String
Obtains the entry.
| Parameter | Description |
|---|---|
| attributes | The attributes. |
| key | The key. |
ObtainEntryAndRemove(IDictionary attributes, String key, String defaultValue) : String
Obtains the entry and remove it if found.
| Parameter | Description |
|---|---|
| attributes | The attributes. |
| key | The key. |
| defaultValue | The default value. |
ObtainEntryAndRemove(IDictionary attributes, String key) : String
Obtains the entry and remove it if found.
| Parameter | Description |
|---|---|
| attributes | The attributes. |
| key | The key. |
IsPresent(Object value, Object initialSetValue, PropertyInfo propertyOnInitialSet, Boolean isMultiple) : Boolean
Determines whether the present value matches the value on the initialSetValue (which can be a single value or a set)
| Parameter | Description |
|---|---|
| value | Value from the datasource |
| initialSetValue | Value from the initial selection set |
| propertyOnInitialSet | Optional. Property to obtain the value from |
| isMultiple | true if the initial selection is a set |
GetMethod(Object elem, String property) : PropertyInfo
Gets the property get method.
This method is used to get the System.Reflection.MethodInfo to retrieve specified property from the specified type.
| Parameter | Description |
|---|---|
| elem | Object specifying the type for which to get the method. |
| property | Property name. |
GetMethod(Type type, String property) : PropertyInfo
Missing summary
| Parameter | Description |
|---|---|
| type | Missing documentation |
| property | Missing documentation |