3 Replies Latest reply: Nov 24, 2012 7:48 AM by Alejandro Profet RSS

    Repeating data controls

    FonzDesselle
      Hello,

      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
          user404
          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"
                                Name="DepartmentsView10">
                  <AttrNames>
                    <Item Value="DepartmentId"/>
                    <Item Value="DepartmentName"/>
                  </AttrNames>
                </nodeDefinition>
              </tree>
              2. Reuse that tree on each af:selectOneChoice in the page view:
              <af:selectOneChoice value="#{bindings.DepartmentId.inputValue}"
                                  label="#{bindings.DepartmentId.label}"
                                  required="#{bindings.DepartmentId.hints.mandatory}"
                                  shortDesc="#{bindings.DepartmentId.hints.tooltip}"
                                  id="soc10">
                <af:forEach var="item" items="#{bindings.DepartmentsView1.rangeSet}">
                  <f:selectItem itemValue="#{item.DepartmentId}"
                                itemLabel="#{item.DepartmentName}"
                                id="si1"/>
                </af:forEach>
              </af:selectOneChoice>
              Check this Frank's article, he explains this better: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/98-multi-select-tablefilter-1534904.pdf

              AP