Dynamically set ViewObject where clause dynamically from Java bean

I have a requirement to display all of the records from a table when the JSP is first brought up, so my View Object looks like this:
"select emp_name from emp"
Then the users wants to ability to pass paramters to that View Object to refine the list so from by Java class I tried to do this:
ViewObject vo = cpd.findViewObject("EmpViewObject");
vo.setWhereClause("empName = :1");
vo.setWhereClauseParam(1,varEmpName);
vo.executeQuery();
But I am getting JBO errors and I'm not sure what I'm doing wrong. Can anyone offer a hint as to how I can do this?

this is exactly how the code is done -
1. emp_name in the View Object
2. emp_name in the where clause
The two are identical. I have tried many variations of this - any time I set the where clause from my bean I get an error.
When I take the SQL stmnt and run it in TOAD it returns expected rows when I run it in the SQL worksheet in JDev it gives an invalid Identifier - but if I hard code the where clause in the View Object it returns the same results as TOAD.

Similar Messages

  • JSP, DataWebBean: How to dynamically set the where clause of query and display record

    Hi,
    I am reposting this question as per suggestions made by Mr. Dwight.
    I have used ViewCurrentRecord web bean to display records from EMP table. I have to use the Dept_Id_FK from the current
    record of the EMP table to display corresponding records of Dept table. I have a view object called DeptView in my Business
    Components which selects all the records from the Dept table.
    How do I get the value of Dept_Id_FK and use it to display the required records of the Dept table?
    I tried to declare a variable and get the value of Dept_Id_FK but it did not work. My code is as follows:
    <%! String m_DeptId = null; %>
    <jsp:useBean id="RowViewer" class="oracle.jbo.html.databeans.ViewCurrentRecord" scope="request">
    <%
    RowViewer.initialize(pageContext, "EMPApp_EMP_EMPAppModule.EMPView1");
    RowViewer.setReleaseApplicationResources(false);
    RowViewer.getRowSet().next();
    m_DeptId = (String)RowViewer.getRowSet().getCurrentRow().getAttribute("DeptIdFk");
    %>
    </jsp:useBean>
    Thanks.
    null

    First of all, Thank you very much for making use of the new topic format. It is very much appreciated.
    As for your question, I think there are several different ways to accomplish what I think you want to do.
    1. Create a view object that includes both Emp and Dept entities and join them there. In this case, your query would look something like this:
    Select e.empno,e.name,...,d.dname,d.loc from emp e, dept d
    where e.deptno = d.deptno
    You should be able to create a JSP off of this view object that contains both the employee and department information. In this case, BC4J takes care of the foreign key to primary key coordination.
    2. In order to set a dynamic where clause for a view, you need to do the following in your usebean tag:
    rsn.initialize(application,session, request,response,out,"DeptView");
    rsn.getRowSet().getViewObject().setWhereClause("deptno=" &#0124; &#0124; m_DeptId);
    rsn.getRowSet().getViewObject().executeQuery();
    rsn.getRowSet().first();
    You will need to do this in a separate usebean tag from the EmpView, since the usebean can only initialize one view object.
    In other words, you would have your ViewCurrentRecord bean tag for the EmpView, then a separate one for the DeptView where you use the above code to set the where clause to display just the information for the department you want.
    Another option, but one I'm not sure would work as well, is to create a master-detail JSP to do this for you. Usually a master-detail is a one-to-many (one department to many employees). Your request appears to be the reverse, but might still be doable using the same mechanism.
    You set up relationships between views in your BC4J project using View Links. If you used the BC4J project wizard and created default views, some of these links may have been created for you. They are created when BC4J detects a foreign key to primary key relationship in the database.
    You can create your own View Links using the View Link wizard. Select your BC4J project node and choose Create View Link... from the context menu. You will be asked to select a source view (Emp), and a target view (Dept), then select the attribute in each view that related the two of them (deptno).
    Next, you need to reflect this new relationship setting in your application module. Select your app module and choose Edit from the context menu. On the data model page, select the EmpView node in the Selected list. Now select the DeptView node in the available list and shuttle it over. You should see DeptView1 via yourlink appear indented under the EmpView node. Save and rebuild your BC4J project to reflect the changes.
    In your JSP project, you can now have the wizard create a master-detail form for you based on DeptView1.
    Let me know if the above answers your question, or if I have misunderstood what it is you wanted to do.
    null

  • Help:create tree node dynamically from java code...

    hi there...can anyone give me solution how to create or add tree node dynamically from java code???
    currently i am using tree node to handle my menu...i try to create tree and add treenode dynamically from .java page, but it failed...can anyone give solution how to create tree ui from java code, so i can create a dynamic menu...thanz before...

    Hi:
    Just put the statements you would normally put on a sqlplus command line in jdbc statements and execute them?
    http://www-db.stanford.edu/~ullman/fcdb/oracle/or-jdbc.html#0.1_executeUpdate
    MJG

  • JSP, Data Web Bean, BC4J: Setting the where clause of a View Object at run time

    Hi,
    I am trying to develop a data web bean in which the where clause of a View Object will be set at run time and the results of the query then displayed.
    My BC4J components are located in one project while the coding for the data web bean is in another project. I used the following code bu t it does not work. Could you please let me know what I am doing wrong?
    public void populateOSTable(int P_EmpId)
    String m_whereString = "EmpView.EMP_ID = " + P_EmpId;
    String m_OrderBy = "EmpView.EMP_NAME";
    oracle.jbo.ApplicationModule appModule = null;
    ViewObject vo = appModule.findApplicationModule("EMPBC.EMPAppModule").findViewObject("EMPBC.EMPView");
    vo.setWhereClause(m_whereString);
    vo.setOrderByClause(m_OrderBy);
    vo.executeQuery();
    vo.next();
    String empName numAttrs = vo.getAttribute(EmpName);
    System.out.println(empName);
    Thanks.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JDev Team (Laura):
    Here is how I have usually done mine:
    1. In the JSP, use a RowsetNavigator bean to set the where clause and execute the query.
    2. Use a custom web bean to process the results of the query (print to HTML).
    for example:
    <jsp:useBean class="oracle.jbo.html.databeans.RowsetNavigator" id="rsn" scope="request" >
    <%
    // get the parameter from the find form
    String p = request.getParameter("p");
    String s = request.getParameter("s");
    // store the information for reference later
    session.putValue("p", p);
    session.putValue("s", s);
    // initialize the app module and view object
    rsn.initialize(application,session, request,response,out,"wt_bc_WT_bcModule.wtjoinView");
    // set the where clause string
    String theclause = "presname = '" + p + "' AND slideno=" + s;
    // set the where clause for the VO
    rsn.getRowSet().getViewObject().setWhereClause(theclause);
    rsn.getRowSet().getViewObject().executeQuery();
    rsn.getRowSet().first();
    %>
    </jsp:useBean>
    <jsp:useBean class="wt_bc.walkthruBean" id="wtb" scope="request" >
    <%
    // initialize the app module and VO
    wtb.initialize(application,session, request,response,out,"wt_bc_WT_bcModule.wtjoinView");
    wtb.render();
    %>
    In this case, the render method of my custom web bean mostly gets some session variables, and prints various content depending on the session variable values.
    Hope this helps.
    </jsp:useBean><HR></BLOCKQUOTE>
    Laura can you give the code of your walkthru bean? i wna't to initialize a viewobject, set the where clause and give that viewobject back to initialize my navigatorbar.
    Nathalie
    null

  • Not able to set the where clause params

    Hi,
    My version of apps is 12.1.3.
    I created a page with a searchRN and resultRN (LinesVO). (Not a query/view link) . I am passing the id from header to the VO to restrict the linesVO
    The controller correctly passes the id from searchRN to AM, but in AM, the where clause is not set and I am not getting the desired result:
    My AM Code:
        public void InvokeGo(String Hdrval)
                    LineVOImpl LineVO1 = getLineVO1();
                    LineVO1.setWhereClauseParams(null); // Always reset
                     System.out.println("AMIMPL:Hdrval = "+ Hdrval);
                    <prints the header_Value which is passed from CO>
                       if (Hdrval           == null        
                                            System.out.println("Inside Null If");  
                                            String message = "Please provide atleast one input to any of these search field";
                                            throw new OAException(message, OAException.ERROR);
                                    else   
                                        System.out.println("Not All Parameters are Null.Building Where Clause");
                                         < prints the line above>
                                        LineVO1.setWhereClause
                                        ("Header_name = :1");
                        System.out.println("Paremeter Set are: Header_name:"+Hdrval);
                        <prints the above line like :   Paremeter Set are: Header_name:Hdr_Name_1
                        LineVO1.setWhereClauseParam(0,Hdrval);
                        System.out.println("Inside MainAM invokeGO Method:"+LineVO1.getQuery());
                        < prints:Inside MainAM invokeGO Method:SELECT * FROM (select LINE_ID,hdr.HEADER_ID,LINE_NUMBER,LINE_NAME,Attach,hdr.header_name from xxtr_hdr hdr, xxtr_line line
    where hdr.header_id=line.header_id) QRSLT  WHERE (Header_name = :1)>
                        LineVO1.executeQuery();
    The issue is in the SQL build. I guess after setting the where clause, it should appear like :
    QRSLT  WHERE (Header_name = "Hdr_Name_1"
    Thanks

    Hu Sumit,
    I am doing that:
    LineVO1.setWhereClauseParam(0,Hdrval);
    before executequery. I even hard coded
    LineVO1.setWhereClauseParam(0,"XXXX");
    but still it din't work. I guess I am missing something small. because I have done this thing a lot of times earlier and it had worked.

  • How to set genericObject in a TaskInstance from java

    Hi,
    How can I set generiobject to a taskInstace from java?
    And
    How can I get a variable of any other taskInstace in workFlow?
    Please suggest me.
    Thanks ,
    Ravi.G

    Hi,
    How can I set generiobject to a taskInstace from java?
    And
    How can I get a variable of any other taskInstace in workFlow?
    Please suggest me.
    Thanks ,
    Ravi.G

  • Creating DAO layer from java beans(setter and getter methods)

    Can anybody explain me how to create an adapter layer (DAO layer) from java beans with no connection and transaction code inside DAO layer?

    Sure, have another layer do the transaction work.
    Your DAO would make us of this layer.

  • Problem while calling servlet from java bean

    I am trying to call a servlet from java bean in cep.
    My java bean:
    package com.bea.wlevs.example.algotrading;
    import com.bea.wlevs.ede.api.StreamSink;
    import com.bea.wlevs.example.algotrading.event.MarketEvent;
    import javax.xml.bind.JAXBContext;
    import javax.xml.bind.Unmarshaller;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.io.StringReader;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLConnection;
    public class MarketEventBean implements StreamSink {
         String s=null;
         public void onInsertEvent(Object event) {
              if (event instanceof MarketEvent) {
                   MarketEvent marketEvent = (MarketEvent) event;
                   try {
                        JAXBContext cxt = JAXBContext.newInstance(MarketEvent.class);
                        Unmarshaller unmarsh = cxt.createUnmarshaller();
                        StringReader strReader = new StringReader(marketEvent.getString_1());
                        MarketEvent obj = (MarketEvent) unmarsh.unmarshal(strReader);
                        s=obj.getSymbol();
                        System.out.println("data: " + s);
                   } catch(Exception e) {
                        e.printStackTrace();
                   try {
                        System.out.println("test1");
         URL url = new URL("http://172.18.21.94:7001/AppServletrecv-Model-context-root/ReceiveServlet");
         URLConnection conn = url.openConnection();
              System.out.println("test2");
         conn.setDoOutput(true);
              System.out.println("test3");
         BufferedWriter out =
         new BufferedWriter( new OutputStreamWriter( conn.getOutputStream() ) );
         out.write("symbol="+s);
              System.out.println("test4");
         out.flush();
         System.out.println("test5");
         out.close();
         System.out.println("test6");
         BufferedReader in =
         new BufferedReader( new InputStreamReader( conn.getInputStream() ) );
              System.out.println("test7");
         String response;
         while ( (response = in.readLine()) != null ) {
         System.out.println( response );
         in.close();
         catch ( MalformedURLException ex ) {
         // a real program would need to handle this exception
         catch ( IOException ex ) {
         // a real program would need to handle this exception
    My servlet code:
    package model;
    import javax.servlet.http.HttpServlet;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class ReceiveServlet extends HttpServlet {
    private final static String _SYMBOL = "symbol";
    public void doPost(HttpServletRequest request, HttpServletResponse response) {
    * Get the value of form parameter
    // private final static String USERNAME = "username";
    String symbol = request.getParameter( _SYMBOL );
    * Set the content type(MIME Type) of the response.
    response.setContentType("text/html");
    * Write the HTML to the response
    try {
    PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<head>");
    out.println("<title> A very simple servlet example</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Hello " + symbol +"</h1>");
    out.println("</body>");
    out.println("</html>");
    out.close();
    } catch (IOException e) {
    Web.xml:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
    <servlet>
    <servlet-name>ReceiveServlet</servlet-name>
    <servlet-class>model.ReceiveServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ReceiveServlet</servlet-name>
    <url-pattern>/ReceiveServlet</url-pattern>
    </servlet-mapping>
    </web-app>
    My servlet is running in weblogic server.
    But when I am running this program in weblogic server side there is no log.
    Edited by: 856272 on Jun 23, 2011 6:43 AM

    I would run both sides in a debugger and see what code is getting invoked

  • Creating XML file from Java Bean

    Hi
    Are there any standard methods in Java 1.5 to create XML file from java bean,
    i can use JAXB or castor to do so,
    But i would like to know if there is any thing in java core classes,
    I have seen XMLEncoder, but this is not what i want.
    Any ideas
    Ashish

    Marshall JavaBean to an XML document with JAXB or XMLBeans.

  • Setting ViewObject Stored Procedure Where Clause Param from Struts Action

    I adapted/used Steve's example to get stored procedure to populate my ViewObject. However, I could not retrieve any rows after passing whereClause value from Struts action. The param in execureQueryForCollection returns null.
    What could be wrong. Thanks.
    Here's my code.
    ViewObjectImpl:
    package org.adb.sls.model;
    import java.math.BigDecimal;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.sql.Types;
    import oracle.jbo.JboException;
    import oracle.jbo.domain.Date;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.DBTransaction;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    // --- File generated by Oracle ADF Business Components Design Time.
    // --- Custom code may be added to this class.
    public class ViewApplicableLoanTypesImpl extends ViewObjectImpl
    * PLSQL block that will execute the REF_CURSOR
    private static final String SQL =
    "begin ? := sls_loan_types_pkg.get_applcbl_staff_lns_fn(?); end;";
    * PLSQL block that will count the REF_CURSOR returned rows
    private static final String COUNTSQL =
    "begin ? := sls_loan_types_pkg.get_count_applcbl_staff_lns_fn(?); end;";
    * This is the default constructor (do not remove)
    public ViewApplicableLoanTypesImpl()
    * Overridden framework method.
    * Wipe out all traces of a built-in query for this VO
    protected void create() {
    getViewDef().setQuery(null);
    getViewDef().setSelectClause(null);
    setQuery(null);
    * Overidden framework method
    protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams)
    // input parameter is employee number
    String employeeNumber = null;
    if (params != null) {
    employeeNumber = (String) params[0];
    } else
    System.out.println("param is null");
    storeNewResultSet(qc,retrieveRefCursor(qc,employeeNumber));
    super.executeQueryForCollection(qc, params, noUserParams);
    protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs)
    * We ignore the JDBC ResultSet passed by the framework (null anyway) and
    * use the resultset that we've stored in the query-collection-private
    * user data storage
    rs = getResultSet(qc);
    * Create a new row to populate
    ViewRowImpl r = createNewRowForCollection(qc);
    try {
    * Populate new row by attribute slot number for current row in Result Set
    populateAttributeForRow(r,0, nullOrNewNumber(rs.getBigDecimal(1)));
    populateAttributeForRow(r,1, nullOrNewNumber(rs.getBigDecimal(2)));
    populateAttributeForRow(r,2, rs.getString(3));
    populateAttributeForRow(r,3, nullOrNewNumber(rs.getBigDecimal(4)));
    populateAttributeForRow(r,4, rs.getString(5));
    catch (SQLException s) {
    throw new JboException(s);
    return r;
    protected boolean hasNextForCollection(Object qc)
    ResultSet rs = getResultSet(qc);
    boolean nextOne = false;
    try {
    nextOne = rs.next();
    * When were at the end of the result set, mark the query collection
    * as "FetchComplete".
    if (!nextOne) {
    setFetchCompleteForCollection(qc, true);
    * Close the result set, we're done with it
    rs.close();
    catch (SQLException s) {
    throw new JboException(s);
    return nextOne;
    protected void releaseUserDataForCollection(Object qc, Object rs)
    * Ignore the ResultSet passed in since we've created our own.
    * Fetch the ResultSet from the User-Data context instead
    ResultSet userDataRS = getResultSet(qc);
    if (userDataRS != null) {
    try {
    userDataRS.close();
    catch (SQLException s) {
    /* Ignore */
    super.releaseUserDataForCollection(qc, rs);
    public long getQueryHitCount(ViewRowSetImpl viewRowSet)
    Object[] params = viewRowSet.getParameters(true);
    String id = (String)params[0];
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(COUNTSQL,DBTransaction.DEFAULT);
    * Register the first bind parameter as our return value of type CURSOR
    st.registerOutParameter(1,Types.NUMERIC);
    * Set the value of the 2nd bind variable to pass id as argument
    if (id == null) st.setNull(2,Types.VARCHAR);
    else st.setString(2,id);
    st.execute();
    return st.getLong(1);
    catch (SQLException s) {
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    * Return a JDBC ResultSet representing the REF CURSOR return
    * value from our stored package function.
    private ResultSet retrieveRefCursor(Object qc,String id) {
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,DBTransaction.DEFAULT);
    * Register the first bind parameter as our return value of type CURSOR
    st.registerOutParameter(1,OracleTypes.CURSOR);
    * Set the value of the 2nd bind variable to pass id as argument
    if (id == null) st.setNull(2,Types.VARCHAR);
    else st.setString(2,id);
    st.execute();
    ResultSet rs = ((OracleCallableStatement)st).getCursor(1);
    * Make this result set use the fetch size from our View Object settings
    rs.setFetchSize(getFetchSize());
    return rs ;
    catch (SQLException s) {
    s.printStackTrace();
    throw new JboException(s);
    finally {try {st.close();} catch (SQLException s) {}}
    * Store a new result set in the query-collection-private user-data context
    private void storeNewResultSet(Object qc, ResultSet rs) {
    ResultSet existingRs = getResultSet(qc);
    // If this query collection is getting reused, close out any previous rowset
    if (existingRs != null) {
    try {existingRs.close();} catch (SQLException s) {}
    setUserDataForCollection(qc,rs);
    hasNextForCollection(qc); // Prime the pump with the first row.
    * Retrieve the result set wrapper from the query-collection user-data
    private ResultSet getResultSet(Object qc) {
    return (ResultSet)getUserDataForCollection(qc);
    * Return either null or a new oracle.jbo.domain.Date
    private static Date nullOrNewDate(Timestamp t) {
    return t != null ? new Date(t) : null;
    * Return either null or a new oracle.jbo.domain.Number
    private static Number nullOrNewNumber(BigDecimal b) {
    try {
    return b != null ? new Number(b) : null;
    catch (SQLException s) { }
    return null;
    Struts Action
    package org.adb.sls.view;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.ViewObject;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import oracle.adf.model.binding.DCDataControl;
    import oracle.adf.model.bc4j.DCJboDataControl;
    import oracle.jbo.html.BC4JContext;
    public class IndexAction extends DefaultADFAction
    protected ActionForward performActionLogic(ActionMapping mapping,
    ActionForm form, HttpServletRequest request,
    HttpServletResponse response)
    throws Exception {
    try {    
    ApplicationModule am = getApplicationModule("SLSApplicableLoanTypesDataControl", request);
    if (am == null)
    System.out.println("am is null");
    ViewObject vo = am.findViewObject("ViewApplicableLoanTypes");
    vo.setWhereClauseParam(0,request.getSession().getAttribute("SSO_EMPLOYEE_NUMBER"));
    vo.executeQuery();
    } catch (Exception e)
    e.printStackTrace();
    return mapping.findForward("success");
    Struts Config
    <form-beans>
    <form-bean name="DataForm" type="oracle.adf.controller.struts.forms.BindingContainerActionForm"/>
    </form-beans>
    <action-mappings>
    <action path="/index" className="oracle.adf.controller.struts.actions.DataActionMapping" type="org.adb.sls.view.IndexAction" name="DataForm" unknown="false">
    <set-property property="modelReference" value="indexUIModel"/>
    <forward name="success" path="/home.do"/>
    </action>
    <action path="/home" className="oracle.adf.controller.struts.actions.DataActionMapping" type="oracle.adf.controller.struts.actions.DataForwardAction" name="DataForm" parameter="/index.uix" unknown="true">
    <set-property property="modelReference" value="indexUIModel"/>
    </action>
    </action-mappings>

    I just found the solution. I've overridden setWhereClause method.
    public void setWhereClauseParams(Object[] values)
    ViewObjectImpl vo = (ViewObjectImpl) super.getViewObject();
    vo.setWhereClauseParam(0,values[0]);
    }

  • How to set the where clause of a value set on the basis of a form field

    I am using a DFF(Descriptive FlexField), which needs to display the value of a certain column(say columnA) on the basis of the value of another column(say columnB).
    So i have created a value set which points to the table which has both these columns, and the DFF uses this value set. However, the problem is that I have not put any where clause in the value set, because of which i cannot handle the exact fetch returns more than one rows error.
    The query has to be as follows:
    select ColumnA from tbl where ColumnB = [ a form value ];
    What I want to know is how can i get the value of a certain field of a certain block of the form in the above query.
    Edited by: 981615 on Jan 14, 2013 12:48 AM
    Edited by: 981615 on Jan 14, 2013 12:48 AM

    Just have a look over these two statements if it solves your problem
    one time where clause
    Set_Block_Property('BLOCK_NAME',ONETIME_WHERE,your form item);
    dynamic where clause
    set_block_property('BLOCK_NAME'default_where, your form itme)
    you can where clause at run time from any procedure or some triggers

  • A bug? BC4J ViewObject where clause change doesn't affect view contents

    Hi!
    I've found the following interesting behaviour (maybe a bug?) of BC4J ViewObject caching:
    1) make a viewobject with where clause and 1 parameter in it.
    2) set parameter binding to some value
    3) execute query
    4) then change viewobject's where clause, but leave parameter binding intact
    5) execute query again
    6) view object contents haven't changed!
    actually, changing where clause text should make view object requery data from the database instead of using cached rows...
    If to add a call to viewobject.clearCache() before second viewobject.executeQuery(), then everything works fine and view object's contents are changed.
    Does anybody have any ideas about this? Or is this a some kind of a feature, or it is already fixed in a newer version of JDev?
    Thnx!
    PS. JDeveloper version 9.0.3.4 (build 1247).

    delete message

  • Readonly table with where clause value from previous page

    Hi
    I am using jdeveloper 10.1.3.
    I have a globalhome page where the user enteres a reference number. i have a backing bean for the globalhome page that runs a method to run an sql that seraches for this reference number, if the reference number exsits the user is directed to a detail page.
    this detail page should display details of this reference number.
    i have set up a read only table to display this data based on a view object with a bind varaible in the where clause.
    however i am unsure how to set this bind varaible value to the reference entered in the first globalhome page.
    please can anyone advise how to do this.
    regards

    Hi,
    You can follow following steps to achieve this
    1) Write a custom method in your Application module like
    public void executeMyVO(String bindVarValue)
    MyVOImpl vo= getMyVo();
    vo.setNamedWhereClauseParam(<bind variable name decalred in VO>,bindVarValue);
    vo.execute();
    2) Expose the above method to client. (Right click AM-->Client-->Shift method from left to right)
    3) In the pagedef of globalhome page, create a method action for the aboce created custom method
    4) execute the method action from your backing bean after you run an sql that seraches for this reference number.
    Hope this help.
    Vikram

  • Viewobject where clause

    Hi, i need to get the where clause from vo in a manage bean method when i'm using a query component.
    I have a button than execute one reports and I need to pass to reports a where clause generate in the page with the query component.
    thanks in advance

    Hi, i've got it. The code is the next:
    DCBindingContainer bc = (DCBindingContainer)this.getBindings();
    DCIteratorBinding dcIb = bc.findIteratorBinding("TwcdpalabclaveView1Iterator");
    ViewObject vo = dcIb.getViewObject();
    String v_query = vo.getQuery();
    System.out.println(v_query);
    System.out.println(v_query.indexOf("WHERE"));
    System.out.println(v_query.substring(v_query.indexOf("WHERE")));
    String v_where =v_query.substring(v_query.indexOf("WHERE"));
    v_where = v_where.replaceAll("WHERE","AND");
    System.out.println(v_where);
    AttributeList attr = vo.getNamedWhereClauseParams();
    String[] attrname= attr.getAttributeNames();
    String v_value;
    String v_name;
    int i =0;
    while (i<attrname.length){
    v_name = attrname;
    System.out.println(v_name);
    v_value = "'"+vo.getNamedWhereClauseParam(v_name).toString()+"'";
    System.out.println(v_value);
    v_where = v_where.replaceAll(v_name,v_value);
    i++;
    System.out.println(v_where);
    thanks dear friends for your time.
    Best regards.
    luis

  • How to pass LOV Where clause params from Page CO

    Dear Members,
    I have an OAF Page for which I defined a CO.
    I also have an LOV for which I have two parameters in where clause.
    Now my requirement is to pass the two values to the where clause parameters of LOV from the CO of the respective page.
    Can any one please guide me in achieving this requirement.
    Best Regards,
    Arun Reddy

    Hi Arun
    as gyan, suggested try attching a new controller to lov , or extend its existing controller.
    In the page CO
    store the parameter that needs to be passed to lov in pageContext.putSessionValue(paramName,paramValue)
    In the CO of Lov page , in processrequest
    retrive the stored values using pageContext.getSessionValue(paramName)
    Regards
    Ravi

Maybe you are looking for

  • Excise tab not appearing in MIGO

    Dear All, We have some issue in MIGO. We have imported a material against a PO and the MIRO is done for customs duty. But at the time of doing MIGO customs duty is not capturing.  The PO is issue to cost center PO and there is no item no for the PO i

  • Canon 40D and G9 support

    Apple locked down the original 40D support thread which is not a good sign for us Aperture customers who are not able to use our $300 application. I did find an article that talks about using Aperture with unsupported cameras and I thought it might b

  • Bluetooth pretty much unuseable due to stutter

    So I got my Z3 about a week ago and the issue has been present since the first day. I had the phone swapped out for another unit and the issue remains. The bluetooth connects just fine and doesn't disconnect - but it stutters/skips/cuts out like no o

  • User Manual for Web ADI for HRMS

    Would like to know if there is a user manual that can be used to learn how to use the WEB ADI Functionality as a best practise. all your comments are welcomed!

  • 1.1.2 o2 Firmware

    Hi guys, Where can i get the o2 UK 1.1.2 Firmware, as i can only find the US one with AT&T settings Thanks!