9 Replies Latest reply: Jul 14, 2012 2:46 AM by Sreekanth Vijay Karanam RSS

    Issue in rendering the columns of <dynamic:table> component

    Sreekanth Vijay Karanam
      Hi ,

      I am trying to display a dynamic table in the UI , for that I prepare a VO dynamically and use its Iterator in the <dynamic:table> . This will display all the attributes in the select query of the VO ,correct ?
      In my case, the table is created with columns corresponding to only one set of attributes in the select clause ,the other attributes are not shown up in the table ,Is there any property set on a View Attribute that determines the display of the attribute as a column in the dynamic table ( i have set the display hint property of all the attributes to "Display")?


      Thanks
      Sreekanth
        • 1. Re: Issue in rendering the columns of <dynamic:table> component
          Navaneetha Krishnan Nataraj
          I am trying to display a dynamic table in the UI , for that I prepare a VO dynamically and use its Iterator in the <dynamic:table> . This will display all the attributes in the select query of the VO ,correct ?
          Yes
          In my case, the table is created with columns corresponding to only one set of attributes in the select clause ,the other attributes are not shown up in the table ,Is there any property set on a View Attribute that determines the display of the attribute as a column in the dynamic table ( i have set the display hint property of all the attributes to "Display")?
          AFAIK, there is NO property in the view object.

          Thanks,
          Navaneeth
          • 2. Re: Issue in rendering the columns of <dynamic:table> component
            Navaneetha Krishnan Nataraj
            You can try this approach.

            When you drop a view object instance as an adf dynamic table, all the attributes are added to the binding in the page def.
            you can remove those attributes that you do not want to display.

            For example, if you are dropping a departments View object instance as a ADF dynamic table, it would create with all the attributes as below.

            TestPage.jspx:
            <?xml version='1.0' encoding='UTF-8'?>
            <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
                      xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
                <jsp:directive.page contentType="text/html;charset=UTF-8"/>
                <f:view>
                    <af:document title="TestPage.jspx" id="d1">
                        <af:messages id="m1"/>
                        <af:form id="f1">
                            <af:table rows="#{bindings.Departments.rangeSize}" fetchSize="#{bindings.Departments.rangeSize}"
                                      emptyText="#{bindings.Departments.viewable ? 'No data to display.' : 'Access Denied.'}"
                                      var="row" rowBandingInterval="0" value="#{bindings.Departments.collectionModel}"
                                      selectedRowKeys="#{bindings.Departments.collectionModel.selectedRow}"
                                      selectionListener="#{bindings.Departments.collectionModel.makeCurrent}" rowSelection="single"
                                      id="t1">
                                <af:forEach items="#{bindings.Departments.attributeDefs}" var="def">
                                    <af:column headerText="#{bindings.Departments.labels[def.name]}" sortable="true"
                                               sortProperty="#{def.name}" id="c1">
                                        <af:outputText value="#{row[def.name]}" id="ot1"/>
                                    </af:column>
                                </af:forEach>
                            </af:table>
                        </af:form>
                    </af:document>
                </f:view>
            </jsp:root>
            TestPagePageDef.xml:

            <?xml version="1.0" encoding="UTF-8" ?>
            <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="11.1.2.60.17" id="TestPagePageDef"
            Package="com.samples.view.pageDefs">
            <parameters/>
            <executables>
            <variableIterator id="variables"/>
            <iterator Binds="Departments" RangeSize="25" DataControl="HrAppModuleDataControl" id="DepartmentsIterator"/>
            </executables>
            <bindings>
            *<tree IterBinding="DepartmentsIterator" id="Departments">*
            *<nodeDefinition DefName="com.samples.model.DepartmentsVO" Name="Departments0">*
            *<AttrNames>*
            *<Item Value="DepartmentId"/>*
            *<Item Value="DepartmentName"/>*
            *<Item Value="ManagerId"/>*
            *<Item Value="LocationId"/>*
            *</AttrNames>*
            *</nodeDefinition>*
            *</tree>*
            </bindings>
            </pageDefinition>

            This would display all the attributes in the dynamic table.

            But if you remove the unwanted attributes in the tree binding( in the bold section), it will display only the attributes present there.

            <?xml version="1.0" encoding="UTF-8" ?>
            <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel" version="11.1.2.60.17" id="TestPagePageDef"
            Package="com.samples.view.pageDefs">
            <parameters/>
            <executables>
            <variableIterator id="variables"/>
            <iterator Binds="Departments" RangeSize="25" DataControl="HrAppModuleDataControl" id="DepartmentsIterator"/>
            </executables>
            <bindings>
            *<tree IterBinding="DepartmentsIterator" id="Departments">*
            *<nodeDefinition DefName="com.samples.model.DepartmentsVO" Name="Departments0">*
            *<AttrNames>*
            *<Item Value="DepartmentId"/>*
            *<Item Value="DepartmentName"/>*
            *</AttrNames>*
            *</nodeDefinition>*
            *</tree>*
            </bindings>
            </pageDefinition>

            Thanks,
            Navaneeth
            • 3. Re: Issue in rendering the columns of <dynamic:table> component
              vinod_t_krishnan
              yes as said above the item value that is added for the tree bindings will help you to choose which columns to show it in the UI.
              • 4. Re: Issue in rendering the columns of <dynamic:table> component
                Sreekanth Vijay Karanam
                HI Navneeth,

                I would require a ADF Dynamic Table that is updatable .. When I drag and drop the VO from the DataControl , the following is created

                <dynamic:table value="#{bindings.TestVO1Iterator}"
                id="t2"/>

                The issue is , if the TestVO1 has 10 attributes , only 4 of them are getting displayed (and they are editable) . I am not sure why the remaining 6 of them are not getting displayed.
                To summarize, I get only a 4 columned dynamic table instead of 10 columned dynamic table.

                I am preparing the VO dynamically , by adding the two Entity Usages and the attributes of only one Entity Usage are being displayed .

                Thanks
                Sreekanth
                • 5. Re: Issue in rendering the columns of <dynamic:table> component
                  vinod_t_krishnan
                  are both the entitis that are added to the VO editable?
                  • 7. Re: Issue in rendering the columns of <dynamic:table> component
                    Navaneetha Krishnan Nataraj
                    I tried a similar use-case, it works fine for me.

                    What happens if you drop as a normal table instead of dynamic table.
                    Are you able to see all the columns?

                    Thanks,
                    Navaneeth
                    • 8. Re: Issue in rendering the columns of <dynamic:table> component
                      vinod_t_krishnan
                      how is this working in AM tester. do u see all the attributes. can u try to follow these alternate approach and see how it renders..
                      https://cn.forums.oracle.com/forums/thread.jspa?threadID=2373695
                      • 9. Re: Issue in rendering the columns of <dynamic:table> component
                        Sreekanth Vijay Karanam
                        When i droy it as a ADF Read Only Dynamic Table, i see all the columns