Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

DrHoneybearMay 19 2022 — edited May 19 2022

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>
This post has been answered by Timo Hahn on May 19 2022
Jump to Answer

Comments

Post Details

Added on May 19 2022
7 comments
78 views