ER: ADF BC VO View Criteria bind parameters
Hi JDev team
I made an interesting mistake with the new VO View Criteria today in ADF BC under TP4.
Some days ago in an existing project I'd created a SQL-Read-Only VO, and a View Criteria with a bind variable expression (x = :pMyVar).
Today, on revisiting the VO, I noticed that my query didn't have the bind variable in the query. I thought I'd accidentally deleted the associated where clause expression (containing the bind variable) out of the query, not realising that the bind variable was used by the view criteria expression which isn't visible in the query.
As such as a suggestion, within the VO document window Query subwindow, is there some sort of visual indication you can add to the Bind Variables list to indicate it's used by a view criteria or otherwise the main query (or both)? This could save developers from some silly mistakes.
Cheers,
Chris Muir.
Thanks Steve.
CM.
Similar Messages
-
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 AMhi,
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 -
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?
ThanksThere 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. -
Using SYSDATE in Pre-Defined View Criteria ADF BC
I’m trying to setup a View Criteria to find records between two dates. So I create a View Criteria and Select my date field from the table and then choose the “Between” operator and then my operand is a Bind Variable. Then in my Bind variables I have SYSDATE and SYSDATE-7. So in my view.xml I have the following:
<Variable
Name="SystemDate"
Kind="viewcriteria"
Type="java.sql.Date">
<TransientExpression><![CDATA[SYSDATE]]></TransientExpression>
</Variable>
<Variable
Name="Bind_SystemDateMinusSeven"
Kind="viewcriteria"
Type="java.sql.Date">
<TransientExpression><![CDATA[SYSDATE-7]]></TransientExpression>
</Variable>
However, when I try to run this View Criteria (using on an af:query component), I get the following error.
Messages for this page are listed below.
Error
Unexpected exception caught: java.lang.reflect.UndeclaredThrowableException, msg=null
Error
Name SYSDATE not found in the given object: ViewRow [oracle.jbo.Key[877 ]
Does anyone know how to do this using ADF BC and View Criterias? I've tried making my bind variables Strings and this doesn't work either. I basically want a predefined query that finds records within a specific week given the system date. Any ideas on how to make this work? Thanks.You can achieve SYSDATE in ADF BC View Criteria using IsSqlFragment="true".
Below is the VO source code snippet for the same.
<ViewCriteriaItemValue
Name="ViewObjCriteria_ViewObjSubCriteria1_vcrow40_HireDate_vcval0"
Value="sysdate-350" IsSqlFragment="true"/>
<ViewCriteriaItemValue
Name="ViewObjCriteria_ViewObjSubCriteria1_vcrow40_HireDate_vcval1"
Value="sysdate" IsSqlFragment="true"/>
</ViewCriteriaItem> -
Bind graph to "View Criteria adf form - table "
Hello
I;m trying to bind the data from a result table of a view criteria to a bar graph. Until now with no luck . When I use the same binding , when i run jsf page i get the following errors
Target URL -- http://127.0.0.1:7101/testWeb-ViewController-context-root/faces/untitled1.jspx
<10 Αυγ 2010 12:31:17 μμ EEST> <Error> <HTTP> <BEA-101020> <[ServletContext@18476965[app:testWeb module:testWeb-ViewController-context-root path:/testWeb-ViewController-context-root spec-version:2.5]] Servlet failed with Exception
java.lang.ClassCastException: oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel cannot be cast to oracle.adf.view.faces.bi.model.DataModel
at oracle.adf.view.faces.bi.component.dataView.UIDataView.getDataModel(UIDataView.java:590)
at oracle.adfinternal.view.faces.bi.renderkit.graph.RichGraphRenderer.getImageViewDataModel(RichGraphRenderer.java:814)
at oracle.adfinternal.view.faces.bi.renderkit.imageView.RichImageViewRenderer.encodeAll(RichImageViewRenderer.java:733)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
Truncated. see log file for complete stacktrace
>
<10 Αυγ 2010 12:31:17 μμ EEST> <Notice> <Diagnostics> <BEA-320068> <Watch 'UncheckedException' with severity 'Notice' on server 'DefaultServer' has triggered at 10 Αυγ 2010 12:31:17 μμ EEST. Notification details:
WatchRuleType: Log
WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
WatchData: DATE = 10 Αυγ 2010 12:31:17 μμ EEST SERVER = DefaultServer MESSAGE = [ServletContext@18476965[app:testWeb module:testWeb-ViewController-context-root path:/testWeb-ViewController-context-root spec-version:2.5]] Servlet failed with Exception
java.lang.ClassCastException: oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel cannot be cast to oracle.adf.view.faces.bi.model.DataModel
at oracle.adf.view.faces.bi.component.dataView.UIDataView.getDataModel(UIDataView.java:590)
at oracle.adfinternal.view.faces.bi.renderkit.graph.RichGraphRenderer.getImageViewDataModel(RichGraphRenderer.java:814)
at oracle.adfinternal.view.faces.bi.renderkit.imageView.RichImageViewRenderer.encodeAll(RichImageViewRenderer.java:733)
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:751)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2572)
at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:1963)
at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer._renderPane(PanelSplitterRenderer.java:1044)
at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer._renderSecondPane(PanelSplitterRenderer.java:943)
at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer.encodeAll(PanelSplitterRenderer.java:197)
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:751)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2572)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:432)
at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:221)
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:751)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:415)
at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:2572)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:432)
at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1066)
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:751)
at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1501)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:771)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:710)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:273)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:205)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
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 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)
SUBSYSTEM = HTTP USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '12' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-101020 MACHINE = charakopouloslap TXID = CONTEXTID = TIMESTAMP = 1281432677055
WatchAlarmType: AutomaticReset
WatchAlarmResetPeriod: 30000
>
Obviosly what I'm doing is wrong. How can i do what want ?
ThanksHi,
try applying the ViewCriteria to the View Object instance in the ADF BC ApplicationModule Data Model. Create a new instance of the ViewObject and use the configuration button above the selection area to assign a ViewCriteria to this VO. Then build a graph on top of it
Frank -
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. -
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
VenkateshHi 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 -
Label of attribute when used as View Criteria item with Bind Variable
I've a VO attribute used in a named search with this requirement:
The attribute provides has an optional View Criteria item that has a bind variable operand. The bind variable is in the WHERE clause. The attribute has an LOV. The choice list for the specified View Criteria item should display the label "Effective Release". However, in all other contexts, including the search results table and the dropdowns the user can optionally add in an advanced search, the label displayed for the attribute must say "Release".
In other words, the default label for the attribute should be "Release" in all but one context - which is that when the dropdown list for the viewCriteria item using the bind variable is displayed, the label should say "Effective Release".
Note that if the user moves to Advanced Search and selects adds the attribute as a search criteria, this latter usage should be labeled as "Release". (in this case, in other words, the dropdown that displays by default and has the bind variable operand is labelled "Effective Release", the one the user added in advance search is labelled "Release")
here is the View Criteria item source xml:
<ViewCriteriaItem
Name="ReleaseId1"
ViewAttribute="ReleaseId1"
Operator="="
Conjunction="AND"
Value=":v_ReleaseId"
GenerateIsNullClauseForBindVars="false"
ValidateBindVars="true"
IsBindVarValue="true"
Required="Required"/>I've experimented by putting "Effective Release" as the label for the bind variable as below. However, ADF does not use that value to display, it defers to the attribute value:
<Variable
Name="v_ReleaseId"
Kind="viewcriteria"
Type="oracle.jbo.domain.Number">
<Properties>
<SchemaBasedProperties>
<LABEL
ResId="EFFECTIVE_RELEASE_LOV"/>
</SchemaBasedProperties>
</Properties>
</Variable>The reason for the requirement, if it matters, is that the View Criteria item with the bind variable ("Effective Release" queries a range of values using the analytic function rank(); the bind variable is in the WHERE clause. Otherwise, the dropdown that can be added in advanced search ("Release") looks for exact matches on the attribute value. So since the search functionality is different, the label should be different.
Am using 11g.
Thanks for your help.Hi
I have found that when using validation type Key Exists and the VO is in the local application, then the bind variable is available in the Create Validation wizard. When I try and create a validator on a VO that is core to all my applications, then I put that VO into an ADF library, the bind variable parameter is not available for mapping to my entity object attribute, even though I can select the VO to create a view accessor from the ADF library.
Possible bug? -
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 KHi,
Thanks for the update and it is working perfectly fine.
Now, how can I set the "ignore null values" option as checked if I am constructing the criteria programmatically using view criteria row and view criteria item at runtime.
Thanks and regards,
Guru K -
View Criteria 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,
SambaThanks 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? -
ADF 11.1.13 View Criteria
suppose the following senario in ADF 11.1.1.3
i want to add a view criteria on an Date attribute such it value between to values
using befor and after condition not between (to enable one of value is null)
but the ADF give out of index error when i try to edit the criteria next time and i can't run itNot sure, but you may have hit bug 9245990 (or a variant of it). This happens if you use the same attribute twice in one view criteria. It should be fixed in 11.1.2, so you either update to this version, ask for a back port to your version or use this workaround:
1) create one view criteria for the before part
2) create one view criteria for the after part
3) create the final view criteria combining 1) and 2)
Timo -
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
- HarishHi.
Welcome to OTN.
Check this http://www.oracle.com/technetwork/developer-tools/adf/learnmore/44-restrict-lov-169186.pdf -
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?
-
ADF View Criteria on a Read Only View Object
Hi,
I have created a read only view object using a query. The query consists of analytical functions to fetch the AVG values dynamically.
So far my approach worked fine.
I want the Average values in my query to be calculated dynamically based on the certain view criteria.
But after applying view criteria, my query is formulated as shown below:
SELECT * FROM (SELECT RECEIVED_YEAR,
WEEK_NO,
NO_RECEIVED,
NO_STARTED,
ROUND (TO_NUMBER (REPLACE (AVG_HRS_TO_START, ':', '.')),2) AVG_HRS_TO_START,
ROUND (AVG (TO_NUMBER (REPLACE (AVG_HRS_TO_START, ':', '.'))) OVER (ORDER BY RECEIVED_YEAR),2) OVERALL_AVG_HRS,
GOAL_HRS,
ROUND (AVG (NO_STARTED) OVER (ORDER BY RECEIVED_YEAR), 2) AVG_NO_STARTED,
ROUND (AVG (NO_RECEIVED) OVER (ORDER BY RECEIVED_YEAR), 2) AVG_NO_RECEIVED
FROM ORDERS_RCPT_TO_START_VW
ORDER BY RECEIVED_YEAR, WEEK_NO) QRSLT WHERE ( ( ( ( (RECEIVED_YEAR = :RecdYear ) AND (WEEK_NO <= :weekNo ) ) ) ) )
As per this query, it is calculating the Average values first and then applying filter criteria rather than applying the filter criteria and calculating average values.
Please help me on this.Entity objects are used to update/delete/insert data to the database.
If all your base DB object offers is read then just create a read only view object. -
Hi all:
I'm working in Jdev TP3.
I do view criteria on the view and then I want to do search form with it.
The view has a transient column to checkbox but I don't know how insert on the view criteria because if I insert it
doesn't appear on the search form.
Can somebody help me?
Thanks in advance.Thanks by reply Steve
The transient attibute is boolean. I did because I have string attribute and I need to show checkbox.
I add transient attribute to the view criteria and Query Execution Mode put "in memory " because it didn't leave put database.
When I dropped a view criteria, I used my custom view criteria which included the transient attribute.
Thanks in advance.
Maybe you are looking for
-
How can we add elements to component at run time through java
Hi, In my project ,I am using JArrayList to collect urls and I need to add those to JScrollPane(JTextArea) and this to frame. This works fine but I need the process of how the elements added to ArrayList simultaneusly added to JTextArea. pls suggest
-
To update this application, sign in to the account you used to purchase it. - I get this message for a couple of the apps that were installed from original
-
Kernel panic on Macbook, possibly since 10.6.8
Hello, I have a 2008 white Macbook, relatively vanilla (nothing funky installed, no external hardrive, screen, keyboard or mouse) and have been experiencing irregular kernal panics for about 7 to 10 days, which I believe is when I updated to 10.6.8.
-
Populating level values in Demantra.
Hi Guru's, We have a requirement to create a new level on top of item level in item hierarchy. I took one of the exisiting level (t_ep_p2) and changed the its level title. The thing got reflected in the configure levels. I upgraded the data model and
-
Hey, How can i get my DVD's to my iPod Video. Is there a way to do it from a MAC Platform? Thanks