View Criteria

Hi,
I am new to adf exploring by doing one POC ,my requirement is, i need to call the application module impl through backing bean to search based on 2 inputs form DB table and the result set i need to store into session.
for this i wrote view criteria and how to call
I need to get through backing bean
this i wrote in VOImpl class under one method which i am calling from Application module impl class
Proj_name and PA_name are bind variables of View criteria in VOimpl class(Generated View Object class)
ViewCriteria vc =getViewCriteria("ProjectViewObjVOCriteria");
setPA_name(ProjName);
setProj_name(PANumber);
applyViewCriteria(vc);
executeQuery();
error :oracle.jbo.InvalidObjAccessException: JBO-25036: An invalid object operation was invoked on type View Object with name ProjectViewObjVOImpl_19 at first line( setPA_name(ProjName);) setting in above stmts
is it correct what i m doing? if not can anyone guide me in this
Thanks in advance
Praveen
Edited by: user13584306 on Feb 6, 2012 3:20 AM

hi,
just go through the links
http://udayarocks.wordpress.com/2011/06/08/how-to-reuse-a-view-object-vo-for-different-search-criteria-in-multiple-pages-in-adf/
Set the view criteria bind variable from backing bean
http://adfpractice-fedor.blogspot.in/2011/08/how-to-apply-view-criteria.html
regards,
Ranjith

Similar Messages

  • 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

  • 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

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

  • How to apply common View criteria for all LOV View programatically?

    Hi,
    In my application I use nearly 100 VOs, which will be mapped as LOV to some base VOs. These VOs are not only for LOV but also will be used directly in screen as read-only table. All these VOs contains EFF_BGN_DTand EFF_END_DT. Requirement is to display only the active records in VO.
    We don't want to crete view criteria at design time for each and every VO. Instead we want to have a base ViewObjectImpl class, create at runtime and add this common criteria with the existing view criterias (If any given, which are actually required for the developer for screen specific functionality).
    NOTE: As all of our VOs are custom java data source implemented and none of them have queries, we cannot use whereclause API but only ViewCriteria.
    We want to create a view criteria, that somewhat looks like the below condition.
               (     (TO_CHAR( EffBgnDt, 'yyyy-mm-dd') <= '2010-02-01' )
                 AND (TO_CHAR( EffEndDt, 'yyyy-mm-dd') >= '2010-02-01' )
                 OR
               (     (TO_CHAR( EffBgnDt, 'yyyy-mm-dd') <= '2010-02-01' )
                 AND (EffEndDt IS NULL )
               )Question:
    1. Which is the best place in ViewObject class, where I will be able to create common view criteria, include it with existing criterias.
    Thanks in Advance.
    Raghu

    No it is not working. I've tested. When i test your implementation in my sample using AM tester, it is not at all going inside getCriteriaItemClause(ViewCriteriaItem pViewCriteriaItem). For example when i say, AM.findViewObject(String ViewObjectName), followed by getEstimatedRowCount(), it should apply common filter criteria and give me the result.
    Given below required scenario:
    Department table:
    ID     DEPT_NAME     START_DATE     END_DATE
    1     Hr          1-Jan-2010     
    2     Purchasing     1-Jan-2010     31-Dec-2010
    3     Shipping             1-Jan-2010     31-Dec-2055
    4     Sales          1-Jan-2010     
    Common criteria to be applied (Programatically) : :bind_current_date between StartDate and EndDate or :bind_current_date >= StartDate and EndDate is null
    VO specific view criteria (may vary VO to VO): DeptName not equal to 'Sales'
    Expected Result:
    Case 1:
             a. DeptView = AM.findViewObject("DepartmentVO")
             b. DeptView.getEstimatedRowCount()
              It should give me 3 records (Hr, Shipping, Sales)
    Case 2:
             a. DeptView = AM.findViewObject("DepartmentVO")
             b. Create View Criteria 'NotSalesDeptVC', which should not list out Sales department.
             c. Apply NotSalesDeptVC using RowSet rowSet = (RowSet) this.findByViewCriteria(NotSalesDeptVC, -1, ViewObject.QUERY_MODE_SCAN_VIEW_ROWS)
             d. rowSet.getEstimatedRowCount()
              It is in-memory filtering, will not disturb the default rowset, should give me 2 records (Hr, Shipping)
    Case 3:
             a. DeptView = AM.findViewObject("DepartmentVO")
             b. Apply 'NotSalesDeptVC' to the default row set, followed by executeQuery
             c. DeptView.getEstimatedRowCount()
              It should give me 2 records. (Hr, Shipping)
    Case 4:
             a. DeptView = AM.findViewObject("DepartmentVO")
             b. Unapply the applied 'NotSalesDeptVC', followed by executeQuery
             c. DeptView.getEstimatedRowcount()
              It should give me 3 records (Hr, Shipping, Sales)Essence is at any point of time, User should always work with active records. He no need to write extra logic to retrieve only the active records but the base Viewobject impl should have. Note, All of my view objects are custom java data source implemented and not query based. Similarly it does not meant that all of my VOs will be having some business specific View criteria. Some VOs may have. Some VOs may not have. However basic active records criteria is applicable for all VOs

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

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

  • Apply View criteria at runtime to child View object

    Hi,
    I am facing issues while trying to assign View Criteria to child VO that is part of View hierarchy at runtime.
    AM Model:
    Parent VO ->
    Child VO1
    -> Child VO2
    View Link between :
    Parent VO -> Child VO1
    Child VO1 -> Child VO2
    I have to apply View criteria at runtime at Child VO1 & Child VO2, i tried setApplyViewCriteriaName from AMImpl for these VO but that doesnt work.
    It works for Parent VO, So I concluded Apply VC doesnt work directly for Tree structure.
    I then override executeQueryforCollection in the VO however i am never able to get the handle for the VO that is getting executed :
    Here's what is happening when i fetch my VO tree from AM :
    - Parent VO , Child VO are getting instantiated
    - Parent VO executeQueryforCollection called
    - ** After this a new instance of Child VO is getting instantiated and i dont have any control of setting the VC based on some custom property
    as all get defaulted at this point.
    Please suggest what can be done in this case.
    PS : i can not hardcode the VC condition at View Link.
    - Sam

    I was able to set the VC condotinally based on property set at Parent level using following code in executeQueryForCollection :
    ApplicationModule am= this.getApplicationModule();
    ViewObject vo = am2.findViewObject("ParentView1");
    prop = (String)vo.getProperty("Parent_prop");
    if(propVo_prop.equals("Y"))
    this.setApplyViewCriteriaName("VC");
    super.executeQueryForCollection(object, object2, i);
    is this the right way ? Any performance bottleneck ? This service can be called for 1000 Id's .
    Please suggest if there is some better way.
    Thanks
    -Sam

  • How to set the default value of a LOV that is found in a view criteria

    HI,
    I need to set the default value of an LOV that is found in a view criteria. I tried to set a groovy expression but unfortunately it wasn't read. i also tried to bind the LOV to a bind variable and set the value of the bind variable in the constructor of my backing bean but unfortunately the default value appeared the second time i entered the screen and not on page load.
    Can anyone advise where can i set the default value,
    Thanks

    if you want some default value in LOV. you go to edit list of value wizard-> UI hint->include no selection Item checkbox -checked.use labeled item first of list- and beside that put the label. but when you try to get value, it will show null.but you can manipulate in ur java , if it default value

  • Outer join in view criteria: how to ?

    Hello,
    I have to create a VO for a LOV. I created in this VO a ViewCriteria to pass variables for the query.
    The problem is that for one of this variable I have to set the clause as an outer join.
    JDeveloper creates:
    SELECT MyView1.Item, MyView2.Code
    FROM MyView1, MyView2
    WHERE MyView1.ID = MyView2.EXT_ID (+)
    AND MyView1.Item = :TheItem
    AND MyView2.Code = :TheCodebut I need something like:
    SELECT MyView1.Item, MyView2.Code
    FROM MyView1, MyView2
    WHERE MyView1.ID = MyView2.EXT_ID (+)
    AND MyView1.Item = :TheItem
    AND :TheCode = MyView2.Code (+)

    ADFboy wrote:
    this is optional parameter value, in the view criteria windows is this option....
    AdfBoyNo, this parameter is not optional because, in the call of the LOV it will be always set.
    But the query without the outer join returns too few rows...
    I tried to find where to "intercept" this programmatically, but I'm failing doing this. :(
    I'll have the same problem with another field, not for a LOV but to get the value of an attribute of a VO.
    Even in advanced mode the Where clause can't have parameters...

  • How to change the view criteria at run time for af:query

    Hi,
    I've a usecase where I need to change the view criteria of the af:query at run time.
    Use case:
    =======
    1) Consider a check box (Show Emps Under Dept 10) in the query panel when user selects and clicks 'Search' button should show the employees under dept 10. If user searches without selecting the check box, the results should show all the employees in all the departments.
    2) I need to have a check box always in the query panel. Its mandatory.
    The way I implemented:
    ==============
    1) Created a transient variable 'Show Emps Under Dept 10' in the EmployeeVO and also created a bind variable bind_DeptNo.
    2) Create a view criteria 'AllEmployees' which has only the transient attribute as the view criteria item and whose value set to 'false' by default.
    3) Created another view criteria 'EmpUnderDept' which has 'DepartmentId' as the view criteria item and whose value set to the bind variable 'bind_DeptNo'.
    4) Dropped the view criteria 'EmpUnderDept' as the 'af:query' panel in the jspx page.
    5) Overridden the queryListener as '#{EmpBean.empSearch}'
    6) Has the below code in the empSearch method as below. When user selects the check box, applying the other criteria 'EmpUnderDept' and setting the bind variable to '10'.
    public void empSearch(QueryEvent queryEvent) {
    // Add event code here...
    QueryDescriptor queryDesc = (QueryDescriptor) queryEvent.getDescriptor();
    ConjunctionCriterion conCrit = queryDesc.getConjunctionCriterion();
    List<Criterion> criterionList = conCrit.getCriterionList();
    List criterionValues = new ArrayList();
    Object criteriaValue = null;
    int criteriaNo = 0;
    DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    FacesContext facesContext = FacesContext.getCurrentInstance();
    for (Criterion criterion : criterionList) {
    AttributeDescriptor attrDescriptor = ((AttributeCriterion)criterion).getAttribute();
    System.out.println("============== attrDescriptor.getName() =================== " + attrDescriptor.getName());
    criteriaValue = ((AttributeCriterion)criterion).getValues().get(0);
    if(criteriaNo==0) {
    Boolean val = (Boolean) ((AttributeCriterion)criterion).getValues().get(0);
    if (val.equals(true)) {
    OperationBinding method = (OperationBinding) ADFUtil.findOperation("ExecuteWithParams");
    if(method!=null) {
    Map params = method.getParamsMap();
    //params.put(key, value)
    method.getParamsMap().put("bind_DeptId", 10L);
    method.execute();
    ADFUtil.invokeMethodExpression( "#{bindings.EmpUnderDeptCriteiaQuery.processQuery}", queryEvent);
    } else {
    //ADFUtil.invokeEL("#{bindings.ExecuteWithParams.execute}");
    ADFUtil.invokeMethodExpression( "#{bindings.AllEmployeesCriteriaQuery.processQuery}", queryEvent);
    But this approach is not working and its always showing all the employees in all the departments.
    Please let me know if there is a way to change the view criteria at run time depending on the values set at run time for one of the view criteria items.
    JDev version am using is '11.1.1.5'
    Thanks,
    Lakshman

    Hi Shay,
    It worked for me without overriding the executeQuery() method in the ViewImpl.java.
    Instead of creating 2 view criteria, I created only one which has both transient variable and the DepartmentId = <bind_DeptId>. With the above code, it worked properly. Now I am using only one view criteria.
    Thank you.

  • Bug in View Criteria for EXISTS operator

    Hello!
    I have two VO:
    DEP (ID, TITLE, STATUS)
    EMP (ID, ID_DEP, NAME)
    and viewlink DEP.ID <- EMP.ID_DEP
    in DEP VO i create view criteria and add two items:
    * DEP.STATUS <> 1000
    * the EMPVO with EXISTS operator (and after that add condition EMP.NAME contain :nName (bind var))
    start app, set "john" in search field, press button "search" and in debug console i found sql for searching in DEP:
    SELECT *
    FROM (SELECT DEP.ID,
    DEP.TITLE,
    FROM DEP DEP
    where (DEP.STATUS is null OR DEP.STATUS <> 1000)) QRSLT
    WHERE ((((EXISTS (SELECT 1
    FROM EMP EMP
    WHERE ((UPPER(EMP.NAME) LIKE
    UPPER('%' || :nName || '%')))
    AND (ID = EMP.ID_DEP))))))
    in last row present error, must be:
    AND (QRSLT.ID = EMP.ID_DEP))))))
    coz if no "QRSLT", sql parser think what need compare EMP.ID and EMP.ID_DEP.
    Present in JDeveloper 11.1.1.2.0, 11.1.1.3.0.

    We have implemented our own ViewCriteriaAdater (derived from oracle.jbo.server.OracleSQLBuilderImpl) and some custom properties to handle this. Overwrite the getFormattedRHSCompareFragment to your needs.
    Btw. I think this posting should go to the JDev forum.

  • Blog post : "Bug in Create/Edit View Criteria Wizard (JDeveloper 11g)"

    hi
    Using steps 1 to 13 from the blog post "Bug in Create/Edit View Criteria Wizard (JDeveloper 11g)" by Andrejus Baranovskis, I have been able to reproduce the issue he describes.
    see http://andrejusb.blogspot.com/2008/12/bug-in-createedit-view-criteria-wizard.html
    I the blog post comments he writes "... there was no time for me to fill bug in Metalink ...".
    Maybe someone from Oracle can pick it up from this forum post and file it as a bug if it is one (and if possible post the bug number here).
    many thanks
    Jan Vervecken

    The mechanism is to create a reproduceable test case, create a Service Request in metalink.oracle.com, post the test case, and convince the analyst to file it as a bug.
    It may be not efficient at some time, but this the way it is handled.
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

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

  • Issue in Creating an "EXISTS" View Criteria

    Hi,
    Jdev -11.1.1.5.0
    Following is the usecase to apply 'Exists' View criteria.
    We have one NodesEO and two VOs (NodesVO & TopicsVO) which are from same NodesEO.
    NodesVO=> Used to form tree structure . Filtering topics with topic_type is null
    SELECT * FROM MD_TOPICS NodesEO WHERE NodesEO.TOPIC_TYPE is null and doc_name is not null ORDER BY NodesEO.DOC_NAME
    TopicsVO=> Used to prepare ADF table based on selected tree nodes. Filtering nodes with topic_type is not null
    SELECT * FROM MD_TOPICS NodesEO WHERE NodesEO.TOPIC_TYPE is not null
    Issue: As of now, iam preparing list of selected nodes from tree and then sending the comma separated string to IN clause.
    As there is limitation for maximum number of expressions in a list is 1000.
    Iam trying to Create an 'EXISTS' View Criteria. So i got reference to implement the same.
    http://one-size-doesnt-fit-all.blogspot.in/2011/02/adf-bc-creating-exists-view-criteria.html
    Look like, we need to have ViewLink to create EXISTS VC. I tried to create VL from TopicsVOToNodesVO. At the end, I dragged the TopicsVO instance as a table on jsff.
    Here iam unable to filter the rows from NodesVO based on checkbox status.
    Iam using transient attribute (checkboxConfirmedStatus- String, checkboxCOnfirmed- boolean). Here i've applied VC on transient attribute by selecting 'In memory' option.
    At run time, iam getting exception.
    <QueryCollection> <buildResultSet> [1729] java.sql.SQLException: Attempt to set a parameter name that does not occur in the SQL: bind_checkboxConfirmed
    Please suggest any option to filter the rows from NodesVO based on checkbox (transient attribute) status before applying 'Exists' clause.
    Let me know, if I am in wrong process.
    Thanks in advance,
    Samba.

    Can some one suggest on our issue?
    Thanks,
    Samba.

Maybe you are looking for

  • Extended notifications - Shortcut

    Hi Friends,   We have configure extended notifications for Workflow and it is working fine. The issue which we are currently facing is when the notification comes to Outlook inbox and when we try to open the attachment to execute the work item the SA

  • IX4-300d - UPS, not showing in management, but sends messages if I connect and disconnect

    Just acquired a iX4-300d, and updated to the latest firmware (4.1.104.31360). On trying to link a UPS (a KSTAR BM-3080) - the UPS Management page just shows "Status: None Connected" BUT -  in the EVENT LOGS panes I get the following message: Event 44

  • JSF 1.2 and Tiles integration

    I have a web application using JSF 1.1 and Tiles that I am trying to upgrade to run using JSF 1.2. It is working as far as working out that it should use the tile, but then it all seems to fall over when trying to render. Does anyone know if it is po

  • Ati driver install warning unexpected token `}'

    /var/lib/pacman/local/ati-drivers-8.22.5-4/install: line 32: syntax error near unexpected token `}'     do I need to worry about this

  • How to tether my iPhone 5 with iPad air?

    How can i tether my (iPhone 5 iOS 7.1 latest) to iPad air. My personal hotspot is disable in my setting i cant click on personal hotspot option. I am using 3G on iPhone and i want to use that 3G on iPad air wifi model please help me.