File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Strange Problem ! View Object .execute query returns 0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Strange Problem ! View Object .execute query returns 0" Watch "Strange Problem ! View Object .execute query returns 0" New topic
Author

Strange Problem ! View Object .execute query returns 0

Susan Monz
Greenhorn

Joined: Aug 23, 2008
Posts: 27
I have a problem. I have a view object which for which i set the where clause.
vo.setWhereClause("LOY_CARD_NO = "+ nID );
vo.executeQuery();
The query returned me a proper query which when I ran in toad gave the row i wanted.
The view object sql query is
SELECT clc.CCD_CUST_CD, clc.LOY_CARD_NO, FROM CCD_LOY_CUST clc
WHERE clc.LOY_CARD_NO = :CARD_NO

Now when I tried to fetch data in my JSF
it was empty. I even tested the appModule . It worked there. But my
vo.getEstimatedRowCount() returns 0
Why?

Please help.
Susan Monz
Greenhorn

Joined: Aug 23, 2008
Posts: 27
Ok I understood why this happened.

I tried .setNamedWhereClauseParam("ID",nID )

But another question why does my view object sometimes display details and sometimes not..... Is it the way i am initializing it?

1.ApplicationModule am = ADFUtils.getApplicationModule("CustAppModule");

ViewObject voList = am.findViewObject( "ListViewObj1" ) ;

I have seen other ways.

2. String amDef = ".model.CustAppModule";
String config = "CustAMLocal";
ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);

and
3. // 1. Access the FacesContext
FacesContext fc = FacesContext.getCurrentInstance();

// ii. Create value binding for the #{data} EL expression
ValueBinding vb = fc.getApplication().createValueBinding("#{data}");

// iii. Evaluate the value binding, casting the result to BindingContext
BindingContext bc = (BindingContext)vb.getValue(fc);

// iv. Find the data control by name from the binding context
DCDataControl dcCust = bc.findDataControl
("CustAppModuleDataControl");

// v. Access the application module data provider
ApplicationModule amCust = (ApplicationModule)
dcCust.getDataProvider();

Which of these is best?
Susan Monz
Greenhorn

Joined: Aug 23, 2008
Posts: 27
Please let me know on this. I am just a newbie. I would like to know which one is the right way. Shall i post a new topic.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Strange Problem ! View Object .execute query returns 0
 
Similar Threads
oracle stored procedure with clob return
Problem Named Queries In Hibernate
Problem with Access
Designing a multiple Join query
hibernate session returning old values