Programmatically adding two view criteria

Hello,
I am using Jdev version 12.1.2.0.0 and i am trying to apply two view criteria to a view object:
ViewObject vo = ...
ViewCriteria vc1 = vo.createViewCriteria();
ViewCriteriaRow vcr1 = vc1.createViewCriteriaRow();
vcr1.setAttribute(smt,smt);
vc1.add(vcr1);
ViewCriteria vc2 = vo.createViewCriteria();
ViewCriteriaRow vcr2 = vc2.createViewCriteriaRow();
vcr2.setAttribute(smt,smt);
vc2.add(vcr2);
vo.applyViewCriteria(vc1);
vo.applyViewCriteria(vc2,true);
vo.executeQuery();
I don't know why, but it executes just the second view criteria.
Thank you in advanced.

From the dos it looks like you add multiple rows to one view criteria but can only apply one view criteria
public static void demoCriteria(ApplicationModule appMod)
  // Create and populate criteria rows to support query-by-example.
  ViewObject empView = appMod.createViewObject("Emp", "mypackage1.EmpView");
  ViewCriteria vc = empView.createViewCriteria();
  ViewCriteriaRow vcRow = vc.createViewCriteriaRow();
  // ViewCriteriaRow attribute name is case-sensitive.
  // ViewCriteriaRow attribute value requires operator and value.
  // Note also single-quotes around string value.
  ViewCriteriaItem jobItem = vcRow.ensureCriteriaItem("Job");
  jobItem.setOperator("=");
  jobItem.getValues().get(0).setValue("MANAGER");
  vc.add(vcRow);
  vcRow = vc.createViewCriteriaRow();
  ViewCriteriaItem salItem = vcRow.ensureCriteriaItem("Sal");
  salItem.setOperator(">");
  salItem.getValues().get(0).setValue(new Integer(2500));
  vc.add(vcRow);
  empView.applyViewCriteria(vc);
  // Multiple rows are OR-ed in WHERE clause.
  System.out.println("Demo View Criteria");
  // Should print employees that are MANAGER or have Sal > 2500
  QueryDemo.printViewObject(empView);
Timo

Similar Messages

  • 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);

  • Programmtically Setting View Criteria in ADF Query Component

    I have created two view criterias for a View Object and used ADF Query component for searching. User can select any one of the View Criteria from "saved search" in ADF Query component. but i want to set it programmatically based on some business rules. How i can do that?

    No I don't want to set view criteria on search click. Actually I have ADF Query component on my page which is by default disabled. There are also some fields outside the query component on the value of which i enable ADF Query component and wants to set a particular ViewCriteria based on context. All ViewCriterias are defined and listed in "saved search" of ADF Query component but i don't want to allow user to select it but wants to application set it automatically based on context. For it i will be needed to set a particualar ViewCriteria for ADF Query component through code and then refresh ADF Query component to show newly set ViewCriteria. I know how to refresh query component or any other component through code but don't know how to set ViewCriteria on ADF Query component?

  • View criteria condition needs to check value in column from another VO

    Hi All,
    My Jdev version - 11.1.1.6
    My use case is as follows-
    2 view objects say EmpVO and DeptVO which have view link with deptId as the foreign key attribute. I need to show the distinct list of departments along with a column which contains the employee names separated by comma for the particular department in the corresponding row. Hence, for DeptVO I use the query as follows -
    -          SELECT deptId,
    -                 deptName,
    -                 (SELECT listagg (empName, ',') WITHIN GROUP (ORDER BY empName)
    -                            emp_names
    -                    FROM EMP_TABLE emp
    -                   WHERE emp.deptId = dept.deptId)
    -                    emp_names
    -            FROM DEPT_TABLE
    This gives me the result on screen as follows -
    DeptId          DeptName          EmpNames
    101               HR                    emp1,emp2
    102               Finance             emp3,emp4,emp5
    Now, my requirement is that there should be a search on department which should also contain an LOV (with search icon) for the employee names i.e. if user selects emp4 from the LOV, department table should list the record for 102.
    For this , I added an LOV on the EmpNames attribute of DeptVO (to map the values from EmpVO) and added a view criteria based on which I added a query panel on screen and the relevant partialTrigger attribute so that the department table should reflect the search results. I tried 2 options in the View Criteria of DeptVO i.e.
    1. Added an Item 'EmpNames = '. WIth this, EmpNames attribute appear with Searh icon in the query panel(which is required) but it does not display the right department record bcz it tries to match exactly with values like 'emp3,emp4,emp5'
    2. If I add Item 'EmpNames CONTAINS ' , EmpNames search will work from query panel i.e. if I enter the value as emp4, department 102 will be shown in the results table but there is no Search icon on the EmpNames field in query panel. The component actually becomes an inputText.
    It would be of great help if you can guide on a better way to achieve this use case. Please let me know if there needs to a change in the approach or if any other details are needed.
    Regards,
    Ansh

    Hi Timo,
    Thanks for this. I have already implemented this part. Here, in the example there's an LOV on department id and form is on employee entity. However, my use case is a different one. I need to search for department which should contain a search criteria for employee in the form of LOV.
    Could you suggest some possible solution?
    Regards,
    Ansh

  • Create view link between two view objects (from programmatic data source)

    Hi Experts,
    Can we create a link between two view objects (they are created from programmatic datasource ; not from either entity or sql query). If yes how to create the link; ( i mean the like attributes?)
    I would also like to drag and drop that in my page so that i can see as top master form and the below child table. Assume in my program i will be only have one master object and many child objects.
    Any hits or idea pls.
    -t

    Easiest way to do this is to add additional transient attributes to your master view object, and then include those additional transient attributes in the list of source attributes for your view link. This way, you can get BC4J to automatically refer to their values with no additional code on your part.

  • 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.

  • Applying view criteria to LOV programmatically in ADF UI

    Hi,
    I have a LOV defined in model on VO. I want to populate this LOV programmatically based on some view criteria.
    How can I do this?
    Thanks
    - Harish

    Hi.
    Welcome to OTN.
    Check this http://www.oracle.com/technetwork/developer-tools/adf/learnmore/44-restrict-lov-169186.pdf

  • How to merge two views of same criteria in Answers

    Hi All,
    Is there any way we can merge two views of same criteria in Answers.
    I have two pivot tables built from same criteria. But in the final report I want to show the two reports as a single report. Is this possible?
    Best Regards,
    BTK.

    Hi,
    I cannot use "Combine with Similar Request". I need drilldown also. When I use "Combine with Similar Request", then drill down is getting disabled.
    Best Regards,
    BTK.

  • URGENT | Need HELP to build programmatic view criteria

    Hi
    I need to build programatic view criteria like below,
    ((JobId = "SH_CLERK" AND Salary > 2500) OR ( Salary > 2500))
    AND (DepartmentId =100)
    Kindly help how can we achieve this,
    The ViewCriteriaItem objects like below, how to link them to achieve like above statement.
    ViewObjectImpl empVOImpl = getEmployeesView1();
    ViewCriteria vc = empVOImpl.createViewCriteria();
    ViewCriteriaRow vcr = vc.createViewCriteriaRow();
    //criteria for employee id
    ViewCriteriaItem vci1 = vcr.ensureCriteriaItem("JobId");
    vci1.setValue("SH_CLERK");
    //criteria for showing employees whose salary are more than 10000
    ViewCriteriaItem vci2 = vcr.ensureCriteriaItem("Salary");
    vci2.setOperator(">");
    vci2.setValue(new Number(2500));
    //criteria for department
    ViewCriteriaItem vci3 = vcr.ensureCriteriaItem("DepartmentId");
    vci3.setOperator("=");
    vci3.setValue(new Number(100));
    vc.addElement(vcr);
    empVOImpl.applyViewCriteria(vc);
    - Rajesha
    Edited by: user12820425 on May 15, 2013 10:18 AM

    Hi Rajesha,
    You can follow below steps.
    1)Create VOImpl for VO on which you have query based.
    2)Remove Column(eg.JobId) from standard Default ViewCriteria
    3)In VOImpl create method to Create View custom Criteria, Add element
    public ViewCriteria  addCustomVC(){
                ViewCriteria vc = null;
                vc = this.createViewCriteria();
                vc.setName("customVC");
            ViewCriteriaRow vcRow = vc.createViewCriteriaRow();
            vcRow.setConjunction(ViewCriteriaRow.VC_CONJ_AND);
            if(getJobId() != null){ 
                vcRow.setAttribute("JobId", "' job_id = "+getJobId()+"'"); 
            }else {
                vcRow.setAttribute("JobId",null);
            vc.addElement(vcRow);
    return vc;
    }4)Override standard method public String getCriteriaItemClause to exclude above columns
        @Override
        public String getCriteriaItemClause(ViewCriteriaItem viewCriteriaItem) {
            //JobId
            if( "JobId".equals(viewCriteriaItem.getName()) ) {
                return (String) viewCriteriaItem.getValue();   
            }else{
                return super.getCriteriaItemClause(viewCriteriaItem);
        }5)Override public void executeQuery() method to add custom view criteria
    @Override
        public void executeQuery()
                applyViewCriteria(addCustomVC(), true);
                super.executeQuery();
                removeApplyViewCriteriaName("customVC");
        }Thanks,
    Jit

  • View Criteria issue on ADF Tree

    Hi,
    JDev 11.1.1.5.0
    I am facing an issue while displaying ADF tree. I've created ParentVO & ChildVO from a single table with view criteria to filter the nodes.And then created two View links ParentToChild & ChildToChild.
    Added VOs & corresponding ViewLinks to ApplicationModule. When I tried to run application module, getting the results as per expectation (applying view criteria at each level).
    Now i've dragged the parent vo from data control on to jspx page. when I run the jspx page, it's displaying the tree structure.
    Issue is only view criteria is applying for top level nodes(parent VO) but not sub levels. If there is some issue with creation of View criteria then it should give same problem while executing AM. But while running AM, getting the expected results.
    It would be great if you provide any clue on this issue
    Thanks,
    Samba

    Thanks for your response.
    But my usecase is different. I need to filter the sublevels of the tree.
    Following is the sample
    Level1
         Level1.1
         Level1.2
         Level1.3
    Level2
         Level2.1
         Level2.2
         Level2.3
         Level2.4
    Level3
         Level3.1
         Level3.2
         Level3.3
    If I gave View Criteria as contains '2' then, Need to filter the nodes contains character 2. Able to filter first level nodes according VC. But VC is not applying for sub levels. Is there any way to set the VC in my case?

  • Add record through pop to search view criteria table?

    Hi,
    I am trying to add data from pop to search view criteria table but i am strukked at inserting data through popup...
    i got nullpointer exception like this
    <RegionRenderer> <encodeAll> The region component with id: pt1:r1 has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance. It is recommended that you restructure the page fragment to have a single root component.
    <RowGatherCallback> <processComponent> Illegal child component ("javax.faces.component.html.HtmlOutputText@17cc21b" id="j_id256") detected inside parent component ("panelGridLayout" with clientId="pt1:r1:1:pgc1:pt_pgl3"). The child component must instead be of type "gridRow" instead.
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: java.lang.NullPointerException
    java.lang.NullPointerException
        at oracle.jbo.server.QueryCollection.getRowSetRefs(QueryCollection.java:2675)
        at oracle.jbo.server.ViewObjectImpl.notifyRowUpdated(ViewObjectImpl.java:12174)
        at oracle.jbo.server.ViewObjectImpl.afterRowUpdate(ViewObjectImpl.java:13921)
        at oracle.jbo.server.ViewObjectImpl.sourceChanged(ViewObjectImpl.java:14224)
        at oracle.jbo.server.EntityCache.sendEvent(EntityCache.java:1566)
        at oracle.jbo.server.EntityCache.deliverEntityEvent(EntityCache.java:1582)
        at oracle.jbo.server.EntityCache.notifyColumnAndBlgChange(EntityCache.java:1640)
        at oracle.jbo.server.EntityImpl.notifyAttributesChanged(EntityImpl.java:7426)
        at oracle.jbo.server.EntityImpl.notifyAttributesChanged(EntityImpl.java:7407)
        at oracle.jbo.server.ViewRowImpl.setAttributeValues(ViewRowImpl.java:1827)
        at oracle.adf.model.binding.DCDataControl.setAttributesInRow(DCDataControl.java:2447)
        at oracle.jbo.uicli.binding.JUCtrlValueBinding.setAttributeValuesInRow(JUCtrlValueBinding.java:997)
        at oracle.jbo.uicli.binding.JUCtrlListBinding.setTargetAttrsFromLovRow(JUCtrlListBinding.java:2813)
        at oracle.jbo.uicli.binding.JUCtrlListBinding.updateTargetFromSelectedValue(JUCtrlListBinding.java:2941)
        at oracle.jbo.uicli.binding.JUCtrlListBinding.setAttributeFromValueList(JUCtrlListBinding.java:2886)
        at oracle.jbo.uicli.binding.JUCtrlListBinding.setSelectedIndex(JUCtrlListBinding.java:1752)
        at oracle.jbo.uicli.binding.JUCtrlListBinding.setInputValueInRow(JUCtrlListBinding.java:3541)
        at oracle.jbo.uicli.binding.JUCtrlValueBinding.setInputValue(JUCtrlValueBinding.java:2926)
        at oracle.jbo.uicli.binding.JUCtrlValueBinding.setInputValue(JUCtrlValueBinding.java:2889)
        at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.setInputValue(FacesCtrlListBinding.java:458)
        at oracle.jbo.uicli.binding.JUCtrlValueBinding.put(JUCtrlValueBinding.java:2546)
        at oracle.jbo.uicli.binding.JUCtrlListBinding.put(JUCtrlListBinding.java:3437)
        at javax.el.MapELResolver.setValue(MapELResolver.java:229)
        at com.sun.faces.el.DemuxCompositeELResolver._setValue(DemuxCompositeELResolver.java:255)
        at com.sun.faces.el.DemuxCompositeELResolver.setValue(DemuxCompositeELResolver.java:281)
        at com.sun.el.parser.AstValue.setValue(Unknown Source)
        at com.sun.el.ValueExpressionImpl.setValue(Unknown Source)
        at org.apache.myfaces.trinidad.component.UIXEditableValue.updateModel(UIXEditableValue.java:361)
        at org.apache.myfaces.trinidad.component.UIXEditableValue.processUpdates(UIXEditableValue.java:311)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.updateChildrenImpl(UIXComponentBase.java:1269)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.updateChildren(UIXComponentBase.java:1259)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.processUpdates(UIXComponentBase.java:1012)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.updateChildrenImpl(UIXComponentBase.java:1269)
        at oracle.adf.view.rich.component.fragment.UIXRegion.updateChildrenImpl(UIXRegion.java:669)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.updateChildren(UIXComponentBase.java:1259)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.processUpdates(UIXComponentBase.java:1012)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$UpdateModelValuesCallback.invokeContextCallback(LifecycleImpl.java:1561)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnNamingContainerComponent(UIXComponentBase.java:1670)
        at oracle.adf.view.rich.component.fragment.UIXRegion.invokeOnComponent(UIXRegion.java:625)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnNamingContainerComponent(UIXComponentBase.java:1693)
        at oracle.adf.view.rich.component.fragment.UIXRegion.invokeOnComponent(UIXRegion.java:625)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.invokeOnComponent(ContextSwitchingComponent.java:222)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at oracle.adf.view.rich.component.fragment.UIXInclude.invokeOnComponent(UIXInclude.java:161)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXDocument.invokeOnComponent(UIXDocument.java:106)
        at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1321)
        at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:678)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:382)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
        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:173)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
        at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
        at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
        at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
        at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
        at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
        at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
        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.wrapRun(WebAppServletContext.java:3715)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    can any body help me out this?..
    ThankYou

    HI,
    I think you have created form using two view objects ...recheck one of the value is null before commit ..
    Thanks
    Nitesh

  • Including additional where clause conditions to view criteria dynamically

    Hi,
    We have a set of view objects that serves as LOV for various other view objects. All such LOV view objects have three specific attributes, two date attributes namely EffectiveStartDate, EffectiveEndDate and a String attribute namely UserSwitch based on which the LOV list needs to be filtered.
    All the view objects are having one or more view criterias with specific where clause conditions.
    Apart from those view criteria conditions, invariantly, we need the following conditions also
    :bindEffDate between EffectiveStartDate and EffectiveEndDate and UserSwitch = :bindUserSwitch.
    We wish not to include the above condition in each and every view criteria of each and every view object (Since we have around 800 view objects and a minimum of 2 view criterias per view object). Instead, we created a dummy view object (BaseViewObject) with two bind variables :bindEffDate and :bindUserSwitch and all the LOV view objects were made to extend this BaseViewObject.
    Therefore, whenever a view object atribute is attached with LOV using the above said LOV View Objects, the bind variables of the baseViewObject as well as the view object specific bind variables are available in the view accessors tab of the view object wizard where we can supply values to those bind variables.
    Now, we need to construct the view criteria filter clause. To achieve this, we created a class, CustomCriteriaAdapter.java extending oracle.jbo.server.CriteriaAdapterImpl. In the getCriteriaClause() method, we included the follwoing code:
    public String getCriteriaClause(ViewCriteria pViewCriteria)
    ViewObject vo = pViewCriteria.getViewObject();
    String userSelectSwitch = (String) vo.ensureVariableManager().getVariableValue("bindUserSwitch");
    String effBgnDt = vo.getAttributeDef(vo.getAttributeIndexOf("EffectiveStartDate")).getName();
    String effEndDt = vo.getAttributeDef(vo.getAttributeIndexOf("EffectiveEndDate")).getName();
    String customCriteria = " ( :bindEffDate >= " + effBgnDt + " ) AND ( :bindEffDate <= " + effEndDt + " OR " + effEndDt + " IS NULL ) ";
    StringBuffer completeCriteria = new StringBuffer();
    String criteriaClause = super.getCriteriaClause(pViewCriteria);
    if (criteriaClause != null && !criteriaClause.isEmpty())
    completeCriteria.append(criteriaClause + " AND ");
    completeCriteria.append(customCriteria);
    if (userSelectSwitch != null && "Y".equals(userSelectSwitch))
    String userSelectSw = vo.getAttributeDef(vo.getAttributeIndexOf("UserSwitch")).getName();
    completeCriteria.append(" AND (" + userSelectSw + "='Y' ) ");
    return completeCriteria.toString();
    Issues:
    The LOV list is not filtering the records based on the constructed conditions. Instead it is listing either all of the records considering only the view criteria conditions applied at design time irrespective of the userswitch and effectivedate conditions or the list is empty.
    Here, my questions are,
    1. Am I in the correct approach? If not, guide me in a more proper approach to achieve the same requirement.
    2. If the way I am trying is correct, where things are going wrong and why the dynamic condition is not getting effected?
    Kindly help in sorting out the issue.
    Thanks in advance.

    Hi Jobinesh,
    Thanks for your response and yes, we have done exactly as what you have mentioned. As explained earlier, a baseViewObject along with its Impl class has been created and it will be extended by all the viewobjects meant for serving LOV. Therefore, the superClass for any such LOV viewObject is the baseViewObjectImpl class. In that baseViewObjectImpl(), we have over-rided the criteriaAdapter() method and returned an instance of our customCriteriaAdapter() class.
    Below is the code we are using in the baseViewObjectImpl():
    package model.base.vo;
    import oracle.jbo.CriteriaAdapter;
    import oracle.jbo.server.ViewObjectImpl;
    public class BaseViewObjectImpl
    extends ViewObjectImpl
    * This is the default constructor (do not remove).
    public BaseViewObjectImpl()
    * Over-rided method of ViewObjectImpl class of the framework.
    * Calls the customized criteria adapter so that the default where clauses are added to the view criteria.
    * @return CriteriaAdapter.
    @Override
    public CriteriaAdapter getCriteriaAdapter()
    return new CustomCriteriaAdapter();
    I'll create a sample in HR schema and share with you shortly.
    Thanks and regards.

  • 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

  • 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.

  • SRM 7.0 New custom fields added to view do not appear in the component conf

    Hi
    I added two custom fields to the view V_QTE_DOFC_I_DESC of the WD componenet /SAPSRM/WDC_DODC_QTE_I_DS. This view gets called when bidder is trying to create a bid and clicks on add Substitute Item in the Item tab. This view is simply a popup window where we can enter ther substitute item.
    I added two custom fields to the context of the above view and placed on the layout of the view as input fields. Then I tried to modify the component configuration /SAPSRM/WDCC_DODC_QTE_I_DS_SUB. When I look in t he web dynrpo built-in for the view V_QTE_DOFC_I_DESC, I don't see the custom fields that I just added. As a result, these custom fields are not displayed when I try to substitute an item. Could anyone tell me how to brining in these two custom fields into the component configuration.
    Any help is greatly appreciated.

    Hi Prasuna,
    Sorry ..You are right..I was looking at some other WDC related to contract data..It you map the CUFs to /SAPSRM/S_CLL_CTR_ITEM which has the include structure INCL_EEW_PD_ITEM_CSF_CTR then it should work fine.
    If you do this, are you able to view the new fields on the screen?
    you mentioned that you are not able to save the data to the table.
    Include your fields in INCL_EEW_PD_ITEM_CSF as well because if you add CUF to any of those doc types, you also have to add those CUF to the global structure for CUF documents.
    Also Check if you fields are there in structures BBPS_CTR_CUF_ITEM,BBPS_CTR_UI_ITEM and BBPS_CTR_ITEM.
    Check whether you have implemented the BADI's like BBP_DOC_CHECK_BADI ,BBP_DOC_CHANGE_BADI and BBP_DOC_SAVE_BADI . check out the structures (whether they having the CUFS) used in those if you have implemented any of them .
    Regards
    Lavanya
    Edited by: LAVANYA CHAVA on Aug 25, 2010 10:10 AM

Maybe you are looking for

  • Calling all FIM users! May TechNet Gurus announced!

    The results for May's TechNet Guru competition have been posted! http://blogs.technet.com/b/wikininjas/archive/2014/01/16/technet-guru-awards-december-2013.aspx Congratulations to all our new Gurus for May! We will be interviewing some of the winners

  • Fail to install 9iAS9.0.2-a fully qualified hostname has not be specified

    hello in order to study oracle9iAS,i download the 9iAS9.0.2 from your website,but at the first disk installation,it tell me: "installation has detected that a fully qualified hostname has not be specified for this host,oracle9i Application server ins

  • How to replicate a SQL Server database to Oracle?

    I want to create an Oracle database. I have an existing SQL database. I have created an sql file of the SQL database. Should I just run this file from the sql prompt? Do I need to create a service id for the new database and then run the sql file? Al

  • DBMS_JAVA.GRANT_PERMISSION

    Hi all anyone know when/why do I need to grant permissions to myself? I created a small java class, created the wrapper plsql, but when I run it, complains about permissions. Funny thing is, another simple class I had tried before didnt require anyth

  • IPhone 4 stuck on loading screen after trying to download iOS 5

    All the iTunes updated, then my phone was stuck with just the apple icon and loading bar, which was empty. I tried disconnecting it from my laptop, switching it off etc, now I have switched it back on and it's showing the same thing I only got it yes