Forum Stats

  • 3,817,363 Users
  • 2,259,322 Discussions
  • 7,893,760 Comments

Discussions

Master-Master?!? relation

managed BEAN
managed BEAN Member Posts: 948 Silver Badge
edited Apr 19, 2018 6:01AM in JDeveloper and ADF

Hello,

Here i come again with a crazy/wild requirement .

I need to display a list inside a list to user in UI.

I have a service that returns a collection/list from DB (something like: select columnA, count(columnB) from table group by columnA) and inside it has another collection/list with all columnB data.

When i drag and drop the lists from DC into fragment/page it creates both iterators correct. If i use a SOC with partialtriger to nested iterator it works fine on 2nd SOC.

But i need to display everything. What i assume it´s happening (i just do not have the formal/documented explanation) is that the first iterator has a selectedRowKey, and the 2nd list displays the items for that child collection/list.

What i need is to 'undefine' that selectedRowKey (or some other thing).

I attach a simple app(12.2.1.2) where you can reproduce the issue i am facing.

First list has 3 items(some atributes and a list) and the nested list has from 1 to 3 items.

When you select an item from SOC the 2nd SOC is refreshed with new data (updated list) for that item (this is a typical master-detail), but if you see the iterators below it is also updating. I do not want that. I want first item showing it list, 2nd item showing it list and 3rd item showing it list simultaneously (everything), without the need for selectedRowKey(or whatever).

I don´t mind to have the solution directly from bindings/POJO, or any other way, or any other components.

Thanks for your time and help.

Regards,

Carlos

Tagged:

Best Answer

  • managed BEAN
    managed BEAN Member Posts: 948 Silver Badge
    edited Apr 19, 2018 6:01AM Answer ✓

    Hello,

    Got the solution.

    In bindings i need to set the tree binding with the child list:

    pastedImage_0.png

    And now on nested iterator i set its value to the nested list:

    <af:iterator id="i3" value="#{bindings.reportsAreaList.collectionModel}"

                                 var="rowReportArea" rows="#{bindings.reportsAreaList.rangeSize}"

                                 varStatus="vs">

    (...)

    <af:iterator id="i4" value="#{rowReportArea.reportsListByArea}"

                                                 var="rowReportList">

    And it is displaying fine.

    Regards,

    Carlos

Answers

  • Sankar-JV-Oracle
    Sankar-JV-Oracle Member Posts: 87
    edited Apr 13, 2018 1:58AM

    When the iterator has master-child relationship, it will continue to behave that way in UI.

    Expose the VOs directly in AM/DC and expose them directly on the UI. Basically, there will be two iterators at same level.

    By that, they will not be related.

  • managed BEAN
    managed BEAN Member Posts: 948 Silver Badge
    edited Apr 17, 2018 7:01AM

    Hello @Sankar-JV-Oracle,

    Thanks for response.

    There must be a 'co-relation' between them(by saying that i do not imply they have to be nested).

    The 2nd Collection/list method takes a parameter into ViewCriteria to filter results according to value from 1st Collection/list.

    i.e. the query is something like select * from table2 where columnX = :columnA;

    So for each row from 1st query i pass a column value as inputparameter into 2nd query to get those filtered results.

    So in UI i need to dynamically pass that value (row.someattributeValue) into bindings method action parameter of 2nd list to results be filtered properly.

    Did i explained well?

    If not here i add some more things.

    This is what i have in bindings(the 2 methods at same level):

    pastedImage_0.png

    and the page source code:

    <af:iterator id="areaIterator"             value="#{bindings.reports.collectionModel}" var="rowArea"             rows="#{bindings.reports.rangeSize}" varStatus="vs">    <af:panelStretchLayout id="areaPsl" endWidth="150px">        <f:facet name="top">        <af:outputText value="#{requestScope.catalog2Bean.clientId}" id="dummy" visible="false"                               clientComponent="true"                               binding="#{catalog2Bean.targetScrollOutputText}">                                                    </af:outputText>        </f:facet>        <f:facet name="center">            <af:panelGroupLayout id="pgl5" layout="horizontal">            <!--here i need to pass a parameter (#{rowArea.reportArea}) from 1st list to this method 2nd list and execute it for each row from 1st list-->                <af:iterator id="reportIterator"                             value="#{bindings.reportsAreaFiltered.collectionModel}"                             var="rowReport" varStatus="vs"                             rows="#{bindings.reportsAreaFiltered.rangeSize}">                    <af:panelGroupLayout id="reportParent" layout="vertical">                        <af:image id="reportThumbnail"                                  source="#{rowReport.reportImageUrl}"                                  inlineStyle="width: 50px; height: 75px;"/>                        <af:outputText value="#{rowReport.reportNameUser}"                                       id="ot7"/>                        <af:outputText value="url:#{rowReport.reportImageUrl}"                                       id="ot9"/>                        <af:outputText value="recid:#{rowReport.recid}" id="ot10"/>                        <af:outputText value="#{rowReport.reportImageUrl}#{rowReport.recid}"                                       id="ot11"/>                        <af:image id="reportThumbnail2"                                  source="/resources/images/no-image.png"                                  inlineStyle="width: 50px; height: 75px;"/>                    </af:panelGroupLayout>                </af:iterator>            </af:panelGroupLayout>        </f:facet>        <f:facet name="end">            <af:panelGridLayout id="pgl4">                <af:gridRow marginTop="5px" height="auto" id="gr2">                    <af:gridCell marginStart="5px" width="100%" marginEnd="5px"                                 id="gc2" halign="center">                        <af:outputText value="#{rowArea.groupCount}" id="ot4"/>                    </af:gridCell>                </af:gridRow>                <af:gridRow marginTop="5px" height="auto" marginBottom="5px"                            id="gr3">                    <af:gridCell marginStart="5px" width="100%" marginEnd="5px"                                 id="gc3" halign="center">                        <af:outputText value="#{rowArea.reportArea}" id="ot6"/>                    </af:gridCell>                </af:gridRow>            </af:panelGridLayout>        </f:facet>        <f:facet name="bottom">            <af:spacer width="10" height="10" id="s2"/>        </f:facet>    </af:panelStretchLayout></af:iterator>                        

    this is the bindings method code where i need to set the parameter (#{rowArea.reportArea} has commented in line 12 from above page source code) from 1st list :

    <methodAction id="getReportsTable" RequiresUpdateModel="true" Action="invokeMethod"                      MethodName="getReportsTable" IsViewObjectMethod="false" DataControl="ReportDC"                      InstanceName="bindings.getReportsTable.dataControl"                      ReturnName="data.ReportDC.methodResults.getReportsTable_getReportsTable_dataControl_getReportsTable_result">            <NamedData NDName="pReportArea" NDValue="" NDType="java.lang.String"/>        </methodAction>

    Hope now this is more detailed.

    Regards,

    Carlos

  • managed BEAN
    managed BEAN Member Posts: 948 Silver Badge
    edited Apr 19, 2018 6:01AM Answer ✓

    Hello,

    Got the solution.

    In bindings i need to set the tree binding with the child list:

    pastedImage_0.png

    And now on nested iterator i set its value to the nested list:

    <af:iterator id="i3" value="#{bindings.reportsAreaList.collectionModel}"

                                 var="rowReportArea" rows="#{bindings.reportsAreaList.rangeSize}"

                                 varStatus="vs">

    (...)

    <af:iterator id="i4" value="#{rowReportArea.reportsListByArea}"

                                                 var="rowReportList">

    And it is displaying fine.

    Regards,

    Carlos

This discussion has been closed.