6 Replies Latest reply: Nov 22, 2012 7:13 AM by ILya Cyclone RSS

    Standard table filter weird work

    ILya Cyclone
      Hello,
      I have a complex View Object - based on entityes with some calculated SQL fields and subquery in a query.
      It is exposed through a table on a page. Everything works fine except standard table filter.

      Take a look. Filtering a column having "JavaScript" string value. The column is based on an entity attribute.

      1. No Filter - 9 "JavaScript" rows
      http://img94.imageshack.us/img94/6105/mrpfl.jpg

      2. \*j\* filter - 8 rows
      http://img706.imageshack.us/img706/5677/mrod.jpg

      3. j* filter - 6 rows
      http://img827.imageshack.us/img827/5870/mrol.jpg

      4. JavaScript filter - 0 rows
      http://img708.imageshack.us/img708/8405/mrp2v.jpg

      I've tested the same filters in SQL - each returns all 9 rows so that is definitely ADF behavior and no SQL error.
      Nothing special about the table or the attribute.
      Column:
      <af:column sortProperty="KindContentName" filterable="true" sortable="true"
       headerText="#{bindings.ContentComplexView1.hints.KindContentName.label}" id="c21" width="200"
       noWrap="false" filterFeatures="caseInsensitive">
                                                                              <af:outputText value="#{row.KindContentName}" id="ot20"/>
                                                                          </af:column>
      VO attribute:
      <ViewAttribute
          Name="KindContentName"
          PrecisionRule="true"
          AliasName="NAME"
          EntityAttrName="Name"
          EntityUsage="KindContent"/>
      EO attribute
      <Attribute
          Name="Name"
          IsNotNull="true"
          Precision="255"
          ColumnName="NAME"
          SQLType="VARCHAR"
          Type="java.lang.String"
          ColumnType="VARCHAR2"
          TableName="KIND_CONTENT_WP">
          <DesignTime>
            <Attr Name="_DisplaySize" Value="255"/>
          </DesignTime>
          <Properties>
            <SchemaBasedProperties>
              <LABEL
                ResId="ru.miit.cms.model.entity.KindContent.Name_LABEL"/>
            </SchemaBasedProperties>
          </Properties>
        </Attribute>
      So how can that be?

      ADF 11.1.2.2
        • 1. Re: Standard table filter weird work
          Timo Hahn
          Have you run the app with -Djbo.debugoutput=console so that you see the query send to the server?

          Timo
          • 2. Re: Standard table filter weird work
            ILya Cyclone
            Surprisingly I can see no SQL in console with this key.
            I'm running JDev 11.1.2.2 with standalone WLS 10.3.6 on the same machine added as Integrated Server - I can see all the server output in JDev console, but no SQL.
            I added "-Djbo.debugoutput=console" as project run option and server start argument through WLS console as well.
            Do I need to take some additional steps to see executed queries?

            Thanks.
            • 3. Re: Standard table filter weird work
              user404
              If you can't get it working normally I suggest to use this:
              http://huysmansitt.blogspot.be/2012/09/adf-table-filters-case-insensitive-and.html
              It's very useful and works perfectly.
              • 4. Re: Standard table filter weird work
                ILya Cyclone
                I don't need ADF to implement functionality programmatically. This thing must work declaratively.
                • 5. Re: Standard table filter weird work
                  Alejandro Profet
                  Hi,

                  This Duncan's article should help to find the sql query: https://blogs.oracle.com/groundside/entry/adventures_in_adf_logging_part4

                  AP
                  • 6. Re: Standard table filter weird work
                    ILya Cyclone
                    I've added "-Djbo.debugoutput=console" as project run option and server start argument through WLS console (I see this argument in IDE console when the server is starting), set adf, adf.internal and adf.jbo loggers to TRACE:32 in logging.xml, restarted the server dozen times, debug the page but still there is no SQL in IDE console - somebody tell me why???

                    Ok, I've found the query in server logs in file system. That I see is wonderful.

                    I have a query like:
                    SELECT KIND_CONTENT.NAME AS KIND_CONTENT_NAME,
                    CONTENT.NAME,
                    ...
                    I apply filter to KindContentName column and the resulting SQL with filter is:
                    SELECT * FROM (SELECT KIND_CONTENT.NAME AS KIND_CONTENT_NAME,
                    CONTENT.NAME,
                    ...
                    ) QRSLT WHERE NAME LIKE ...
                    ADF is applying WHERE clause to the wrong attribute!

                    -----

                    Even more fun here. In the View Object overview I notice that KindContentName attribute's Alias property = "NAME" and that seems to be the problem reason. I type "KIND_CONTENT_NAME" instead, Ctrl+S, close the VO, reopen it and see that KindContentName attribute's Alias property still = "NAME".
                    Changing Alias property from overview do not affect source code.
                    Great.

                    Changing ALIAS property in XML source solved this issue.

                    Edited by: ILya Cyclone on Nov 22, 2012 4:12 PM