Sun creator data table issue
I am creating a simple JSF based search application with two pages. First page has a text field and a button. You enter a search keyword and click the button. The second page is now loaded with the information from database into a datatable which matches the search keyword. The datatable is bound to a table where the criteria for the query has to be supplied by the keyword. The issue is I am not able to map the keyword to the cached result set that displays the results. Here is the code in the constructor of Reesults page, I guess this should provide the criteria for the where clause in the query
dataTable1Model.getCachedRowSet().setObject(1, getSessionBean1().getKeyword().toString());
dataTable1Model.getCachedRowSet().execute();
Am I doing it wrong?
Thanks,
Trevor.
# 3
I assume you have seen the tutorial before. After setting the query criteria, and then cacheRowSet.execute(), the rowset will be filled with the correct data record provided that the supplied value is correct in term of value and type. If the type is incorrect it will throw exception, but if the value is incorrect, it will not be filled with the correct record.
So, I guess, you can inspect the dataProvider (debug and watch), and see if there is any data in its rowset after the rowset.execute(). If there is no data, I guess you might supply wrong value (maybe the length, whatever). Hope that helps.
# 5
Sorry for the delay in response. I got it done using setCommand() method. I had a deadline and I couldnt spend much time debugging the issue. So I did something like this and it worked.
getSessionBean1().getGrantsdataRowSet().setCommand("My parameterized sql query here");
Thanks for all the responses.
Thanks,
Kingsley