6 Replies Latest reply on Apr 19, 2010 6:52 PM by gengwang

    Using RadioButtons as custom itemRenderer in Flex 4?

    gengwang

      Could anybody please give me some guide as to how I can use RadioButtons/RadioButtonGroup in a custom ItemRenderer?

       

      I have a whole bunch of choices (say, "Age 10-20", "Age 21-30", "Age 31-40", etc.) that I want to use as a DataProvider to generate a list of RadioButtons in the UI. I cann't figure it out how to get it done in Flex 4. The code below gets compiled without errors but doesn't display anything either:

       

      <fx:Declarations>
              <s:RadioButtonGroup id="group1" change="group1_changeHandler(event)"/>
          </fx:Declarations>

       

      <!--inside a custom component which is a child of s:VGroup-->

          <s:DataGroup dataProvider="{listDataProvider}">
              <s:itemRenderer>
                  <fx:Component>
                      <s:ItemRenderer>
                          <s:RadioButton label="data.@value" groupName="group1"/>
                      </s:ItemRenderer>
                  </fx:Component>
              </s:itemRenderer>
          </s:DataGroup>

       

      Thanks much.

       

      Geng