org.chenillekit.tapestry.core.components.RatingField

This component provides the ability to associate a RadioGroup and its subordinate Radio fields with a set of values displayed as a rating scale. This is typified by the "star field" where grayed stars represent the choices and highlighted stars represent the chosen value and all values up to the chosen value from left to right. This is in fact that default visual appearance. However, the images can be overridden via parameters and the entire component can, of course, be styled via CSS. As an added benefit, since the underlying representation is simply a RadioGroup with Radio fields it should degrade well when JS and/or CSS is disabled. This should keep the component rather accessible. By default the first value display image will be hidden as this typically will indicate no value.

[JavaDoc]

Component Parameters

Name Type Flags Default Default Prefix Description
encoder org.apache.tapestry5.ValueEncoder NOT Allow Null prop Encoder used to translate between server-side objects and client-side strings.
selectedImage org.apache.tapestry5.Asset NOT Allow Null prop the optional Selected-Image
source java.util.List Required, NOT Allow Null prop the rateable value list.
unselectedImage org.apache.tapestry5.Asset NOT Allow Null prop the optional UnSelected-Image
value T Required, NOT Allow Null prop The value to read or update.

Examples

This example describe how to use the Remove component.

MyPage.tml

                    
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
    <body>
        <h1>Hello Guys</h1>

        How do you vote that Doll? <img src="babe.gif"/>
        <form t:type="Form">
            <div t:type="ck/RatingField" source="list:'nice','hot','incredible hot','words fail me'" value="ratingValue"/>
            <input type="submit"/>
        </form>

    </body>
</html>

                

Back to index