Using view criteria.

Hi. I'm new to adf and my english is poor so be patient with me, thanks in advance for that.
To build a serch form based on a view that was configured to use a bind variable I simply drop the Executewithparams operation and build a adf parameters form.
There is any way to do the same think (or something like this) with a view criteria. I tried to put an instance of the view and customize it with a view criteria that used a bind-variable in the application model. But using Executewithparams didn't work and I don't know what method I should call ?

Thanks for the answer, you are right I already tried this, but I wanted an input box + a button because the idea is: If the search returns only one result then you get a result page directly, but if there are many results then you get a page to choose one of them. I did this with a task-flow: one view for the search-panel then a router and a view for the choose-one-page (I haven't got time to test it completely but it seems to work).
There is a way to do this with the quick query component ?
Thanks [email protected]

Similar Messages

  • Oracle.jbo.NoDefException: Error in Quick Search when we use View  Criteria

    We encountered NoDefException error in Quick Search. We are using JDeveloper 11.1.1.6.0, JHeadstart 11.1.1.4
    I am able to reproduce the error by applying Oracle's HR schema. The following are the steps to reproduce with HR schema:
    1. Create an employee view named EmpVw by using the following query:
    select
    employee_id,
    first_name,
    last_name,
    email,
    phone_number,
    salary
    from employees
    2. Create a lookup view named CountryLookupView by using the following query:
    select
    country_id,
    country_name
    from countries
    3. Create a view named EmpCountryVw by using the following query:
    select
    emp.employee_id,
    emp.first_name,
    emp.last_name,
    cnty.country_id,
    cnty.country_name
    from employees emp
    inner join departments dept
    on emp.department_id = dept.department_id
    inner join locations loc
    on dept.location_id = loc.location_id
    inner join countries cnty
    on loc.country_id = cnty.country_id
    4. Create a LOV for the CountryId attribute in EmpCountryVw. The data source for this LOV is the CountryLookupView we just created. UI hints list type is Input Text with List of Values.
    5. Create View Criteria for EmpVw view, name it as EmpVwSearchCriteria Select EmpCountryVw from Attribute list, Operator is Exists, Operand is Inline View Criteria.
    6. Create new service EmployeeSearchService. Select EmpVw to the data model.
    7. In JHeadStart Application Definition Editor, create a new service node EmloyeeSearchService, set EmpVwSearchCriteria as Quick Search View Criteria in Search Settings section. Run the JAG, and then run the application.
    8. On the application screen, select EmployeeSearchService from the module drop-down list, on Emp Vw screen, click the glass icon to display the pop-up country search dialog, type in CA as country code, run the search, select the row with "Ca Canada" and then click OK button to close off the pop-up dialog. on Emp Vw screen, click "->" to run the search with Country Id = CA. Note the error dialog popup.
    The error message is: oracle.jbo.NoDefException: JBO-25058
    Caused by: oracle.jbo.NoDefException: JBO-25058: Definition data_MyJhsTutorial_UIShellPageDef_mainRegion_oracle_hr_pageDefs_EmpVwPageDef_WEB_INF_adfc_config_EmpVw_xml_EmpVwTaskFlow_EmpVwIteratorEmpVwSearchCriteriaQuery.vcrow125.EmpCountryVw.EmpCountryVwNestedCriteria.vcrow128.CountryId of type Attribute is not found in EmpVw.
         at oracle.jbo.server.ViewObjectImpl.findAttributeDef(ViewObjectImpl.java:7310)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._isTransientAttribute(FacesCtrlSearchBinding.java:585)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._changeQueryModeIfNeeded(FacesCtrlSearchBinding.java:577)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:397)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         ... 63 more
    Please let me know if you have solution for this error. Thanks in advance.
    Sarah

    Sarah,
    I could reproduce the error.
    However, I created a drag-and-drop page fragment with quick search and table, and modified the adfc-config-EmpVw task flow to reference the drag and drop page:
    <view id="EmpVwTable">
    <page id="__120">/EmpvwDD.jsff</page>
    </view>
    And then I still get the same error, so this looks like an ADF bug to me.
    I also created a stand-alone jspx page using drag and drop, same error as well. I suggest you make a testcase without JHeadstart and contact Oracle Support.
    Steven Davelaar,
    JHeadstart Team.

  • Passing two values in two different views using view criteria in adf bc

    I have two tables. Message and MessageProperties. Message table is connected with itself as same as Employee table of HR. Means a Message can have various child message. MessageProperties contains the message properties. A message can have various properties. I want to show the message only if it has a particular value in MessageProperties,then its properties,its child message. If its child message have the same value in MessageProperties,then it shows that. Likewise it should give me a tree structure with its all properties.
    When I am hardcode the value then its shows fine.
    SELECT Message.MESSAGE_ID,
    Message.MSG_CONTENT_ID,
    FROM MESSAGE Message, MESSAGE_PROP MessageProp
    WHERE (MessageProp.Message_Id=Message.Message_Id) AND ((MessageProp.Key='From' OR MessageProp.Key='To') AND (MessageProp.value='B'))
    But when I use the Bind variable in view criteria then I am not able to achieve this.
    1. How to do that in adf bc and how to link message and messageprop with this condition?
    2. How to pass two parameters in serviceinterface FIndViewCriteria method i.e. messageId and value so that it will show only that message having that value?

    Thanks Timo,
    It helps me a little bit.
    It only shows me the parent message id and its properties. But it is not showing its child message id and its properties.
    Let me explain you step by step what I have done.
    1> I have created a view MessageView with two entities i.e Message and MessageProp and include the value attribute of MessageProp in it.
    2> I have created the default MessagePropView from MessageProp Entity.
    3> In MessageView I have modified the query which you have given.
    4> I have created the Bind variables.
    5> I have created a view criteria and in that view criteria I have included Message_Id=:Bind_MessageId and Value=:Bind_Value.
    6> I have created an association connecting Message.Message_Id and Message.Parent_Id(1 to * cardinality) because a message can be a parent of many messages.
    7> I have created a viewlink between Message and MessageProp using Message_Id.
    8> I have created a view link between Message and Message using the association which I have created in step 6.
    9> I have created the Application Module. In that,my Data Model looks like
    ---MessagePropView2
    ---MessageView1
    ---------MessagePropView1
    ---------MessageView2
    10> Then I have created the service interface. In service interface view instances,I include these two view and select the GetByKey operation from basic operations.
    11> From View Criteria find operations I have included the view criteria which I have created in message view in step 5.
    12> Then I run the AppModuleServiceImpl.java and select the view criteria operation which I have created in step 11.
    13> There I find two bind variables i.e. Bind_MessageId and Bind_Value. I give the values there.
    But it checks whether that message Id(Bind_MessageId) which I have given have that value(Bind_Value) or not. If it has then it shows only that message along with its properties but it is not showing me its childs and their properties.
    I want to show only those child message who have the MessageProp.value as (Bind_Value).
    I hope you understand with the scenario.
    I'll be very thankfull to you if you help me to do this.
    Rohit.

  • 11g View Criteria "Exists" Problem!!

    Jdeveloper Version 11.1.1.1.0
    Example: Model HR
    Hi everybody,
    I am using the example model HR and i would like to get a view criteria to search the departments by name and employees by the lastname. But i need to get the departments when the "firstNameEmployee" is empty even though they are no employees.
    Now i get only the departments with some employee.
    That is a example of my concrete problem. In the view must have only the attributes of department.
    and here is the query:
    ( ( ( UPPER(Departments.DEPARTMENT_NAME) LIKE UPPER('%' || :VariableNameDepartament || '%') ) OR ( :VariableNameDepartament IS NULL ) )
    AND (EXISTS(SELECT 1 FROM EMPLOYEES Employees WHERE ( ( ( UPPER(Employees.LAST_NAME) = UPPER(:VariableNameEmployee) ) OR ( :VariableNameEmployeeIS NULL ) ) )
    AND (Departments.DEPARTMENT_ID = Employees.DEPARTMENT_ID))) )
    Thanks!

    Hi,
    Using view criteria does not change anything. After the query, the view object only contains the filtered rows.
    So you can get the result the same way you did before.
    Gabriel.
    ps: I hope I got your use case correctly. If not please give us some more detail
    Edited by: Gabriel Sideras on Sep 27, 2011 3:01 PM

  • Null check for a bind variable in view criteria

    Hi, Greetings.
    I am using Jdeveloper 11.1.2.0.
    I have a view object, LocationsView, for locations table of the XE database.
    I want to apply a condition, ((:bind_var is null) or (:bind_var is not null and location_id = :bind_var), in this LocationsView.
    That is, I want to apply the condition only if the bind variable value is not null.
    How can I construct this condition using a declarative view criteria?
    Any help and hints on this regard is greatly appreciated.
    Regards,
    Guru K

    Hi,
    Thanks for the update and it is working perfectly fine.
    Now, how can I set the "ignore null values" option as checked if I am constructing the criteria programmatically using view criteria row and view criteria item at runtime.
    Thanks and regards,
    Guru K

  • View Criteria in ADF Query Panel with Table-Class Cast Exception

    Hi,
    I am getting Class Cast Exception when using view criteria for ADF Query Panel with Table. The version I am using is 11g Release 1(11.1.1.2.0)
    Here is what I did:
    1. created a view criteria on a view object
    2. all are optional
    3. all are Strings
    3. Dragged the view criteria as a query component (ADF Query panel with Query table) on to the design layout
    and the error when I clicked the Search button is:
    javax.el.ELException: java.lang.ClassCastException: oracle.jbo.common.ViewCriteriaImpl cannot be cast to oracle.jbo.ViewCriteriaRow
    at com.sun.el.parser.AstValue.invoke(AstValue.java:161)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1289)
    at oracle.adf.view.rich.component.UIXQuery.broadcast(UIXQuery.java:115)
    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at sni.foundation.facesextensions.filters.FoundationFilter.doFilter(FoundationFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.lang.ClassCastException: oracle.jbo.common.ViewCriteriaImpl cannot be cast to oracle.jbo.ViewCriteriaRow
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._clearFilterCriteriaRows(FacesCtrlSearchBinding.java:4549)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._addFilterCriteria(FacesCtrlSearchBinding.java:4603)
    at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:423)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
    Thanks
    Venkatesh

    Hi Frank.
    I'm using JDev 11.1.1.3.0 as you suggest the error is no longer present in the latest version.
    I can pick my query from the "Saved Search" pick list on the QueryPanel list of queries just fine, and it sets up the filter properly, but when I press the "Search" button, I get the same reported error...
    <RegistrationConfigurator><handleError> Server Exception during PPR, #1
    javax.el.ELException: java.lang.ClassCastException: oracle.jbo.common.ViewCriteriaImpl cannot be cast to oracle.jbo.ViewCriteriaRow
         at com.sun.el.parser.AstValue.invoke(AstValue.java:161)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1303)
         at oracle.adf.view.rich.component.UIXQuery.broadcast(UIXQuery.java:115)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.lang.ClassCastException: oracle.jbo.common.ViewCriteriaImpl cannot be cast to oracle.jbo.ViewCriteriaRow
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._clearFilterCriteriaRows(FacesCtrlSearchBinding.java:4588)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding._addFilterCriteria(FacesCtrlSearchBinding.java:4642)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlSearchBinding.processQuery(FacesCtrlSearchBinding.java:424)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         ... 42 more

  • How can I use a single query panel with two view criteria?

    Hi all,
    I have a requirement to allow users to change the "display mode" on a search results tree table for an advanced search page. What this will do is change the structure of how the data is laid out. In one case the tree table is 3 levels deep, in the other case it's only 2 with different data being at the root node.
    What I've done so far:
    1) I exposed the data relationship for these two ways of viewing the data in the application module's data model.
    2)  I created a view criteria in the two view objects that are at the root of the relationships, where (for simplicity sake) I'm only comparing a single field.
    This is in one view object:
    <ViewCriteria
        Name="PartsVOCriteria"
        ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.PartsVO"
        Conjunction="AND">
        <Properties>... </Properties>
        <ViewCriteriaRow
          Name="vcrow23"
          UpperColumns="1">
          <ViewCriteriaItem
            Name="PartDiscrepantItemsWithIRVO"
            ViewAttribute="PartDiscrepantItemsWithIRVO"
            Operator="EXISTS"
            Conjunction="AND"
            IsNestedCriteria="true"
            Required="Optional">
            <ViewCriteria
              Name="PartDiscrepantItemsWithIRVONestedCriteria"
              ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.PartDiscrepantItemsWithIRVO"
              Conjunction="AND">
              <ViewCriteriaRow
                Name="vcrow26"
                UpperColumns="1">
                <ViewCriteriaItem
                  Name="InspectionRecordNumber"
                  ViewAttribute="InspectionRecordNumber"
                  Operator="="
                  Conjunction="AND"
                  Value=""
                  Required="Optional"/>
              </ViewCriteriaRow>
            </ViewCriteria>
          </ViewCriteriaItem>
        </ViewCriteriaRow>
      </ViewCriteria>
    and this is in the other view object:
    <ViewCriteria
          Name="IRSearchCriteria"
          ViewObjectName="gov.nasa.jpl.ocio.qars.model.views.InspectionRecordVO"
          Conjunction="AND">
          <Properties>... </Properties>
          <ViewCriteriaRow
             Name="vcrow7"
             UpperColumns="1">
             <ViewCriteriaItem
                Name="InspectionRecordNumber"
                ViewAttribute="InspectionRecordNumber"
                Operator="="
                Conjunction="AND"
                Required="Optional"/>
          </ViewCriteriaRow>
       </ViewCriteria>
    3) I had a query panel and tree table auto-generated by dragging the data control for ONE of the view object data relationship that's exposed in the app module. Then I created a second query panel and tree table the same way but using the data control for the other. I'm hiding one of the query panels permanently and toggling the visibility of the tree tables based on the display mode the user chooses. Both tables have separate bindings and iterators.
    This is a portion of the page definition:
    <executables>
        <variableIterator id="variables"/>
        <searchRegion Criteria="IRSearchCriteria"
                      Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                      Binds="InspectionRecordVOIterator"
                      id="IRSearchCriteriaQuery"/>
        <iterator Binds="InspectionRecordVO" RangeSize="25"
                  DataControl="QARS_AppModuleDataControl"
                  id="InspectionRecordVOIterator" ChangeEventPolicy="ppr"/>
        <iterator Binds="Root.QARS_AppModule.PartsVO1"
                  DataControl="QarsMasterAppModuleDataControl" RangeSize="25"
                  id="PartsVO1Iterator"/>
        <searchRegion Criteria="PartsVOCriteria"
                      Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                      Binds="PartsVO1Iterator" id="PartsVOCriteriaQuery"/>
      </executables>
    4) I've created a custom queryListener to delegate the query event.
    This is in my advanced search jsp page:
    <af:query id="qryId1" headerText="Search" disclosed="true"
                      value="#{bindings.IRSearchCriteriaQuery.queryDescriptor}"
                      model="#{bindings.IRSearchCriteriaQuery.queryModel}"
                      queryListener="#{pageFlowScope.SearchBean.doSearch}"
                      queryOperationListener="#{bindings.IRSearchCriteriaQuery.processQueryOperation}"
                      resultComponentId="::resId2" maxColumns="1"
                      displayMode="compact" type="stretch"/>
    This is in my backing bean:
    public void doSearch(QueryEvent queryEvent) {
          String bindingName = flag
             ? "#{bindings.IRSearchCriteriaQuery.processQuery}"
             : "#{bindings.PartsVOCriteriaQuery.processQuery}";
          invokeMethodExpression(bindingName, queryEvent);
       private void invokeMethodExpression(String expr, QueryEvent queryEvent) {
          FacesContext fctx = FacesContext.getCurrentInstance();
          ELContext elContext = fctx.getELContext();
          ExpressionFactory eFactory = fctx.getApplication().getExpressionFactory();
          MethodExpression mexpr =
             eFactory.createMethodExpression(elContext, expr, Object.class, new Class[] { QueryEvent.class });
          mexpr.invoke(elContext, new Object[] { queryEvent });
    When no inspection record number (the only search field so far)  is supplied in the query panel, then it behaves correctly. Namely, the tree tables shows all search results. However, when an inspection record number is supplied the tree table that was created with the query panel in use (remember there are two query panels, one of them is hidden) shows a single result (this is correct) while the other tree table (the one with the hidden query panel that isn't in use) shows all results (this is NOT correct).
    Is what I'm trying to accomplish even doable? If so, what am I missing?
    I'm using JDeveloper 11.1.1.7
    Thanks,
    Bill

    I ended up keeping one query panel permanently visible and the other permanently hidden. When performing a search using the table that has the hidden query panel, I seed the query descriptor for the hidden query panel using the visible query panel's query descriptor and then delegate the request:
       public void doSearch(QueryEvent queryEvent) {
          String bindingName = null;
          if(isIrTableRendered()) {
             bindingName = "#{bindings.IRSearchCriteriaQuery.processQuery}";
          } else {
             seedPartsQueryDescriptor();
             bindingName = "#{bindings.PartsVOCriteriaQuery.processQuery}";
             queryEvent = new QueryEvent(partsQuery, partsQuery.getValue());
          invokeMethodExpression(bindingName, queryEvent);
       private void seedPartsQueryDescriptor() {
          ConjunctionCriterion criterion = irQuery.getValue().getConjunctionCriterion(); 
          for(Criterion criteria : criterion.getCriterionList()) {
             AttributeCriterion attributeCriteria = (AttributeCriterion)criteria;
             List values = attributeCriteria.getValues();
             String qualifiedName = attributeCriteria.getAttribute().getName();
             int indexOfDot = qualifiedName.lastIndexOf(".");
             String name = indexOfDot < 0
                ? qualifiedName
                : qualifiedName.substring(indexOfDot + 1);
             ConjunctionCriterion partsCriterion =
                partsQuery.getValue().getConjunctionCriterion();
             for (Criterion partsCriteria : partsCriterion.getCriterionList()) {
                AttributeCriterion partsAttributeCriteria =
                   (AttributeCriterion) partsCriteria;
                String partsQualifiedName =
                   partsAttributeCriteria.getAttribute().getName();
                if (partsQualifiedName.endsWith(name)) {
                   partsAttributeCriteria.setOperator(attributeCriteria.getOperator());
                   List partsValues = partsAttributeCriteria.getValues();
                   partsValues.clear();
                   for (int i = 0, count = values.size(); i < count; i++) {
                      partsValues.set(i, values.get(i));
       private void invokeMethodExpression(String expr, QueryEvent queryEvent) {
          FacesContext facesContext = FacesContext.getCurrentInstance();
          ELContext elContext = facesContext.getELContext();
          ExpressionFactory expressionFactory =
             facesContext.getApplication().getExpressionFactory();
          MethodExpression methodExpression =
             expressionFactory.createMethodExpression(elContext, expr, Object.class, new Class[] { QueryEvent.class });
          methodExpression.invoke(elContext, new Object[] { queryEvent });
    Then when the advanced/basic button is pressed for the visible query panel, I programmatically set the same mode for the hidden query panel:
       public void handleQueryModeChange(QueryOperationEvent queryOperationEvent) {
          if(queryOperationEvent.getOperation() == QueryOperationEvent.Operation.MODE_CHANGE) {
             QueryMode queryMode = (QueryMode) irQuery.getValue().getUIHints().get(QueryDescriptor.UIHINT_MODE);
             QueryDescriptor queryDescriptor = partsQuery.getValue();
             queryDescriptor.changeMode(queryMode);
             AdfFacesContext.getCurrentInstance().addPartialTarget(partsQuery);

  • How to use arrays in view criteria

    Hi all,
    Am using Oracle Jdeveloper ,Studio Edition Version 11.1.1.2.0.
    I have a query panel with three comboxes,which can multiselect
    company,application & user respectively.When I mutiselect company,
    then based on the selected value I need to populate the application
    & user comboboxes.I want to search based on the selection.
    I have used viewcriteria to filter the apllication&
    user comboboxes.When a company is selected then company_id is passed as
    bind variable to the view criteria,then it can filter application combobox.
    Its working fine on single selection.
    So I want to pass the selected values as an array to view criteria.
    Please help
    Thanks

    cn u chk this..
    http://jobinesh.blogspot.com/2010/12/using-oraclejbodomainarray-with.html
    oops.. i am late by three minutes.. ;)
    you can check the link provided.. above

  • Using IN keyword in an sql query in a view criteria

    Hi,
    I am using jdev 11.1.1.1.0 and defined an lov query/viewobject as
    select a, b, c from myTable
    I now need to predefine filtering for lov search functionality and need something like the following
    select a, B, c from myTable where B in ('X','Y')
    I could not find a way to do it (i.e. specify the use of IN Keyword) in the Create View Criteria dialog box. I tried to define OR, but is that the best way to redefine IN as i have a long list (the above is just an example)
    (( ( (UPPER(B_FLAG) = UPPER('X') ) ) OR ( (UPPER(DISPLAY_FLAG) = UPPER('Y') ) ) ))

    If you know how many variables are in your "in" You can just write this in the sql query of your VO:
    http://www.oracle.com/technology/obe/obe11jdev/ps1/ria_application/images/t136.gif
    From this tutorial:
    http://www.oracle.com/technology/obe/obe11jdev/ps1/ria_application/developriaapplication_long.htm#ah1

  • Using SYSDATE in Pre-Defined View Criteria ADF BC

    I’m trying to setup a View Criteria to find records between two dates. So I create a View Criteria and Select my date field from the table and then choose the “Between” operator and then my operand is a Bind Variable. Then in my Bind variables I have SYSDATE and SYSDATE-7. So in my view.xml I have the following:
    <Variable
    Name="SystemDate"
    Kind="viewcriteria"
    Type="java.sql.Date">
    <TransientExpression><![CDATA[SYSDATE]]></TransientExpression>
    </Variable>
    <Variable
    Name="Bind_SystemDateMinusSeven"
    Kind="viewcriteria"
    Type="java.sql.Date">
    <TransientExpression><![CDATA[SYSDATE-7]]></TransientExpression>
    </Variable>
    However, when I try to run this View Criteria (using on an af:query component), I get the following error.
    Messages for this page are listed below.
    Error     
    Unexpected exception caught: java.lang.reflect.UndeclaredThrowableException, msg=null
    Error     
    Name SYSDATE not found in the given object: ViewRow [oracle.jbo.Key[877 ]
    Does anyone know how to do this using ADF BC and View Criterias? I've tried making my bind variables Strings and this doesn't work either. I basically want a predefined query that finds records within a specific week given the system date. Any ideas on how to make this work? Thanks.

    You can achieve SYSDATE in ADF BC View Criteria using IsSqlFragment="true".
    Below is the VO source code snippet for the same.
    <ViewCriteriaItemValue
                Name="ViewObjCriteria_ViewObjSubCriteria1_vcrow40_HireDate_vcval0"
                Value="sysdate-350" IsSqlFragment="true"/>
              <ViewCriteriaItemValue
                Name="ViewObjCriteria_ViewObjSubCriteria1_vcrow40_HireDate_vcval1"
                Value="sysdate" IsSqlFragment="true"/>
    </ViewCriteriaItem>

  • Label of attribute when used as View Criteria item with Bind Variable

    I've a VO attribute used in a named search with this requirement:
    The attribute provides has an optional View Criteria item that has a bind variable operand. The bind variable is in the WHERE clause. The attribute has an LOV. The choice list for the specified View Criteria item should display the label "Effective Release". However, in all other contexts, including the search results table and the dropdowns the user can optionally add in an advanced search, the label displayed for the attribute must say "Release".
    In other words, the default label for the attribute should be "Release" in all but one context - which is that when the dropdown list for the viewCriteria item using the bind variable is displayed, the label should say "Effective Release".
    Note that if the user moves to Advanced Search and selects adds the attribute as a search criteria, this latter usage should be labeled as "Release". (in this case, in other words, the dropdown that displays by default and has the bind variable operand is labelled "Effective Release", the one the user added in advance search is labelled "Release")
    here is the View Criteria item source xml:
          <ViewCriteriaItem
            Name="ReleaseId1"
            ViewAttribute="ReleaseId1"
            Operator="="
            Conjunction="AND"
            Value=":v_ReleaseId"
            GenerateIsNullClauseForBindVars="false"
            ValidateBindVars="true"
            IsBindVarValue="true"
            Required="Required"/>I've experimented by putting "Effective Release" as the label for the bind variable as below. However, ADF does not use that value to display, it defers to the attribute value:
    <Variable
        Name="v_ReleaseId"
        Kind="viewcriteria"
        Type="oracle.jbo.domain.Number">
        <Properties>
          <SchemaBasedProperties>
            <LABEL
              ResId="EFFECTIVE_RELEASE_LOV"/>
          </SchemaBasedProperties>
        </Properties>
      </Variable>The reason for the requirement, if it matters, is that the View Criteria item with the bind variable ("Effective Release" queries a range of values using the analytic function rank(); the bind variable is in the WHERE clause. Otherwise, the dropdown that can be added in advanced search ("Release") looks for exact matches on the attribute value. So since the search functionality is different, the label should be different.
    Am using 11g.
    Thanks for your help.

    Hi
    I have found that when using validation type Key Exists and the VO is in the local application, then the bind variable is available in the Create Validation wizard. When I try and create a validator on a VO that is core to all my applications, then I put that VO into an ADF library, the bind variable parameter is not available for mapping to my entity object attribute, even though I can select the VO to create a view accessor from the ADF library.
    Possible bug?

  • Using Max Function in View Criteria

    Hi
    I am having a requirement where by i need to make use of max function in view criteria but not able to see any such option. Can someone please help me over it. Here is the requirement.
    In table i will be having multiple rows for an employee and i need to pick latest row based on a column say request_id For e.g.
    Emp RequestId
    A 1
    A 2
    A 3
    A 4
    So if i pass the employee id i should get Row Number 4. In simple SQL language I want something like this
    select * from emp where empid=A and requestid=( select max(requestid) from emp where empid=A)
    Just wanted to know is there any approach that i can use to do all this as part of View Criteria or any other way.
    Any help is appreciated!!!
    Thanks
    AJ

    One way is this -
    1)https://blogs.oracle.com/adf/entry/using_groovy_aggregate_functions_in (You might need to create a self-referencing VL for this , try if it works using a ViewAccessor too)
    OR
    Order by RequestId descending in your SQL for the VO if thats ok , then have the ViewCriteria for the EmpId and programmatically pickup the first row...

  • Use SQL REPLACE in View Criteria

    Hi,
    I'm using JDev 11.2.3.0.
    I have created a View Criteria to restrict on email address and need to strip off the '@domain.com' part of the bind variable. In SQL I would just use REPLACE to do this, but cannot find a way to add that keyword in the View Criteria dialogue.
    Do I need to modify the Bind variable using EL? If so, how do I refer to the bind variable itself in the bind variable expression?
    Many thanks.

    You can't just use EL without permanently changing the input of the user (e.g. using a converter to strip away the '@domain.com' part).
    You need to overwrite the prepareRowSetForQuery method in the VO you are using to make the query. In this method you can alter the bind variable before the query executes.
    //In view object implementation
    public void prepareRowSetForQuery(ViewRowSetImpl vrs) {
      //Set the value for bind variable ':bindVarDeptId' only for default row set
      if(vrs.isDefaultRowSet()){
        vrs.setNamedWhereClauseParam(  "bindVarDeptId", getUserDeptId());
       super.prepareRowSetForQuery(vrs);
    }Timo

  • How can i use multi group view criteria in jdeveloper10g?

    Hi.
    i'm using jdeveloper10g.1.3.50,i want add multi group viewcriteria,but can't found ViewCriteriaItem.
    eg.select x from x WHERE ( (( (a = 1) ) OR ( (a = 2) ))
    AND ( (b =1) or (b = 2)))
    how can i use multi group view criteria in jdeveloper10g?

    Hi,
    Did you try with viewcriteriarow.setConjunction?
    http://download.oracle.com/docs/cd/B13597_05/web.904/b10391/oracle/jbo/ViewCriteriaRow.html
    -Arun

  • Is it even possible to dynamically apply view criteria in an ADF Web App?

    This is one of those situations where something that should take an hour ends up taking days.
    * I have a view.
    * The view has Bind Variables associated with it.
    * The view has View Criteria associated with it.
    * Each of the View Criteria use different Bind Variables.
    * I have a search criteria input page that receives from the user what will ultimately be used to set the bind variables.
    * I have a search results page that uses the view to display a table.
    * I have the code that dynamically sets view criteria and parameters. It is based on the following:
    http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcadvvo.htm#BCGFHAGA
    * This code works great, until the iterator associated with the table binding to the view is initialized. At that time, the view is reset to its defaults, and all of my code's doings are discarded. How do I know this? Because I have gone so far as to run my code that sets view criteria and binding variables dynamically in a phase event handler for the search results page in the render response phase. There is no other point at which to dynamically modify the view.
    This is turning into a situation where it seems I will need 5 different views and 5 different pages in order to show a single set of query results. I cannot get dynamically applied view criteria to work in an ADF web app. Has anyone else done it? Can anyone relate to this? Are there any other suggestions before I conclude that it's not possible for this framework to handle this simple scenario?
    Thanks

    There must be a setting or something that I am still missing here. If I write code just like this and make sure it is executed, I still only see the results of my view executed without the view criteria applied using the default bind variable values that I supplied in the view object.
    It's like the fact that I set the bind variables, the view criteria, and executed the view query programmatically is lost on the iterator -- it's like it never happened. What setting is used to ensure that the iterator uses the outcome of what I executed programmatically? There has to be a critical set or setting that I am missing.
    Here is the iterator and search region definitions defined in the page def "executables" section:
      <executables>
         <iterator Binds="CustomSearchView1" RangeSize="25"
                  DataControl="AppModuleDataControl"
                  id="CustomSearchView1Iterator"/>
        <searchRegion Binds="CustomSearchView1Iterator"
                      Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                      id="CustomSearchView1Query"/>
        </executables>Here's the "tree" binding in the page def file:
      <bindings>
       <tree IterBinding="CustomSearchView1Iterator" id="CustomSearchView1">
          <nodeDefinition DefName="Model.CustomSearchView" Name="CustomSearchView10">
            <AttrNames>
              <Item Value="CustomId"/>
              <Item Value="CustomProjectNumber"/>
              <Item Value="CustomName"/>
              <Item Value="CustomStatus"/>
              <Item Value="CustomStatusDate"/>
            </AttrNames>
          </nodeDefinition>
        </tree>
      </bindings>In an effort to take page flow out of this mess, I had modified this to include the search criteria and search results on a single page. So, I now have a "Search" button. When the "Search" button is clicked, the action method does the following:
        public String searchActionListener ()
              // Get search criteria from select one choice and text input controls.
              AppModule appModule =
                    ( AppModule ) Configuration.createRootApplicationModule (
                        "Model.AppModule",
                        "AppModuleLocal");
              appModule.customSearch( searchCriteria1,
                                                   searchCriteria2,
                                                   searchCriteria3 );
        }In my application module this translates to:
        public void customNoticeSearch ( String searchCriteria1, String searchCriteria2, String searchCriteria3)
           CustomSearchViewImpl searchViewImp =
               ( CustomSearchViewImpl ) this.getCustomSearchView1 ();
           searchViewImp.customExecuteQuery ( searchCriteria1, searchCriteria2, searchCriteria3);
        }Finally, in my custom view object implementation code:
        public void customExecuteQuery ( String searchCriteria1, String searchCriteria2, String searchCriteria3 )
            // Set-up the parameters that are part of the core query.
            this.setp_searchCriteria1( searchCriteria1);
            this.setp_searchCriteria2( searchCriteria2);
            if ( searchCriteria3 != null )
                ViewCriteriaManager vcm = this.getViewCriteriaManager();
                ViewCriteria vc = vcm.getViewCriteria ( "WithLastCriteria" );
                this.setp_searchCriteria3( new Number ( searchCriteria3 ) );
                this.applyViewCriteria( vc );
            System.out.println ("This is fun.");
            this.executeQuery();
        }This code executes, but the results table is empty, and I know that there are results, because I can execute use execute with params to execute the base query and get the correct results back.
    Thanks for taking a look at this.

Maybe you are looking for

  • Second Hand iPod Touch

    I have a second-hand iPod Touch running software version 2.0.2 (5C1). I had thought that everything was deleted back to factory specs. However, when it connects wirelessly to the iTunes Store, it asks for a password. I haven't connected it to my Mac

  • XML for Table

    Hi, all. I have view with few rows and i want to generate XML something like this. <Filials> <Filial id="1"> <Employees> <Employee id="1"> <Assigments> <Assigment id="1" name="Team Lead"> <EmptyCols> Col1 Col2 Col5 </EmptyCols> </Assigment> <Assigmen

  • Itunes will only show apple tv as device, but itunes won't show some tabs

    when apple tv is connected to my laptop, itunes will show the device but the screen won't show some of the tabs like: info, or music, it does show: summary, photos. What is wrong with itunes not showing the apple tv device source tabs?

  • Sql profiler analysis services discover begin really slow

    Hi, When we are trying to run MDX query on a cube, it takes really long time to open. So we tried to monitor using SQL Profiler, it shows "Discover begin, 5-mdschema_dimensions" this step takes really long.  We've researched some threads, but couldn'

  • GRC5.3 UME roles & CUA

    Hi, I am implementing GRC in an environment with a CUA and have the following questions 1. Is it possible to configure GRC & CUA so that the UME users and roles can be provisioned through the CUA? 2. In this case of having a CUA would this be used as