JARCH SHOWCASE
JARCH SHOWCASE
Rating Rating component provides a star based rating input.
Basic:
Callback:
Ajax Rate:
Readonly:
Disabled
Values
Rating 1:
Rating 2:
Rating 3:
<a:form>
    <a:growl id="messages" showDetail="true" />

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

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

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

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

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

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

    <a: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>
    </a:dialog>
</a:form>
                
JARCH, Copyright © 2022 All rights reserved. Running JARCH 24.3.0-SNAPSHOT on PrimeFaces-12.0.0 on Mojarra-2.3.13.