search:field
Description
The Field directive.
Usage
<search:field name="{string}" [result="{object}"] [query="{object}"] [max-characters="{string}"] [date-format="{string}"] [number-format="{string}"] [url="{string}"] [urlfield="{string}"] [target="{string}"] [action="{string}"] [default-value="{string}"] [label="{string}"] [value-element="{string}"] [label-element="{string}"] [prefix="{string}"] [suffix="{string}"] [show-more="{string}"] [show="{number}"] [separator="{string}"] [url-prefix="{string}"] [url-suffix="{string}"]> </search:field>
Directive info
- This directive creates new scope.
Parameters
Param | Type | Details |
---|---|---|
name | string | Name of the field to be rendered from the result |
result (optional) | object | The result containing the field to be rendered |
query (optional) | object | Providing a Query object means that the Value will be displayed as a hyperlink that submits the Query again with this field and its value as a Filt |
max-characters (optional) | string | Limit display value to a certain number of characters, adding '...' if maxCharacters is exceeded. |
date-format (optional) | string | How to format the date. See date format filter for valid formats. |
number-format (optional) | string | Format string for the numbers used using the Java DecimalFormat pattern. Default: '#,##0.###' |
url (optional) | string | URL to redirect to when the field is clicked; |
urlfield (optional) | string | Field containing a url to redirect to when the field is clicked; |
target (optional) | string | Set an HTML target attribute for the anchor tag. For example use _blank to have the generated link open the results in a new window. (Not applicable to query) |
action (optional) | string | Alternative page to submit the query parameters to - defaults to current page. If a 'url' attribute is provided the action is ignored and query parameters are not included in the request. |
default-value (optional) | string | Default value to show when no value is present in the index. |
label (optional) | string | A label to use instead of the default value provided by the Platform. If this attribute is set to an empty String (““) then the label container HTML is omitted from the output. |
value-element (optional) | string | The HTML element to use for the value (Default p). |
label-element (optional) | string | The HTML element to use for the label (Default p) |
prefix (optional) | string | Text to prefix index values with (not applied to default value). E.g. if the index field 'price' contains the value '10'. A prefix="US$" would result in 'US$10' would be displayed. |
suffix (optional) | string | Text to append to index values (not applied to default value). E.g. if the index field 'weight' contains the value '10'. A suffix=" kg." would result in '10 kg.' being displayed as the value. |
show-more (optional) | string | If the display value is limited by the max-characters, a show more link will be shown. The value of the attribute will be used as the label |
show (optional) | number | Number of values to show if the field is multivalued.Default: No limit (-1) |
separator (optional) | string | Separator character or sequence to split a Field into multiple values. Setting the separator to “;” would turn the value “company1; company2; company3” into a list of 3 values. |
url-prefix (optional) | string | Text to add as a prefix to the URL. |
url-suffix (optional) | string | Text to add as a suffix to the URL. |