content
Tag floatField


displays a Jahia float field.

Extends the AbstractFieldTag class.

Attributes inherited from tag content:abstractField (i.e. from class org.jahia.taglibs.field.AbstractFieldTag)
name, display, defaultValue, pageId, pageLevel, diffActive, valueId


Tag Information
Tag Classorg.jahia.taglibs.field.FloatFieldTag
TagExtraInfo ClassNone
Body Contentempty
Display NameNone

Attributes
NameRequiredRequest-timeTypeDescription
displayfalsetruejava.lang.Stringname of the bean to copy the field into.

This is done in order to re-use the field later on in other tags. For more information about beans and their usage, we recommend reading the JSP specifications, and the Struts documentation.

displayfalsetruebooleandisplay field content or not.

Set to 'true' by default.

Example 1:

<content:bigTextField name='interest' defaultValue="This is interesting" diffActive="true"/>

The above displays the contents of the 'interest' bigTextField.

Example 2:

<content:bigTextField name='title' defaultValue="" diffActive="true" display="false" valueId="thetitle"/>
<logic:present name="thetitle">
    <h4><bean:write name="title" filter="false"/></h4>
</logic:present>

Since the display attribute of the 'title' field is false, the field isn't displayed. This is because we only want to generate the <h4> tag when the 'title' is valid.

namefalsetruejava.lang.Stringname of field to display.

defaultValuefalsetruejava.lang.Stringdefault of value of field if not already initialized.

This string contains the default value the field should have before the user starts editing it. The default value format will depend on the type of field you are declaring. Default values may contain some advanced markers (such as multi-valued default value) allowing for some powerful customization.

Markers Introduction:

A marker is very similar to an HTML tag, it is an enclosure for a string, that tells Jahia that it is not handling a regular string default value, but rather that it must process the default value using certain sub-systems in order to generate the values that will be displayed in the edition GUI popup.

  • Multi-value Marker:

    The default value can either include a value or a special marker to allow a set of values. These will appear as options in a drop down box in the editing engine. A default value in the set of values can also be preselected. The syntax is as follows:

    defaultValue="<jahia_multivalue[value1:value2:value3]>" (displays three choices for this field and allows the user to only pick one)

    defaultValue="<jahia_multivalue_single[value1:value2:value3]>" (ditto)

    defaultValue="<jahia_multivalue[value1:value2:value3]>value1" (ditto but with value1 as the default selection)

    defaultValue="<jahia_multivalue_multiple[value1:value2:value3]>" (displays three choices for this field and allows the user to pick one or more)

    defaultValue="<jahia_multivalue_multiple[value1:value2:value3]>value1" (ditto but with value1 as the default selection)

    The jahia_multivalue marker is supported by the Integer, Float, SharedSmallText and Smalltext fieldtypes.

  • Resource Bundle Marker:

    The default value of the field can also by directly specifying which resource bundle item to use, instead of using the content:resourceBundle tag. The syntax is as follows:

    <jahia-resource id="MySiteResource" key="product.001" default-value="Crew"/> (inserts the text from at key product.001 of resource bundle MySiteResource and defaults to Crew if it cannot find it)

  • Expression Marker:

    Since version 4.0.X, Jahia supports expression markers compatible with Apache's Java Expression Language (JEXL) specification. An example is given below:

    <jahia-expression expr="user/username" storeMarker="false"/> (retrieves the current username. If storeMarker was set to true, the expression would not be resolved and stored uninterpreted)

pageIdfalsetruejava.lang.Stringthe Page ID of the page which contains the desired field.

In the same way we can access container lists using absolute or relative addressing, it is also possible to access fields that were declared outside of containers, and directly attached to a page. The addressing system for fields is quite similar to the one for container lists. There is no such thing as an "absoluteField" tag, but instead we simply add a "pageId" attribute to the regular field display tag.

Example

<content:bigTextField name="testField" pageId="3"/>

This displays the field called "testField" that is present on page 3.

pageLevelfalsetruejava.lang.Stringthe Page ID of the page which contains the desired field.

Just in the same way as we can use page level addressing for container lists, the same technique can be used to access fields directly attached to page. So if we have the current page path that looks like this :

page 1 -> page 2 -> page 3 -> page 4

and given that we are currently on page 4, the following code : <content:bigTextField name=�testField� pageLevel=�1� />

will display the field called "testField" that is present on page 1.

diffActivefalsetruebooleanhighlight the differences between the staging and live mode of this field.

This is tag is independent of the content:containerDiffHighlight tag; the former displays staging difference for a field, the latter for a container. One does not require the other.

The differences are conveyed by changing the style of the modified text -and adding new text if necessary. The text below is the original bigTextField content:

If you have a similar passion for dogs, please write to me an email and let's have lunch together....

We now edit it by deleting 'please', changing 'lunch' to 'diner' and adding 'I am a nice person'. In compare mode, Jahia will generate the following accociated highlights:


If you have a similar passion for dogs, please write to me an email and let's have diner together....

I am a nice person.

valueIdfalsetruejava.lang.Stringname of bean to copy this field's value into.

If this parameter is set, Jahia creates a bean holding the field's value. The Struts logic tag library can then be used to operate on the bean, such as testing the value existence using the notEmpty tag.

This bean is accessible to the rest of the page since it's stored in the PageContext object ('a PageContext instance provides access to all the namespaces associated with a JSP page'). JSP pages containing fields defined with identical valueId are supported; however each field tag will destroy any previously created bean with the same name.

Refer to attribute 'display' for an example.


Variables
No Variables Defined.


Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.