Wed. Aug 4th, 2021

Requirement: Whenever we apply a table filter in the Oracle ADF Table, it will perform case insensitive wild search operation. But, there might be several cases when we want to perform case sensitive wild search operation.

Hence, in this post I will show you how we can do case case sensitive wild search operation using table filter.

Solution: For solution of the above requirement follow the steps as shown below:

Step 1: Create an Oracle ADF Fusion Web Application.

Create a Business Components from Tables for the Departments table of the HR Schema of the Oracle Database 11g XE Edition.

Step 2: Create a demo.jspx page. Drag and drop DepartmentVO1 from the Data Control palette on the demo.jspx page as an ADF Table.

Set the filterFeatures=”caseSensitive” for the DepartmentName column.

Thus, the complete code for demo.jspx is shown below:

<?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="demo.jspx" id="d1">
            <af:messages id="m1"/>
            <af:form id="f1">
                <af:table value="#{bindings.DepartmentsVO1.collectionModel}" var="row"
                          rows="#{bindings.DepartmentsVO1.rangeSize}"
                          emptyText="#{bindings.DepartmentsVO1.viewable ? 'No data to display.' : 'Access Denied.'}"
                          rowBandingInterval="0"
                          selectedRowKeys="#{bindings.DepartmentsVO1.collectionModel.selectedRow}"
                          selectionListener="#{bindings.DepartmentsVO1.collectionModel.makeCurrent}"
                          rowSelection="single" fetchSize="#{bindings.DepartmentsVO1.rangeSize}"
                          filterModel="#{bindings.DepartmentsVO1Query.queryDescriptor}" filterVisible="true"
                          queryListener="#{bindings.DepartmentsVO1Query.processQuery}" varStatus="vs" id="t1">
                    <af:column sortProperty="#{bindings.DepartmentsVO1.hints.DepartmentId.name}" filterable="true"
                               sortable="true" headerText="#{bindings.DepartmentsVO1.hints.DepartmentId.label}" id="c1">
                        <af:outputText value="#{row.DepartmentId}"
                                       shortDesc="#{bindings.DepartmentsVO1.hints.DepartmentId.tooltip}" id="ot1">
                            <af:convertNumber groupingUsed="false"
                                              pattern="#{bindings.DepartmentsVO1.hints.DepartmentId.format}"/>
                        </af:outputText>
                    </af:column>
                    <af:column sortProperty="#{bindings.DepartmentsVO1.hints.DepartmentName.name}" filterable="true"
                               sortable="true" headerText="#{bindings.DepartmentsVO1.hints.DepartmentName.label}"
                               id="c2" filterFeatures="caseSensitive">
                        <af:outputText value="#{row.DepartmentName}"
                                       shortDesc="#{bindings.DepartmentsVO1.hints.DepartmentName.tooltip}" id="ot2"/>
                    </af:column>
                    <af:column sortProperty="#{bindings.DepartmentsVO1.hints.ManagerId.name}" filterable="true"
                               sortable="true" headerText="#{bindings.DepartmentsVO1.hints.ManagerId.label}" id="c3">
                        <af:outputText value="#{row.ManagerId}"
                                       shortDesc="#{bindings.DepartmentsVO1.hints.ManagerId.tooltip}" id="ot3">
                            <af:convertNumber groupingUsed="false"
                                              pattern="#{bindings.DepartmentsVO1.hints.ManagerId.format}"/>
                        </af:outputText>
                    </af:column>
                    <af:column sortProperty="#{bindings.DepartmentsVO1.hints.LocationId.name}" filterable="true"
                               sortable="true" headerText="#{bindings.DepartmentsVO1.hints.LocationId.label}" id="c4">
                        <af:outputText value="#{row.LocationId}"
                                       shortDesc="#{bindings.DepartmentsVO1.hints.LocationId.tooltip}" id="ot4">
                            <af:convertNumber groupingUsed="false"
                                              pattern="#{bindings.DepartmentsVO1.hints.LocationId.format}"/>
                        </af:outputText>
                    </af:column>
                </af:table>
            </af:form>
        </af:document>
    </f:view>
</jsp:root>

Save all and run the application. Thus, the ran application is shown below:

Give the DepartmentName value as Administration and hit the enter key. Thus, we can see the below result.

Give the DepartmentName value as administration and hit the enter key. Thus, we can see any record, which means it is now not able to perform case insensitive search operations.

Hence, the solution to our requirement.

If you like the post please comment, share, and do join me on Facebook. Please subscribe to my YouTube Channel for video tutorials.

Thanks & Regards,
Susanto Paul

 280 total views,  2 views today

By Susanto Paul

Susanto is an Oracle ACE, a qualified MCA, MBA, and a highly-skilled Senior Oracle Specialist. He is an enthusiastic Blogger and YouTuber who helps learners to solve their complex problems more efficiently. He has 9+ years of experience in multiple technologies like AWS, Oracle ADF, Oracle APEX, Oracle JET, Oracle VBCS, Oracle IDCS, Oracle PL/SQL, Oracle Integration Cloud, Java, JDBC, Servlets, JSP, Spring, Hibernate, HTML5, CSS3, JavaScript, TypeScript, NodesJS, Angular, MySQL, Oracle WebLogic Server, JUnit, JMeter, Selenium Web Driver, etc. He is a certified: Oracle Certified Professional Java SE 6 Programmer, Oracle ADF 11g Certified Implementation Specialist, Oracle Cloud Platform Application Integration 2020 Certified Specialist, Oracle Cloud Infrastructure Foundations 2020 Certified Associate, and Oracle Cloud Infrastructure Developer 2020 Certified Associate

Leave a Reply

Your email address will not be published. Required fields are marked *