3 Replies Latest reply on Nov 24, 2012 1:48 PM by Alejandro Profet

    Repeating data controls


      I have multiple select one choices on my page. I want to use the same data control over and over again to build these select one choices, but I don't want them all to change when I select a choice from of the select one choice boxes. Is there a way to use the same data control over and over again for a select one choice, but each box is mutually exclusive from the others, meaning they do not change value when I change one of the other repeating select one choices?
        • 1. Re: Repeating data controls
          You will need different VO's if you want them to be independent.
          • 2. Re: Repeating data controls
            Sudipto Desmukh
            You can also use separate view instances of the same view object.
            • 3. Re: Repeating data controls
              Alejandro Profet
              Hi Fonzie,

              The above approaches are valid, but more expensive, I prefer create a unique VO instance and reuse its items on each af:selectOneChoice:

              1. Create a tree/iterator in the page definition (in this case I use DepartmentsView, in your case should be the VO who has the values to show in af:selectOneChoice components):
              <iterator Binds="DepartmentsView1" RangeSize="-1"
                        DataControl="AppModuleDataControl" id="DepartmentsView1Iterator"/>
              <tree IterBinding="DepartmentsView1Iterator" id="DepartmentsView1">
                <nodeDefinition DefName="model.DepartmentsView"
                    <Item Value="DepartmentId"/>
                    <Item Value="DepartmentName"/>
              2. Reuse that tree on each af:selectOneChoice in the page view:
              <af:selectOneChoice value="#{bindings.DepartmentId.inputValue}"
                <af:forEach var="item" items="#{bindings.DepartmentsView1.rangeSet}">
                  <f:selectItem itemValue="#{item.DepartmentId}"
              Check this Frank's article, he explains this better: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/98-multi-select-tablefilter-1534904.pdf