3 Replies Latest reply on Jan 28, 2013 6:27 PM by user8249972

    execute search programatically during initial page load.


      when the page is initially rendered, i have requirement to have the page automatically retrieve rows that belong to the user (ie execute a search programatically)

      to achieve that i did the following -
      1. created search page using autocustomizationcriteria
      2. mapped all search fields to corresponding VO fields ( i intend to not override the default where clause since all my search can directly be mapped to a VO attribute)
      3.populated the userlogin value into the corresponding search field as follows -
      String lg = pageContext.getUserName();
      OAMessageLovInputBean lovBean = (OAMessageLovInputBean)webBean.findChildRecursive("searchLogin"); //the searchfield is a messageLOVInput
      lovBean.setValue(pageContext, lg);

      the behavior i was expecting is for the page to automatically generate the where clause since i populated the search field that is mapped to the VO attribute and execute the query (i did not invoke executequery() per dev guide) BUT instead it is executing a BLIND query with no where clause.

      would appreciate any insight into what i am doing wrong....
      thank you.
        • 1. Re: execute search programatically during initial page load.

          Get a handle to the VO.

          Set the where clause and execute it Programatically.

          XxhrmConfTabVOImpl conftb=getXxhrmConfTabVO();
          conftb.setWhereClause("where column=:1");

          • 2. Re: execute search programatically during initial page load.

            Are there any other associated beans(like formValue) for the LOV, 'searchLogin' to be set?For eg: UserId.

            Also, if it is a Custom Search Page, see whether the 'Admin seeded views' can help you meet the requirement.

            • 3. Re: execute search programatically during initial page load.
              hi, i had initially done the setting of the whereclause and executing programatically. however, when you do that, subsequently, the 'Go' button also needs to be handled programatically (including all search criteria whereclause generation) and then you loose all the features of the queryBean especially the different search options (eg like , starts with etc) on the Advanced Panel unless you code for all those features yourself...... NOTE - the need to handle the 'Go' button yourself happens even though after executeQuery() for just the initial page load, i reset the whereclause and whereclauseparams to NULL....

              i also do not have a formvalue associated with the searchlogin field.

              any other inputs please ?
              thank you.

              Edited by: user8249972 on Jan 28, 2013 10:22 AM