4 Replies Latest reply: Feb 12, 2014 10:28 AM by rade.todorovich RSS

ADF table date range search results

rade.todorovich Explorer
Currently Being Moderated

JDeveloper 12.1.2

 

Did anyone tried to build date range search in 12c based on Frank's paper?

 

I have tried to 'migrate'  http://www.oracle.com/technetwork/developer-tools/adf/learnmore/59-table-filter-by-data-range-176653.pdf

into JDev 12c but could not get it to run. Basically page displays table with data but when date range is entered and page is submitted nothing happens.

 

Then manually built entire project from scratch, but page came up with no data in table.

 

I do not see any error message in either case and am wondering if someone tried to build this example in 12c?

  • 1. Re: ADF table date range search results
    Cvele_new_account Expert
    Currently Being Moderated

    Well, some time ago, I developed very similar to Frank's solution for this problem.

    The only difference is in fact, that I am,  in order to set VC bind variables, accessing ViewObject directly from backing bean (instead of using OperationBinding, as Frank does, and how should to be)

     

    Not tried my code under 12c, however, here is:

     

      public void processQuery(QueryEvent ev){
         FilterableQueryDescriptor filterQD = (FilterableQueryDescriptor)getMyTable().getFilterModel();   
         Map filterCrit = filterQD.getFilterCriteria();
         Object dateFromCrit = filterCrit.get("DateFrom");
         Object dateToCritCrit = filterCrit.get("DateTo");
         if (dateFromCrit != null && dateToCrit != null){
             filterCrit.remove("DateFrom");
             filterCrit.remove("DateTo");
             DCIteratorBinding iterIB = MyADFUtils.findIterator("MyVOIterator");
             ViewObjectImpl ttVO =  (ViewObjectImpl)iterIB.getViewObject();
             ViewCriteria vc = ttVO.getViewCriteria("My_Criteria");
             VariableValueManager vvm_vc = vc.ensureVariableManager();       
             vvm_vc.setVariableValue("p_datum_od",dateFromCrit);       
             vvm_vc.setVariableValue("p_datum_do",dateToCrit);       
             ttVO.setApplyViewCriteriaNames(new String[]{"My_Criteria"});       
             JSFUtils.resloveMethodExpression("#{bindings.xxx.processQuery}", null, new Class[] {QueryEvent.class}, new Object[]{ev});       
             ttVO.removeApplyViewCriteriaName("My_Criteria");
             filterCrit.put("DateFrom", dateFromCrit);
             filterCrit.put("DateTo", dateToCrit);
             AdfFacesContext.getCurrentInstance().addPartialTarget(getMyTable());                         
         } else
             JSFUtils.resloveMethodExpression("#{bindings.xxx.processQuery}", null, new Class[] {QueryEvent.class}, new Object[]{ev});
      }  
    
  • 2. Re: ADF table date range search results
    rade.todorovich Explorer
    Currently Being Moderated

    Cvele, tried that as well, and page opens with empty table. When I remove VC page displays full table.

    In 12c when there seem to be 2 place where bind variables can be defined. In VO, under Query and under View Criteria. When I migrated Frank's example to 12c, those bind variables somehow were added under both 'sections' Looked at xml code and could not spot a difference.

    I am going to debug now but it would be helpful to have working example

  • 3. Re: ADF table date range search results
    Cvele_new_account Expert
    Currently Being Moderated

    Rade,

     

    That's way I am not using 12c at all.

    Simply, have no time to play with such one and similar issues.

    All this works without problems in 11g.

    Will take a look at 12c next year at the same time...or maybe in the 2016 ;-)


  • 4. Re: ADF table date range search results
    rade.todorovich Explorer
    Currently Being Moderated

    OK I was able to find the problem. Seems that GenerateIsNullClauseForBindVars is set to false in for the bind variables. I found this:

    My experience with 12c

    and then https://java.net/jira/browse/ADFEMG-159

    Seems bug but I did not have time to look into it in details. Changed the value to true and now my table shows data when page is rendered.

     

    However, now I have other problem which is that when setting the date range in filter, and submitting the page, nothing happens (not even an error). I do see that code in the bean executes though. Now getting back to more debugging.

     

    Yes Cvele, although I am not ADF expert, unfortunately my daily duties command that I have to port certain apps to new platforms. It seems that JDev is never fully completed product. I would always expect to see that new version brings new features but do not touch anything that previously worked fine.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points