3 Replies Latest reply on Oct 25, 2010 8:26 PM by Siva P

    How to display the h:selectOneRadio in the jsp page???

    Siva P Master

      Hi all,

       

      I have problem that how to display the radio button in the screen.below is my code....

       

      <rich:column>

      <h:selectOneRadio id="selectedField" layout="pageDirection"

      value="#{editAccountInfoBean.selectedMobileNo}" style="font-size:10px;">

      <f:selectItem itemValue="Red" itemLabel="Color1 - Red" />

         <f:selectItem itemValue="Green" itemLabel="Color1 - Green" />

         <f:selectItem itemValue="Blue" itemLabel="Color1 - Blue" />

      <a4j:support eventsQueue="my.events.queue" event="onclick"

      action="#{editAccountInfoBean.assignSelected}"

      ajaxSingle="true">

      <f:setPropertyActionListener value="#{row}"

      target="#{editAccountInfoBean.currentRow}" />

         </a4j:support>

         </h:selectOneRadio>

       

         <h:selectBooleanCheckbox id="selectedField2"

      value="#{editAccountInfoBean.selectedMobileNo}" style="font-size:10px;">

      <a4j:support eventsQueue="my.events.queue" event="onclick"

      action="#{editAccountInfoBean.assignSelected}"

      ajaxSingle="true">

      <f:setPropertyActionListener value="#{row}"

      target="#{editAccountInfoBean.currentRow}" />

         </a4j:support>

      </h:selectBooleanCheckbox>

      </rich:column>

       

       

      If i remove the below coding i can;t able to see the radio button in the datatable???

                                                    <f:selectItem itemValue="Red" itemLabel="Color1 - Red" />

         <f:selectItem itemValue="Green" itemLabel="Color1 - Green" />

         <f:selectItem itemValue="Blue" itemLabel="Color1 - Blue" />

       

      How h:selectBooleanCheckbox is display in the screen???What is the solution for this.I just want to display only the radio button only in the screen???

       

      RadioError.JPG

      <rich:column>
      <h:selectOneRadio id="selectedField" layout="pageDirection"
      value="#{editAccountInfoBean.selectedMobileNo}" style="font-size:10px;">
      <f:selectItem itemValue="Red" itemLabel="Color1 - Red" />
                       <f:selectItem itemValue="Green" itemLabel="Color1 - Green" />
                       <f:selectItem itemValue="Blue" itemLabel="Color1 - Blue" />
      <a4j:support eventsQueue="my.events.queue" event="onclick"
      action="#{editAccountInfoBean.assignSelected}"
      ajaxSingle="true">
      <f:setPropertyActionListener value="#{row}"
      target="#{editAccountInfoBean.currentRow}" />
        </a4j:support>
        </h:selectOneRadio>
        <h:selectBooleanCheckbox id="selectedField2"
      value="#{editAccountInfoBean.selectedMobileNo}" style="font-size:10px;">
      <a4j:support eventsQueue="my.events.queue" event="onclick"
      action="#{editAccountInfoBean.assignSelected}"
      ajaxSingle="true">
      <f:setPropertyActionListener value="#{row}"
      target="#{editAccountInfoBean.currentRow}" />
        </a4j:support>
      </h:selectBooleanCheckbox>
      </rich:column>

        • 1. Re: How to display the h:selectOneRadio in the jsp page???
          Ilya Shaikovsky Master

          Not sure that get the

          I just want to display only the radio button only in the screen???
          maybe provide picture for desired behvior?

          • 2. Re: How to display the h:selectOneRadio in the jsp page???
            Siva P Master

            Thanks for your reply liya.Radio button is not displaying in the datatable.But check box is displaying properly.

             

            <rich:column>
            <h:selectOneRadio id="selectedField" layout="pageDirection"
            value="#{editAccountInfoBean.selectedMobileNo}" style="font-size:10px;">
            <a4j:support eventsQueue="my.events.queue" event="onclick"
            action="#{editAccountInfoBean.assignSelected}"
            ajaxSingle="true">
            <f:selectItem itemValue="null"/>
            <f:setPropertyActionListener value="#{row}"
            target="#{editAccountInfoBean.currentRow}" />
              </a4j:support>
              </h:selectOneRadio>
              <h:selectBooleanCheckbox id="selectedField2"
            value="#{editAccountInfoBean.selectedMobileNo}" style="font-size:10px;">
            <a4j:support eventsQueue="my.events.queue" event="onclick"
            action="#{editAccountInfoBean.assignSelected}"
            ajaxSingle="true">
            <f:setPropertyActionListener value="#{row}"
            target="#{editAccountInfoBean.currentRow}" />
              </a4j:support>
            </h:selectBooleanCheckbox>
            </rich:column>

            <rich:column>

            <h:selectOneRadio id="selectedField" layout="pageDirection"

            value="#{editAccountInfoBean.selectedMobileNo}" style="font-size:10px;">

            <a4j:support eventsQueue="my.events.queue" event="onclick"

            action="#{editAccountInfoBean.assignSelected}"

            ajaxSingle="true">

            <f:selectItem itemValue="null"/>

            <f:setPropertyActionListener value="#{row}"

            target="#{editAccountInfoBean.currentRow}" />

               </a4j:support>

               </h:selectOneRadio>

               <h:selectBooleanCheckbox id="selectedField2"

            value="#{editAccountInfoBean.selectedMobileNo}" style="font-size:10px;">

            <a4j:support eventsQueue="my.events.queue" event="onclick"

            action="#{editAccountInfoBean.assignSelected}"

            ajaxSingle="true">

            <f:setPropertyActionListener value="#{row}"

            target="#{editAccountInfoBean.currentRow}" />

               </a4j:support>

            </h:selectBooleanCheckbox>

            </rich:column>

             

             

            ErrorRadio.JPG

             

            Why it is not visible in the screen???

            • 3. Re: How to display the h:selectOneRadio in the jsp page???
              Siva P Master

              I have  fixed the problem by below code.....

               

              <a4j:outputPanel>

              <h:selectOneRadio id="selectedField" layout="pageDirection"

              value="#{editAccountInfoBean.selectedMobileNo}" style="font-size:10px;">

              <f:selectItem itemValue="null"/>

              <a4j:support eventsQueue="my.events.queue" event="onclick"

              action="#{editAccountInfoBean.assignSelected}"

              ajaxSingle="true">

              <f:selectItem itemValue="null"/>

              <f:setPropertyActionListener value="#{row}"

              target="#{editAccountInfoBean.currentRow}" />

                 </a4j:support>

                 </h:selectOneRadio>

              </a4j:outputPanel>

               

               

              <a4j:outputPanel>
              <h:selectOneRadio id="selectedField" layout="pageDirection"
              value="#{editAccountInfoBean.selectedMobileNo}" style="font-size:10px;">
              <f:selectItem itemValue="null"/>
              <a4j:support eventsQueue="my.events.queue" event="onclick"
              action="#{editAccountInfoBean.assignSelected}"
              ajaxSingle="true">
              <f:selectItem itemValue="null"/>
              <f:setPropertyActionListener value="#{row}"
              target="#{editAccountInfoBean.currentRow}" />
                 </a4j:support>
                 </h:selectOneRadio>
                 </a4j:outputPanel><a4j:outputPanel>
              <h:selectOneRadio id="selectedField" layout="pageDirection"
              value="#{editAccountInfoBean.selectedMobileNo}" style="font-size:10px;">
              <f:selectItem itemValue="null"/>
              <a4j:support eventsQueue="my.events.queue" event="onclick"
              action="#{editAccountInfoBean.assignSelected}"
              ajaxSingle="true">
              <f:selectItem itemValue="null"/>
              <f:setPropertyActionListener value="#{row}"
              target="#{editAccountInfoBean.currentRow}" />
                 </a4j:support>
                 </h:selectOneRadio>
                 </a4j:outputPanel> <a4j:outputPanel>
              <h:selectOneRadio id="selectedField" layout="pageDirection"
              value="#{editAccountInfoBean.selectedMobileNo}" style="font-size:10px;">
              <f:selectItem itemValue="null"/>
              <a4j:support eventsQueue="my.events.queue" event="onclick"
              action="#{editAccountInfoBean.assignSelected}"
              ajaxSingle="true">
              <f:selectItem itemValue="null"/>
              <f:setPropertyActionListener value="#{row}"
              target="#{editAccountInfoBean.currentRow}" />
                </a4j:support>
                </h:selectOneRadio>
                </a4j:outputPanel>