8 Replies Latest reply: Jan 22, 2013 6:51 AM by ILya Cyclone RSS

    Can I show af:region in af:iterator?

    ILya Cyclone
      I'm trying to show an af:region (bounded taskflow) in af:iterator but it just doesn't show up.
      And it seems to me that the reason in af:iterator as soon as it works normally outside.

      I wanted a bounded taskflow to take an input parameter from the iterator row. But I just can't see the region in the iterator.

      Is it possible?

      ADF 11R2
        • 1. Re: Can I show af:region in af:iterator?
          Arunkumar Ramamoorthy-Oracle

          Your usecase doesn't look like a valid one (atleast to me). Can you elaborate?

          Iterator is used for looping. You mean to show that many regions in your page?

          • 2. Re: Can I show af:region in af:iterator?
            Frank Nimphius-Oracle

            in 11g R2 there us a special binding for this, which is the multi region binding. Stamping of af:region in 11g R1 ia not supported


            • 3. Re: Can I show af:region in af:iterator?
              ILya Cyclone
              I have a list of events and use an af:iterator to show the list on the page.
              One of event's attribute has a complicated edit component (an output form, a popup with list of values table+search and some methods). This component is also used in another application parts.

              So I'm trying to create a reusable thing to work with this attribute - a bounded taskflow with a fragment.
              This taskflow worked fine when I was placing it statically (for one event, without af:iterator). But now I'm trying to use it in a list - under af:iterator. And it just doesn't show up.
              <af:outputText value="Event #{bindings.Name.inputValue}" id="ot1"/> // ok
              <af:region value="#{bindings.olympiadplacetfd1.regionModel}" id="r1"/> // ok
              <af:iterator value=... var="row">
                <af:outputText value="Event #{row.Name}" id="ot2"/> // ok
                <af:region value="#{bindings.olympiadplacetfd2.regionModel}" id="r2"/> // not rendered
                // region taskflow should have #{row.IdSmth} as input parameter
              • 4. Re: Can I show af:region in af:iterator?
                ILya Cyclone
                Hello Frank,
                Thanks for your attention.
                Trying to implement the solution you pointed.
                Somehow I can't reach an iterator in getTaskFlowBindings java code:
                public List<TaskFlowBindingAttributes> getTaskFlowBindings() {
                        System.out.println("=== getTaskFlowBindings ===");
                        List<TaskFlowBindingAttributes> taskFlowBindings = new ArrayList<TaskFlowBindingAttributes>();
                        // javax.el.ELException: java.lang.RuntimeException: Iterator 'OlympiadRoundsView1Iterator' not found
                        DCIteratorBinding iter = ADFUtils.findIterator("OlympiadRoundsView1Iterator"); 
                        Row[] rows = iter.getAllRowsInRange();
                        for(Row row : rows) {
                            TaskFlowBindingAttributes taskFlowBindingAttributes = new TaskFlowBindingAttributes();
                            taskFlowBindingAttributes.setId("region" + (id++));
                            taskFlowBindingAttributes.setTaskFlowId(new TaskFlowId("/WEB-INF/olympiad-place-tfd.xml", "olympiad-place-tfd"+id));
                            // row.get
                //            taskFlowBindingAttributes.setParametersMap(contxt.getParamMap());
                        return taskFlowBindings;
                Here's a page definition:
                <?xml version="1.0" encoding="UTF-8" ?>
                <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="" id="dummyPageDef"
                    <variableIterator id="variables"/>
                    <iterator Binds="OlympiadRoundsView1" RangeSize="25" DataControl="ExtramuralTestingServiceDataControl"
                    <multiTaskFlow id="mt1" taskFlowList="#{pageFlowScope.olympiadPlaceBean1.taskFlowBindings}" xmlns="http://xmlns.oracle.com/adf/controller/binding"
                    <tree IterBinding="OlympiadRoundsView1Iterator" id="OlympiadRoundsView1">
                      <nodeDefinition DefName="ru.miit.olympiad.extest.model.view.OlympiadRoundsView" Name="OlympiadRoundsView10">
                          <Item Value="IdWebUser"/>
                • 5. Re: Can I show af:region in af:iterator?
                  Frank Nimphius-Oracle

                  odd. However, I am usually not using util classes, so can you try

                    BindingContext bctx = BindingContext.getCurrrent();
                    BindingConteainer bindings = bctx.getCurrentBindingsEntry();
                    DCIteraorBinding iter = (DCIteratorBinding) bindings.get("OlympiadRoundsView1Iterator");
                  If the iterator exists for the view that contains the region iteration then this should work (note that this is the same PageDef file then that contains the multi task flow binding

                  • 6. Re: Can I show af:region in af:iterator?
                    ILya Cyclone
                    Without ADFUtils the result is the same:
                    BindingContext bctx = BindingContext.getCurrent();
                    BindingContainer bindings = bctx.getCurrentBindingsEntry();
                    DCIteratorBinding iter = (DCIteratorBinding) bindings. get("OlympiadRoundsView1Iterator");
                    System.out.println("iter = "+iter); // -> null
                    I copied the pagedefinition code in the previous post. Everything is on the same page.

                    Well, I'm able to walkaround this issue preparing the rows in the prevoius taskflow method call activity (before entering the page) and store it in a pageFlowScope. This thing works, but it wastes memory and messes the code.

                    Why can't I reach the iterator?
                    • 7. Re: Can I show af:region in af:iterator?
                      Frank Nimphius-Oracle

                      do you call the code in the context of the view which PageDef has the "OlympiadRoundsView1Iterator" defined? Make sure in that you temporarily add a table to the view (you can delete it later).

                      • 8. Re: Can I show af:region in af:iterator?
                        ILya Cyclone
                        There is actually a table, Frank. Just for that purpose.

                        The method is called by multiregion definition itself. I'm not calling it explicitly.
                        And as you can see in a pagedef code, the multiregion and the iterator definition are on the same page.

                        Any news?

                        Edited by: ILya Cyclone on Jan 22, 2013 3:51 PM