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?

Similar Messages

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

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

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

  • Set view criteria on af:query choice LOV field

    i have an af:query. one of the fields is a choice. the LOV for the choice come from a VO. i need to set view criteria for the query for the LOV for the choice. that is, the query for the values of the choice requires view criteria.
    moreover, that search criteria is only known by the view. because the hooks for the choice are set up entirely in the model, i don't see how it would ever be possible to use values from the view to define the query for the LOV for the choice.
    any ideas?

    Assuming that you can have a method at the AM level that sets the viewCriteria for your VO, you can drag this method to the page flow to be executed before you go into the query page - this will set the right condition for the list that needs to populate the LOV.
    Then the query component can use that VO as an LOV like this:
    http://blogs.oracle.com/shay/2009/12/adf_query_with_parameters_and_1.html

  • Multiple queries happeing in adf query component using LOV

    Hi,
    I am using a programmatic view object in adf query component and have created List of values for one attribute by adding another programmatic ViewObject as ViewAccessor.
    To populate the lov ViewObject, i have overwritten the method executeQueryForCollection in which i call the webservice to fetch the data. So lov is working fine inside QueryComponent.
    I have overwritten queryListener attribute of query component in my backing bean. In the queryListener method, to populate the result grid, am populating the view object by using createRow and insertRow apis. While doing so, Whenever i do setAttibute for the lov field, the overwrittern method executeQueryForCollection getting invoked. Hence my webService getting invoked. So if i have 10 rows, the webservice is getting invoked 10 times.
    I put sops in the executeQueryForCollection method for the queryMode and getName.
    System.out.println("executeQueryForCollection::::"+this.getQueryMode()); i get as 7
    System.out.println("executeQueryForCollection:::=" +this.getName());    i get as  CurrencySummaryLOVVO_5708_findByVC_   The number 5708 varies for every row.
    Please tell me How to avoid invoking the executeQueryForCollection everytime when i do setAttribute.
    One workaround i have currently is to have one dummry attribute for the lov which can be used for display in grid and actual attribute will be used in Query Component for the lov to function.
    Is there any other better workaround?
    Thanks a lot in Advance.
    Vivek
    Edited by: Vivek Singh on Oct 22, 2009 9:16 PM

    When you set a value to LOV field it tries to validate it from the LOV data. thats why it execute query.
    Try setting Row Level Bind Values = false for the accessor.
    yet, i would suggest to find an other way to populate values of LOV since the executeQueryForCollection will be executed many times when you use that LOV:
    [http://adfbugs.blogspot.com/2009/08/lov-execute-query-many-times.html]

  • Refreshing ADF Query Component after changing some property of a criteria

    Hi All
    Use Case : Refreshing ADF Query Component after changing some property of a criteria attribute.
    I have a query panel with 2 query criteria i.e. FirstName and DepartmentId where in DepartmentId is a drop down. The scenario is like when change the value of DepartmentId to 'Finance' with code value of '100' then my criteria attribute 'Firstaname' should be invisibe(queriable=false).
    Approach: Have overriden the queryOperationListener of adfquery as " queryOperationListener ="#{backingBeanScope.backing_queryLstener.processQueryOperation}" "
    My backing bean method goes as below :
    public void processQueryOperation(QueryOperationEvent queryOperationEvent) {
    // Add event code here...
    if( queryOperationEvent.getOperation().equals(queryOperationEvent.getOperation().CRITERION_UPDATE) ){
    DCBindingContainer bindings = (DCBindingContainer)this.getBindings();
    DCIteratorBinding iter =bindings.findIteratorBinding("EmployeeView1Iterator");
    ViewObjectImpl voimpl = (ViewObjectImpl)iter.getViewObject();
    ViewCriteria vc = voimpl.getViewCriteriaManager().getViewCriteria("EmployeeViewCriteriaDemo");
    Row currRow = vc.first();
    System.out.println("Department :"+currRow.getAttribute("DepartmentId"));
    if( (Integer)currRow.getAttribute("DepartmentId") ==100 ){
    AttributeDef[] attrs = voimpl.getAttributeDefs();
    int attrIndex = voimpl.getAttributeIndexOf("FirstName");
    ViewAttributeDefImpl attrDef = (ViewAttributeDefImpl) attrs[attrIndex];
    attrDef.setQueriable(false);
    // AdfFacesContext.getCurrentInstance().addPartialTarget(getQryId1()); //here i need to refresh the query component which is not happening
    // refreshQueryComponent(getQryId1());
    Everything is happening as expected but the query panel s not get refreshed.When i refresh the whole link/page then i can see the change.
    Please suggest.
    Thanks in adv.
    -Sanjeeb

    Hi,
    can's say anything about the first part of the question as more insight to the implementation would be required. However, have a look at http://www.oracle.com/technetwork/developer-tools/adf/learnmore/83-bidi-synchronization-tree-form-401841.pdf, which may be what you are looking for
    To the second part: You can programmaticallly refresh the tree component from a managed bean. So instead of using the declarative PPR option (or ChangeEventPolicy set to PPR on the iterator binding) you can wire the submit button to the managed bean, perform your validation and if it fails don't refresh teh tree
    The call is
    AdfFacesContext.getCurrentInstance().addPartialTarget(the_tree_instance)
    Frank

  • Set view criteria in ViewObject

    Studio Edition Version 11.1.1.3.0
    I like to set view criteria in my view object implementation, but not work. the vc=getViewCriteria(crit) return not null but the attribute are not found
      public void setViewCriteriaAttr(String crit, String attr, Object o){
        ViewCriteria vc = getViewCriteria(crit);
            if (vc != null) {
              ViewCriteriaRow vcr = (ViewCriteriaRow)vc.first();
              while (vcr != null) {
                String criteria = (String)vcr.getAttribute(attr);
                if (criteria != null) {
                  vcr.setAttribute(attr,o);
                vcr = (ViewCriteriaRow)vc.next();
      }Thx for help
    Thomas
    Edited by: thietho on 10.01.2011 12:11

    Hi,
    works for me, so the problem seems to be the way you call the method. Do you apply the VC somwhere in your code?
    Frank

  • How can set the timestamp format in query component?

    I met 2 problems when I am using timestampTZ on query component.
    The first one, in the table, I have a field type is timestampTZ. And I have a query on this field. However, When I open the page, I found the date format is not what I want, can I change the format in the query component? Like from “mm/dd/yyyy” to “dd/mm/yyyy” in the search criteria. For the query component. I used bing variable. The bing variable I set to timestampTZ type.
    Another problem is, as in the database, the time has date and time, but in the query component, it only has date, so if I added a end date field, it only show the records before the end date. I think the parameter take the time as 00:00:00. Is there any way to fix this?
    Thanks a lot.

    Thanks a lot. I tried, but still not work, I can see the date with time. But I tried to execute the query, it threw exception (with/without date value). Is that because the field in database is timestampTZ?
    <RegistrationConfigurator><handleError> Server Exception during PPR, #1
    java.lang.ArrayIndexOutOfBoundsException: 7
         at oracle.sql.TIMESTAMP.toTimestamp(TIMESTAMP.java:294)
         at oracle.sql.TIMESTAMP.timestampValue(TIMESTAMP.java:431)
         at oracle.jbo.domain.Timestamp.getData(Timestamp.java:433)
         at oracle.jbo.domain.Timestamp.getValue(Timestamp.java:421)
         at oracle.adfinternal.view.faces.convert.DomainConverter.convert(DomainConverter.java:67)
         at org.apache.myfaces.trinidadinternal.convert.GenericConverterFactory.convert(GenericConverterFactory.java:287)
         at org.apache.myfaces.trinidadinternal.convert.DateTimeConverter.getAsString(DateTimeConverter.java:95)
         at oracle.adfinternal.view.faces.renderkit.rich.ValueRenderer.getConvertedString(ValueRenderer.java:158)
         at oracle.adfinternal.view.faces.renderkit.rich.OutputTextRenderer.encodeAll(OutputTextRenderer.java:148)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:765)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2567)
         at oracle.adfinternal.view.faces.renderkit.rich.table.BaseColumnRenderer.renderDataCell(BaseColumnRenderer.java:1213)
         at oracle.adfinternal.view.faces.renderkit.rich.table.BaseColumnRenderer.encodeAll(BaseColumnRenderer.java:103)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:765)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2567)
         at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer.renderDataBlockRows(TableRenderer.java:1932)
         at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer.encodeAll(TableRenderer.java:606)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:765)
         at org.apache.myfaces.trinidad.component.UIXCollection.encodeEnd(UIXCollection.java:529)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2567)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:297)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:574)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:241)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:765)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2567)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeCenterFacet(PanelStretchLayoutRenderer.java:297)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer._encodeCenterPane(PanelStretchLayoutRenderer.java:574)
         at oracle.adfinternal.view.faces.renderkit.rich.PanelStretchLayoutRenderer.encodeAll(PanelStretchLayoutRenderer.java:241)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:765)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1515)
         at org.apache.myfaces.trinidad.component.UIXGroup.encodeChildren(UIXGroup.java:138)
         at org.apache.myfaces.trinidad.render.RenderUtils.encodeRecursive(RenderUtils.java:57)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:410)
         at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2567)
         at oracle.adfinternal.view.faces.renderkit.rich.DecorativeBoxRenderer.encodeFacet(DecorativeBoxRenderer.java:289)
         at oracle.adfinternal.view.faces.renderkit.rich.DecorativeBoxRenderer._encodeCenterPane(DecorativeBoxRenderer.java:442)
         at oracle.adfinternal.view.faces.renderkit.rich.DecorativeBoxRenderer.encodeAll(DecorativeBoxRenderer.java:258)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
    ...

  • 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 different view criterias to af:query based different situations

    Hi all;
    Lets say i have 3 different view criterias ....and i want to apply only one of them to af:query based user's role....
    I dont have an idea how to do that...My only clue is my supervisor mentioned to me i can use page definition to do that;
    <searchRegion Criteria="DepartmentViewCriteria" Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                      Binds="DepartmentView1Iterator" id="DepartmentViewCriteriaQuery"/>Can u help me on this matter please!
    If post is too shallow to understand i can elaborate more...
    jDeveloper 11.1.2.1.0
    Oracle DB 11g

    Create a custom public method in yr applicationmoduleImpl class. Get the viewcriteria of target vo or programmatically create yr viewcriteria.
    Based on current loggedInUser role which can be access by ADFContext.getCurrent().getSecurityContext().getUserRoles(), u can apply specific viewcriteria on VO.
    After that u can follow this link - http://dstas.blogspot.com/2010/09/adf-11g-methodaction-and-invokeaction.html, from +"We will now expose the method in the client interface of the AM"+ teopic.
    At the end u will be able to execute this method from pagedef file, whenever u enter to this page.
    Hope this helps.

  • ADF Query Panel for Dynamic VO.

    Hi All,
    i am using jdev version 11.1.1.5.0.
    In my use case i have created one dynamic VO because table and no of column decided run time. now i want to provide filter on that vo using Named view criteria as ADF query panel.
    but column and table decided run time. So can i create dynamic query panel(View Criteria) run time?
    or Is there any another way to achieve my requirement?
    Thanks in Advance.

    Hi Manish,
    not sure if this is what you are looking for, but you can have dynamic viewcriteria in a search region.
    In the searchregion binding in the pageDefenition simply use an EL Expression to determine what criteria to use.
    <searchRegion Criteria="#{pageFlowScope.startupMode eq 'mgr' ? 'CriteriaForManager' : 'CriteriaForEmployee'}"               
                         Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"               
                         Binds="EmployeesView1Iterator"                
                         id="CriteriaForManagerQuery"/>  I explained it on my weblog : http://lucbors.blogspot.nl/2011/10/in-my-current-project-use-lot-of-re.html
    Good luck,
    Luc

  • Setting default value read from user session, for an LOV in Query component

    I want to set the default value of a field in VO that participates in a named view criteria and thereby in Query component. That field is configured with an LOV by mean of a view accessor. The values are Y and N and the corresponding display strings obtained from view accessor are true and false respectively.
    I am able to set the default value by setting the value of the criteria item corresponding to that field in view criteria. I am setting the value as either Y or N and I am able to corresponding display string as per the view accessor, on the query component when it is rendered.
    I want to read the defauilt value from the ADF BC user session and set it as default value. I tried setting the values as "adf.userSession.userData.usageFlag". Iam ensuring that the attribute usageFlag is set before the view activity that has the query component is invoked. But this is ending up showing no default value in the Query component when rendered.
    Can any one let me know how to go about with this?

    I made up your table since you didn't provide some example, but I'm sure this will give you the picture:
    SQL> var run_type varchar2(1)
    SQL> exec :run_type := 'A'
    PL/SQL procedure successfully completed.
    SQL> create table my_cycles as select level cycle_id
      2                            ,      level cycle_status
      3                            from   dual connect by level <= 5;
    Table created.
    SQL> select cycle_id
      2  from   my_cycles
      3  where  case
      4           when :run_type = 'D' and cycle_status  = 1 then 1
      5           when :run_type != 'D' and cycle_status  in ( 2, 3 ) then 1
      6         end = 1;
      CYCLE_ID
             2
             3
    2 rows selected.
    SQL> exec :run_type := 'D';
    PL/SQL procedure successfully completed.
    SQL> /
      CYCLE_ID
             1
    1 row selected.
    SQL>

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

  • Applying distinct to a query search panel view criteria

    I have a VO that returns multiple instances of the same project code...In the ADF query panel I only need to display a distinct set of these project codes...
    When building a simple ADF query panel based on a view criteria declaratively the project codes will repeat themselves in the select one choice component of the query panel.
    What is the best way to apply a distinct to a view criteria of this sort?
    Thanks in advance.

    Hi
    Edit query- Select Sql Mode to "Expert" and manually change the query.
    M Niaz

  • LOV view criteria missing in af:query field when AM pooling is disabled

    Hi all,
    Again, another strange behaviour with fields in af:query when AM pooling is disabled.
    I have a field with a LOV in the af:query area. This LOV has a view criteria that involves a bind variable. In the VO, the view accessor for this LOV applies the view criteria and sets the bind variable. When AM pooling is disabled, double clicking a row or clicking the OK button in the LOV window removes the where clause defined by the view criteria. When activation occurs, the bind variable still exists but the framework doesn't know where to apply it...
    Any help will be very appreciated,
    Thanks
    JDeveloper 11.1.1.3.0 with ADF BC
    We've just realised that this behaviour occurs even when pooling is enabled. So this is becoming now a serious problem.
    The scenario is as following: We have two LOVs in the search area (af:query). One of them is dependent on the other. Then, this second LOV has a view criteria and a bind variable representing the value selected for the first LOV. The query for the second LOV is filtered properly, but once a value has been selected and the LOV window dismissed, nothing is returned to the field.
    We have observed that SecondLovViewImpl.executeQueryForCollection() method executes twice:
    1. When LOV is opened: here, the bind variable is correctly setted.
    2. When a row in the LOV table is selected: here, the bind variable is reset to null.
    The log says (in Spanish):
    <OracleSQLBuilderImpl><bindParamValue> [46062] Binding null of type 12 for "bindProgram"
    <FacesCtrlLOVBinding$ListOfValuesModelImpl><_getRowFromSelectedRowKey> ADFv: No se ha encontrado ninguna fila para rowKey: [oracle.jbo.Key[P1 SP11 ]].
    I would be very grateful if somebody asked me... even for saying "this is nonsense", "this is a known bug", "cascading LOVs are not supported by af:query", or anything else... If a code snippet is required, I'll put it as well.
    Thanks in advance
    Edited by: Marge on 02-sep-2010 5:41

    Hi,
    there are two bugs associated with bind variables in successors that I am aware of. One of them is supposed to be fixed in the next patch set, another one is still open. However, both problems were found with AM pooling enabled as well, so I don't know this is the same problem (though it sounds like). If you can, I suggest to create a reproducible testcase on one of the Oracle database schema, like HR or OE, and file a bug. If you don't have a time for or access to support, send the test case in a zip file (rename ".zip" to ".unzip") to the mail Id you find in my OTN profile. However, be aware that when I file the bug then it wont be visible for you, nor can it be escalated on your behalf. Anyway, at least it would get filed
    Frank

  • Looking for hook into a mb method on page load of jsff with auto query on view criteria.

    Hello,
    I have a View Criteria that is set to Query Automatically (showing data to match today's date).  The target table has a detail table and there is a control that shows parsed XML from the current row in the detail table into a table that I build dynamically. The main table and the detail table show the proper data on page load but the table for the parsed XML is empty.  The dynamic table is bound to a managed bean where the parsing is done and data is created.  I have the control refreshing properly on a row change of the main and detail tables and on a queryListener for the view criteria.
    This is for a jsff page. I have been trying a bunch of approaches with no success.  The detail table has a ppr to the main table and the query.  I am looking some event on either the query, the main table or the detail table where I can make a call to my managed bean to parse the XML, build the table and refresh the control.  I have an attribute binding to the XML data (when I placed it in a control as plane XML it refreshed properly).  I only need this on initial page load or first time the tables are populated, I have the other use cases covered.
    Running JDev 11.1.2.4
    Thank you
    Rudy

    ok but where?
    i have read a topic about "setRefreshOption", but i need a component to execute it.
    i have read a topic about a false criteria (1=2), and when i want search, i remove it, but again, i need a component to execute it.
    i have read a topic about ${adfFacesContext.postback == true} to write into iterator proeprty, but i haven't this view into my appmodule.
    i'm really sorry, but please, can you explain me a little ?
    Edited by: bradici on 8 oct. 2009 16:36

Maybe you are looking for

  • Printing a PDF in booklet form

    Is it possible to print a PDF document in a booklet form? I have a 28 page document that i'd like in A5 booklet, but can't find any options for booklet printing. Is this because my printer doesn't support booklet printing, or do you have to use speci

  • Ill CS6 not saving files properly

    When closing a file it will save the file without asking if you want to save changes. Have deleated the prefs. multi times. still doing it. Really messing me up with changes to my files that i don't want to save. Any help appricated. CPI Mac 33

  • Move Media Player for MAC - ABC and FOX TV

    I have followed all the instructions from a post a while back, but I have had no luck in downloading the Move Media Player so that I can watch ABC and FOX online. Can you please give me some assistance? I have updated all the drivers, flash players,

  • I updated my ipad from 5.1 to 5.1.1 and does it delete everything ?

    I disconnected my ipad 1 cause i though it was gonna delete everything and it did . i have icloud too and i had 1,100 some pics in my ipad. did icloud saved those pictures ? thats the only thing im asking thanks :/ and i have imessage too did that sa

  • IPod won't load songs

    Since upgrading to iTunes 5.0.1, I can't load songs on my iPod. I did disk utility, reset to factory settings and now it will load a few songs then hang up. Tried auto update, manual and still the same. Loads a few songs and then locks up. Tried it w