Forum Stats

  • 3,826,665 Users
  • 2,260,687 Discussions
  • 7,897,044 Comments

Discussions

How do I count rows in view where a given attribute has a specific value?

DrHoneybear
DrHoneybear Member Posts: 37 Green Ribbon
edited May 19, 2022 9:41AM in JDeveloper and ADF

Using JDeveloper 12.2.1.3 + JDK 8u131 and an ADF application ...

I have a view instance 'LoomIsses_View1LoomIssAssies_View1' and I display (rendered) only those rows where 'ChildLoomFunctionCodes_Code' is not 'RW'. However, when there are no rows the panel box is still shown (unless there are zero rows at all). How can I occult the panel box if there are no rows displayed.


JSPX:-

    <tr:panelBox text="#{loomconf['viewloomdetails.assemblyChildren']}" inlineStyle="width:100%"
                     rendered="#{bindings['LoomIsses_View1LoomIssAssies_View1'].estimatedRowCount > 0}">
                <tr:table value="#{bindings['LoomIsses_View1LoomIssAssies_View1'].collectionModel}"
                     var="row" rows="#{bindings['LoomIsses_View1LoomIssAssies_View1'].rangeSize}"
                     first="#{bindings['LoomIsses_View1LoomIssAssies_View1'].rangeStart}"
                     emptyText="#{bindings['LoomIsses_View1LoomIssAssies_View1'].viewable ? 'No rows yet.' : 'Access Denied.'}"
                     width="100%">
                  <tr:column sortProperty="Status" sortable="false"
                        rendered="#{row['ChildLoomFunctionCodes_Code'] != 'RW'}"
                        headerText="#{bindings['LoomIsses_View1LoomIssAssies_View1'].labels.Status}">
                    <tr:image source="#{row.Status == '+' ? '/images/added.gif' : row.Status == '.' ? '/images/retained.gif' : row.Status == '*' ? '/images/changed.gif' : '/images/deleted.gif'}"
                         shortDesc="#{row.Status == '+' ? 'Added' : row.Status == '.' ? 'Retained' : row.Status == '*' ? 'Changed' : 'Deleted'}"/>
                  </tr:column>
                  <tr:column sortProperty="ChildLoom_Pid" sortable="false"
                        rendered="#{row['ChildLoomFunctionCodes_Code'] != 'RW'}"
                        headerText="#{bindings['LoomIsses_View1LoomIssAssies_View1'].labels['ChildLoom_Pid']}">
                    <tr:outputText value="#{row['ChildLoom_Pid']}"/>
                  </tr:column>
                  <tr:column sortProperty="ChildLoom_Name" sortable="false"
                        rendered="#{row['ChildLoomFunctionCodes_Code'] != 'RW'}"
                        headerText="#{bindings['LoomIsses_View1LoomIssAssies_View1'].labels['ChildLoom_Name']}">
                    <tr:outputText value="#{row['ChildLoom_Name']}"/>
                  </tr:column>
                  <tr:column sortProperty="ChildLoomIss_Issue" sortable="false"
                        rendered="#{row['ChildLoomFunctionCodes_Code'] != 'RW'}"
                        headerText="#{bindings['LoomIsses_View1LoomIssAssies_View1'].labels['ChildLoomIss_Issue']}">
                    <tr:outputText value="#{row['ChildLoomIss_Issue']}"/>
                  </tr:column>
                  <tr:column sortProperty="ChildLoomIss_IssueDate" sortable="false"
                        rendered="#{row['ChildLoomFunctionCodes_Code'] != 'RW'}"
                        headerText="#{bindings['LoomIsses_View1LoomIssAssies_View1'].labels['ChildLoomIss_IssueDate']}">
                    <tr:outputText value="#{row['ChildLoomIss_IssueDate']}">
                      <f:convertDateTime pattern="#{bindings['LoomIsses_View1LoomIssAssies_View1'].formats['ChildLoomIss_IssueDate']}"/>
                    </tr:outputText>
                  </tr:column>
                </tr:table>
              </tr:panelBox>

Best Answer

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,458 Red Diamond

    No, nothing simple you can do inside the JSPX or EL. Keep in mind, that the page doesn't necessarily see all data available. VO is the best place.


    Timo

Answers