3 Replies Latest reply: Aug 31, 2011 11:34 PM by 673424 RSS

    Query Component Issue

    673424
      Hi,

      I am using JDeveloper Build 11.1.2.0.0.

      I have got a problem when using query component (query panel) based on a view criteria. The view criteria has defined a criteria item which binds to a binding variable as below.

      binding variable definition:

      Name: employeeName
      Type: String
      Value: adf.context.pageFlowScope.employeeName (Value type: Expresion)

      view criteria item which binds to the above binding variable:

      SEmployeeViewCriteria:
      ()Group:
      EmployeeName CONTAINS :employeeName

      UI layer has 2 pages A and B. There is a form on page A, when submitted, the button action listener will set the pageFlowScope variable employeeName to the user input (say 'emp1') code as below,

      String empName = *** (User input value in form)
      AdfFacesContext.getCurrentInstance().getPageFlowScope().put("employeeName", empName);

      and then page will navigate to B, page B has a query component based on the view criteria defined as above. Since the view criteria item EmployeeName's value is defined to be the binding variable employeeName, on page B the EmployeeName inputText field will automatically show value 'emp1' got from the pageFlowScope variable.

      Now the problem is, the first time the employeeName value passes correctly and on page B the value 'emp1' does show in the EmployeeName inputText field on page B, however, after I manually input some value (say 'ABC') in the query component EmployeeName inputText field on Page B and click search button then I go back to page A and submit another employeeName (say 'emp2') and navigate, now on Page B the query component EmployeeName inputText field will not show 'emp2' any more, instead it shows 'ABC' and the value doesn't change any more between A and B navigation accordingly.

      My concern is after manually inputing value in the query component on page B, seems it doesn't read from the binding variable (here is a pageFlowScope value) any more. Is there any way that can make the query component criteria item always read from binding variable during A navigates to B? Any idea about how to solve this problem?

      Thanks a lot!

      Edited by: user774592 on Aug 30, 2011 10:36 PM
        • 1. Re: Query Component Issue
          673424
          Can anyone help on above issue, any ideas can be shared?

          Thanks,
          Ricky
          • 2. Re: Query Component Issue
            Suresh Karunarathne
            Hi..
            ->criteria item always read from binding variable during A navigates to B? Any idea about how to solve this problem
            No, you can pass the values for viewcriteria

            see following sample execute view criteria manually hope you will helpful
            Oracle ADF - Create View Criteria and Execute using Bean.
            http://adf-lk.blogspot.com/2011/05/oracle-adf-create-view-criteria-and_4727.html
            • 3. Re: Query Component Issue
              673424
              Hi there,

              Thanks for the link. It is helpful to understand the vo execution with viewCriteria and binding variables. But it still can not solve my problem.

              I want to know what decides the query component criteria item field value shows on the UI. I can write backing bean code to pass in user input value, set binding variable value and invoke the viewCriteria execution, these can be done correctly. However, after it is done and page A navigates to B, the input value doesn't show on the criteria item field on UI thought I have seen the result list table has shown the correct filterred records. (As mentioned in my privious post, the first time the value can show on B, but when input criteria item field manually on B and navigate back to A and input a value on A again then navigate to B, the input value on A can not show on B automatically, instead it always be the value you input on B manully last time.)

              Any idea on this?

              Thanks
              Ricky