selectOneRadio using custom and ui:repeat cannot click label on primefaces

Posted: December 21, 2012 in web

Weird Fix: make sure under ui:repeat use the same id (“opt”) for radioButton and outputLabel

        <p:outputPanel id="customPanel">
            <p:selectOneRadio id="selectedCar" value="#{bean.selectedCarID}" layout="custom">
                <p:ajax update="customPanel" />
                <f:selectItems var="car"
                    value="#{bean.cars)}"
                    itemValue="#{car.carId}" />
            </p:selectOneRadio>
            <ui:repeat var="car"
                value="#{bean.cars}" varStatus="status">
                <h:panelGrid columns="2">
                    <p:radioButton id="opt" for="selectedCar"
                        itemIndex="#{status.index}" />
                    <h:outputLabel for="opt" value="#{car.name}" />
                </h:panelGrid>
            </ui:repeat>
        </p:outputPanel>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s