Rating

Rating component provides a star based rating input.

Documentation
Basic:
Callback:
Ajax Rate:
Readonly:
Disabled
Values
Rating 1:
Rating 2:
Rating 3:
<h:form>
    <p:growl id="messages" showDetail="true" />

    <h:panelGrid columns="2" cellpadding="5">
        <h:outputText value="Basic:" />
        <p:rating value="#{ratingView.rating1}" />

        <h:outputText value="Callback:" />
        <p:rating value="#{ratingView.rating2}" stars="10" cancel="false" onRate="alert('You rated ' + value)" />

        <h:outputText value="Ajax Rate:" />
        <p:rating value="#{ratingView.rating3}">
            <p:ajax event="rate" listener="#{ratingView.onrate}" update="messages" />
            <p:ajax event="cancel" listener="#{ratingView.oncancel}" update="messages" />
        </p:rating>

        <h:outputText value="Readonly:" />
        <p:rating value="#{ratingView.rating4}" readonly="true" />

        <h:outputText value="Disabled"/>
        <p:rating value="#{ratingView.rating4}" disabled="true" />
    </h:panelGrid>

    <p:commandButton value="Submit" update="display" oncomplete="PF('dlg').show()" style="margin:5px" />

    <p:dialog header="Values" widgetVar="dlg" showEffect="fade" hideEffect="fade">
        <h:panelGrid id="display" columns="2" cellpadding="5">
            <h:outputText value="Rating 1:" />
            <h:outputText value="#{ratingView.rating1}" />

            <h:outputText value="Rating 2:" />
            <h:outputText value="#{ratingView.rating2}" />

            <h:outputText value="Rating 3:" />
            <h:outputText value="#{ratingView.rating3}" />
        </h:panelGrid>
    </p:dialog>
</h:form>

FREE THEMES

Built-in component themes created by the PrimeFaces Theme Designer.

nova-light Nova-Light
nova-dark Nova-Dark
nova-colored Nova-Colored
luna-blue Luna-Blue
luna-amber Luna-Amber
luna-green Luna-Green
luna-pink Luna-Pink
omega Omega

PREMIUM TEMPLATES

Create awesome applications in no time using the premium templates and impress your users.