Auto Query in Before Display Page Section

The following code is querying master and detail blocks automatically in before display page section. It was working fine. But now I don't know why it doesn't work any more. Does any one know what's the problem?
declare
l_fs varchar2(4000);
l_s varchar2(4000);
L_user varchar2(4000);
begin
l_fs := p_session.get_value_as_varchar2(p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_FORM_STATE');
l_s := p_session.get_value_as_varchar2(p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS');
L_user := portal30.wwctx_api.get_user;
if l_fs = 'QUERY_AND_SAVE' and l_s is null then
p_session.set_shadow_value(p_block_name => 'MASTER_BLOCK',
p_attribute_name => 'A_E_MAIL_ID',
p_value => L_user,
p_language => portal30.wwctx_api.get_nls_language
WWV_MASTER_GENSYS_1(p_block_name => p_block_name,
p_object_name => p_object_name,
p_instance => p_instance,
p_event_type => p_event_type,
p_user_args => p_user_args,
p_session => p_session);
p_session.save_session;
htp.p('<script>window.location.reload();</script>');
end if;
end;

Hi,
To query records before displaying and to refresh the page, you can call the same form (by using the code given below)with necessary parameters from ..before displaying page..section of your form.
declare
l_fs varchar2(4000);
l_s varchar2(4000);
L_user varchar2(4000);
begin
l_fs := p_session.get_value_as_varchar2(p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_FORM_STATE');
l_s := p_session.get_value_as_varchar2(p_block_name => 'MASTER_BLOCK',
p_attribute_name => '_STATUS');
L_user := 'PPP';
if l_fs = 'QUERY_AND_SAVE' and l_s is null then
htp.p('<SCRIPT LANGUAGE="JavaScript">
window.location.href = "PORTAL30.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=<MODULE ID>&p_arg_names=_show_header&p_arg_values=YES&p_arg_names=E_MAIL_ID&p_arg_values='||l_user||'&p_arg_names=_E_MAIL_ID_COND&p_arg_values=%3D";
</script>');
end if;
end;
Replace <MODULE ID< with the module id of your master detail form.
Hope this helps!..
-Krishnamurthy

Similar Messages

  • SAP Query: How to filter records from SAP Query output before display

    Hi Friends,
      Can I delete records from an SAP query basic list before it is displayed?
    For example I want to delte all the orders whose system status is "RELEASED" before the basic list of that SAP query is displayed.
    I have gone through SAP help and found out that we can write some code in <b>END code</b> section which will execute before the basic list of the query is displayed. But I could not figure out how the code this...following is an excerpt form SAP help.
    <b>"The END-OF-SELECTION code consists of two parts (Before list output and After list output). The first part is processed before the list is output and the second part afterwards."</b>
    Can anybody help me?
    Regards,
    Bharat.
    Message was edited by:
            Bharat Reddy V

    Try this simple procedure. <b>Hope</b> this should work for you.
    You do the slection of the status in the List-Processing. say your final field of status flag is GF_STATUS.
    Immediatly after that use this within the List-Processing.
    CHECK GF_STATUS EQ '<RELEASED STATUS>'
    How it works:
    SELECT  <>       "<-------Query processing(system code).
    *< Your code put in the List processing
    CHECK GF_STATUS EQ '<RELEASED STATUS>'   "< --only released records passed.
    *>
    ENDSELECT      "<-----Query endselect(system code).
    Please let me know the result.
    Regards,
    A.Singh
    Message was edited by:
            Amarjit Singh

  • Browser goes blank before displaying page

              Ideas welcomed on this issue.
              I have an MVC style application that on a request does some business stuff in
              the servlet and then forwards to some JSPs to paint the output.
              The problem is that once the JSPs start being processed the browser gets the first
              bit of response and goes blank - then the page content will be drawn quarter/half
              a second later. This is quite annoying for the users.
              Anyone had a similar issue who could share some thoughts on this???
              

    The problem is that once the JSPs start being processed the browser gets          the first
              > bit of response and goes blank - then the page content will be drawn
              quarter/half
              > a second later. This is quite annoying for the users.
              That's because the browser starts to receive a response.
              If you don't like that behavior, make sure that not even the header gets
              committed ... increase the size of the buffer on the response, for example.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com/coherence.jsp
              Tangosol Coherence: Clustered Replicated Cache for Weblogic
              "Gary" <[email protected]> wrote in message
              news:[email protected]..
              >
              

  • Auto Query Form on Page

    Hi,
    I'd like to have a form on a page and when the user navigates to that page I'd like the form to pick up a session variable and put it in a field on the form and run a query. So effectively auto querying a form.
    I've seen it done before but cant seem to find it again.
    I think that it was done by putting some PL/SQL in the 'before displaying the page' area of the additional PL/SQL section. The code would load the session, get the value, set the field value and somehow make it run a query. doQuery doesn't work here.
    Any help with this would be great.
    Thaks,
    Michelle

    I have a similar problem. In particular:
    There is a private form (named MOD_ANAGRAFE_DITTA) based on a database table. The URL to
    run this form is
    https://portal.websanity.it/pls/portal/PORTAL.wwa_app_module.new_instance?p_moduleid=6994683181.
    There is also a page from which the MOD_ANAGRAFE_DITTA form is called. To do this, a URL element was added to the page in whi
    ch the above url was specified.
    Based on some of the OID attributes of the user who connects to the page, when the user runs the form, the form would have to show only the record that satisfies those attributes.
    To do this the following code was entered in the 'BEFORE DISPLAY PAGE' section of the FORMs Wizard:
    declare
    scopo varchar2(50);
    user varchar2(200) := portal.wwctx_api.get_user;
    BEGIN
    select attrvalue into scopo
    from ods.ct_scope
    where entryid in (select entryid
    from ods.ct_uid
    where attrvalue=lower(user));
    p_session.set_value(p_block_name => 'DEFAULT',
    p_attribute_name => 'A_ID',
    p_value => to_number(substr(scopo,1,1)));
    p_session.set_value(p_block_name => 'DEFAULT',
    p_attribute_name => 'A_SEDE',
    p_value => substr(scopo,5));
    p_session.set_value(p_block_name => 'DEFAULT',
    p_attribute_name => '_CALLED_FROM_LINK',
    p_value => 'SEDE');
    PORTAL.wwa_api_module_event.do_event
    ('DEFAULT','QUERY_BOTTOM',1,'ON_CLICK',True,'',p_session);
    END;
    where scope is the OID attribute of user; ID and SEDE are the two table columns must to be filtered
    The code to auto-query a form doesn't work as it should. The form shows all the table records. .
    Perhaps the attribute used to do the query is not a session variable?
    How can this be resolved?

  • Auto Query Form on Page not working

    Hi,
    I created a simple form portlet and want to autoquery it on a certain record. I added this code to "Before displaying the page" :
    p_session.set_value(p_block_name => 'DEFAULT',
    p_attribute_name => 'A_STC_SAMPLINK',
    p_value => 620352);
    p_session.set_value(p_block_name => 'DEFAULT',
    p_attribute_name => '_CALLED_FROM_LINK',
    p_value => 'STC_SAMPLINK');
    PORTAL.wwa_api_module_event.do_event('DEFAULT', 'QUERY_BOTTOM', 1, 'ON_CLICK', True, '', p_session);
    This performs the query but i see this first record of my table, while it should show the record with STC_SAMPLINK = 620352. When I remove the do_event statement, i can see the field filled in correctly and when pressing the query-button manually, it does show the record with STC_SAMPLINK = 620352.
    What am I doing wrong?
    Using Application Server 10.1.2.0.2 on HP-UX

    I just discovered that it does work using p_session.set_shadow_value (with extra p_language parameter). Does this mean that note 316158.1 on metalink (based on Auto Query Form on Page is no longer valid for 10g ?

  • Unwanted query execution before adding Find page restrictions

    Hello,
    When the JHS (10.1.2.1.27) application I made is started, the whole table content is queried without restrictions BEFORE the Find page has loaded.
    Because it's a fair amount of data, I get out of memory messages.
    I have used 2 specific settings that are related to this:
    1) Property "Use Table Range?" has been turned off
    2) Query Bind Parameters are used
    Looking in the log files I noticed the following:
    13:24:00 DEBUG (JhsActionServlet) -Request URI: /PppHseSisQuery/FindPppVLastBhy.do
    13:24:00 DEBUG (JhsActionServlet) -Request Character Encoding: ISO-8859-1
    13:24:04 DEBUG (JhsDataAction) -Executing action /FindPppVLastBhy
    13:24:04 DEBUG (JhsDataAction) -Created searchBean map and stored on session
    13:24:04 DEBUG (JhsDataAction) -Created new searchBean for PppVLastBhyUIModel and added to quick search bean map
    13:24:04 DEBUG (JhsDataAction) -Stored searchBean for PppVLastBhyUIModel on request
    13:24:04 DEBUG (JhsDataAction) -ViewObject PppVLastBhyView: value of bind param 0 set to null
    13:24:04 DEBUG (JhsDataAction) -ViewObject PppVLastBhyView: value of bind param 1 set to null
    13:24:04 DEBUG (JhsDataAction) -ViewObject PppVLastBhyView: value of bind param 2 set to null
    13:24:04 DEBUG (JhsDataAction) -ViewObject PppVLastBhyView: value of bind param 3 set to null
    13:24:04 DEBUG (JhsDataAction) -ViewObject PppVLastBhyView: value of bind param 4 set to null
    13:24:04 DEBUG (JhsDataAction) -ViewObject PppVLastBhyView: value of bind param 5 set to null
    13:24:04 DEBUG (JhsDataAction) -ViewObject PppVLastBhyView: value of bind param 6 set to null
    13:24:04 DEBUG (JhsDataAction) -ViewObject PppVLastBhyView: executing query, bind parameter values have changed
    It seems that the bind parameters get initialized in some kind of way at startup.
    This is detected as a change in value apparently, after which the query execution is triggered.
    So far so good. The problem is that my main query restriction is not related to any of the query bind parameters.
    Because the Find page has not been loaded yet, this mandatory restriction has not been added to the searchBean yet and will therefore not be added to the view object's where clause.
    The result is that all table records will be queried.
    My question: Is there any way to prevent the query to be executed before the Find page has loaded?

    Have you tried setting the group checkbox "Auto Query?" to unchecked? This should prevent the query from executing before the find page is loaded.
    Steven Davelaar,
    JHeadstart Team.

  • Custom Search Portlet: How to specify a page in the auto query?

    I want to specify a page in an auto query (Automatically display search results).
    I'm able to specify a pagegroup (Tab What to Search), but unable to select a specific page and to include/exclude subpages.
    This option is available on the SearchForm Tab. We are running 9.0.4.

    A similar question was asked in this discussion:
    Custom Search Portlet
    A Portal Search Team member replied that this feature might be included in 9.0.4.
    We are testing 9.0.4 and it's not available. When is feature this scheduled?

  • How to display the query results in several pages?.

    Hi,
    i want to display the query results in several pages. for example my query result found 50 matches, now i want to print 20 per pages next 20 will be in next pages. iam using only jsp & mysql.
    Regards
    Chinna

    Hi, what you are trying accomplish is known as pagination.
    You could use JSTL tags with Custom Tags to perform pagination in your JSP pages.
    evnafets showed me DisplayTags , you could use those as well http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html
    Here is one article on paging:
    http://www.javaworld.com/javaworld/jw-07-2004/jw-0726-pagination.html

  • How to display query result in seperated page.

    How to display query result in seperated page, if the results are very big (more than 5000 records) and there are so many concurrent users (about 500 - 1000 users).
    Are there any solutions or frameworks?
    Plese help me .........
    thanks,
    --bhasin

    Hi,
    How to display query result in seperated page?I think RowSet will be the better technology to use in this
    situation.For more information on this please visit http://developer.java.sun.com/developer/Books/JDBCTutorial/chapter5.html
    which explains in detail about RowSets.
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support/

  • Execute a method before a page is displayed?

    I love JSF, but I have continuously run in to a wall trying to figure out how to execute code before a page is displayed. Is there some Listener/Binding mechanism that I could tap into that would be called before Render Response?
    A Phase Listener is too general, I don't want something that walks the tree for every request.
    Action/ValueChange Listeners are only called after a user takes an action.
    Putting calls (for example DAO) in getter methods works in some circumstances, but is fragile and is insufficient when you need to populate multiple fields on a bean but only want one (DB) call. (You can put it on the first one that will be called, but this destroys reusability).
    The only sucessful strategy I have found is having an init() that returns boolean and calling it from the first <h:outputText> on the screen's render field. This is obviously a painful hack.
    This is a general question, but my current scenario is a single DB lookup needs to get a list of beans before a page is displayed. (users can link directly to the page). Once the lookup is complete the list of beans is displayed in 3 seperate data tables with 3 seperate action bindings. So it doesnt really make sense to do the db lookup in one get method that populates the 2 other lists, though it would be a functional approach.
    Any thoughts?

    I love JSF, but I have continuously run in to a wall
    trying to figure out how to execute code before a
    page is displayed. Is there some Listener/Binding
    mechanism that I could tap into that would be called
    before Render Response? In vanilla JSF? No.
    In JSFTemplating: yes.
    It provides an "initPage" event which is invoked every time a page is "initialized" (which may be a long time before it is displayed). It also provides an <event> component which includes a "beforeEncode" event which is invoked during renderring.
    A Phase Listener is too general, I don't want
    something that walks the tree for every request. I agree.
    Action/ValueChange Listeners are only called after a
    user takes an action. Yep.
    Putting calls (for example DAO) in getter methods
    works in some circumstances, but is fragile and is
    insufficient when you need to populate multiple
    fields on a bean but only want one (DB) call. (You
    can put it on the first one that will be called, but
    this destroys reusability).Exactly.
    The only sucessful strategy I have found is having an
    init() that returns boolean and calling it from the
    first <h:outputText> on the screen's render field.
    This is obviously a painful hack.Yep.
    This is a general question, but my current scenario
    is a single DB lookup needs to get a list of beans
    before a page is displayed. (users can link directly
    to the page). Once the lookup is complete the list of
    beans is displayed in 3 seperate data tables with 3
    seperate action bindings. So it doesnt really make
    sense to do the db lookup in one get method that
    populates the 2 other lists, though it would be a
    functional approach.The "events" I mentioned above for JSFTemplating allow any # of parameterized "handlers" to be invoked. "handlers" are more reusable than #{} method bindings due to their support for multiple inputs and outputs. You also do not have to do any faces-config.xml file configuration, they are defined via Java SE 5 @annotations.
    If you want examples or help trying this out... let me know. JSFTemplating pages can be mixed with JSPs as well... although once you start using JSFTemplating pages, you're not likely to make any more JSP pages.
    Good luck!
    Ken Paulsen
    https://jsftemplating.dev.java.net
    Any thoughts?

  • How would you check URLs in a page before displaying?

    Any ideas how this could be done in Portal?
    Any thoughts appreciated..
    Colin

    Are you talking about "dead link detection" having portal parse
    and check if any page links are invalid before displaying them?
    So the portal would parse each page, check each non-portal
    generated link and test the http: connection before displaying
    the page? (ouch on performance...)
    or
    Are you talking about creating a porlet that checks itself
    before displaying raw html?
    or
    Are you talking about an utility that goes out and checks a
    given portal page name building, parseing, checking, and
    providing a report that shows all the dead links? This utility
    would function like some of the HTML web authoring tools do.
    Option #3 would be a great portal administration feature.
    Dead link detection utility or report build into portal.
    Any chance of getting "Dead Link Detection" in the next release
    of portal?
    (note to original poster- sorry to hijack your posting.)

  • How to not have your view objects query before the page comes up?

    Hello. I have a view object that is part of a LOV. This view object always gets queried on bringing up the page (I need it to happen on the LOV click) How can I have the VO not queried initially? I tried setting the Iterator to refresh never, but it still does it. Here's the log before the page comes up:
    [363] BindingContext.put( ContactsAMDataControl@irepair_DataBindings_cpx, oracle.jbo.uicli.binding.JUApplication )
    [364] Resolving VO:ContactsVVO1 for iterator binding:ContactsVVO1Iterator
    [365] Changing iterator range size from :1 to :25
    [366] ContactsVVO1 ViewRowSetImpl.execute caused params to be "un"changed
    [367] Column count: 13
    [368] ViewObject: ContactsVVO1 Created new QUERY statement
    [369] ContactsVVO1>#q computed SQLStmtBufLen: 663, actual=623, storing=653
    [370] select
    oc.JOB_TITLE,
    oc.PARTY_SITE_ID,
    RELATIONSHIP_ID ,
    hp.PARTY_NAME OBJECT_NAME, -- Contact
    OBJECT_ID ,
    hr.PARTY_ID ,
    oc.CONTACT_KEY,
    subject_id,
    hp.EMAIL_ADDRESS,
    hp.primary_phone_country_code,
    hp.primary_phone_area_code,
    hp.primary_phone_number
    from HZ_ORG_CONTACT_ROLES ocr,
    HZ_ORG_CONTACTS oc,
    HZ_PARTIES hp,
    HZ_RELATIONSHIPS hr
    where
    hp.party_id = hr.object_id
    and hr.RELATIONSHIP_ID=oc. PARTY_RELATIONSHIP_ID
    and oc.ORG_CONTACT_ID = ocr.ORG_CONTACT_ID(+)
    and relationship_code = 'CONTACT'
    order by OBJECT_NAME
    [371] Bind params for ViewObject: ContactsVVO1
    [372] DCUtil, returning:oracle.adf.model.binding.DCParameter, for ContactsAMDataControl
    [373] LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1 ViewRowSetImpl.execute caused params to be "un"changed
    [374] Column count: 13
    [375] ViewObject: LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1 Created new QUERY statement
    [376] LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1>#q computed SQLStmtBufLen: 663, actual=623, storing=653
    [377] select
    oc.JOB_TITLE,
    oc.PARTY_SITE_ID,
    RELATIONSHIP_ID ,
    hp.PARTY_NAME OBJECT_NAME, -- Contact
    OBJECT_ID ,
    hr.PARTY_ID ,
    oc.CONTACT_KEY,
    subject_id,
    hp.EMAIL_ADDRESS,
    hp.primary_phone_country_code,
    hp.primary_phone_area_code,
    hp.primary_phone_number
    from HZ_ORG_CONTACT_ROLES ocr,
    HZ_ORG_CONTACTS oc,
    HZ_PARTIES hp,
    HZ_RELATIONSHIPS hr
    where
    hp.party_id = hr.object_id
    and hr.RELATIONSHIP_ID=oc. PARTY_RELATIONSHIP_ID
    and oc.ORG_CONTACT_ID = ocr.ORG_CONTACT_ID(+)
    and relationship_code = 'CONTACT'
    order by OBJECT_NAME
    [378] Bind params for ViewObject: LOCALVIEW_USAGE_com_craneae_services_hz_vvo_ContactsVVO_ContactsVVO1
    Thanks!
    Edited by: user621288 on Jun 17, 2009 4:11 PM

    There are two ways:
    1. Uncheck "Query List Automatically" under List UI Hints in the view object overview xml.
    2. In the query add "where 1=:bnum and 1 is not null" and execute the query in the LaunchPopupEvent
        public void userIdId_launchPopupListener(LaunchPopupEvent launchPopupEvent) {
            DCIteratorBinding myListIter = (getItrtBindings("MyLovViewObj1Iterator"));
            ViewObject vo = myListIter.getViewObject();
            NavigatableRowIterator myItemList = myListIter.getNavigatableRowIterator();
            Row row = myItemList.first();
            Object[] val = row.getAttributeValues();
            ViewRowSetImpl vor = (ViewRowSetImpl)val[row.getAttributeCount() - 1];
            vor.setNamedWhereClauseParam("bnum", new BigDecimal(1));
            vor.executeQuery();
        }

  • JSF action before the page is displayed?

    Hi all,
    What's the best way to execute a backing bean method before the page is rendered?
    I have to fill out some selectOneMenus on the page with a backing bean method.
    Will the onload JavaScript function in the <body> tag do this for me? How does one call a JSF method from JavaScript?
    Thanks for any help!
    Illu

    Why not just bind the value of a selectOneMenu to a list of SelectItems, like this:
                        <h:selectOneMenu styleClass="selectOneMenu" id="acctprodMenu" value="#{accountServiceMappingAction.mappingBean.acctPrdId}" >
                             <f:selectItems value="#{adjustmentsInit.accountProducts}"/>
                        </h:selectOneMenu>      Where in the adjustmentsInit bean, there is a method like this:
         public List getAccountProducts() {
              ArrayList temp = new ArrayList();
              Iterator itr = someService.getAccProdList.iterator();
              while (itr.hasNext()) {
                   AccountProduct acct = (AccountProduct) itr.next();
                   SelectItem item =
                        new SelectItem(
                             new Integer(acct.getAccountProductId()),
                             acct.getAccountProductName());
                   temp.add(item);
              return temp;
         }This way, once you load the page, it will have what you need in it.

  • ABAP Query - How to display non-zero entries

    Hi All,
    I have created a simple query having the join of 4 tables.
    Now I need to display the output for only non-zero entries of a particular field.
    How this can be achieved ?
    Please let me know-
    1) Either , there are ways to restrict the entries during selection itself(I do not want to give this field in selection screen)
    2) Or , Delete the entries having zero value before display.
    I debugged the standard report for query and found out the internal table where the
    result is stored, but it is not allowing to be used in the coding sections of infoset.
    Thanks ,
    Neethu

    In select add condition field1 NE 0 or SPACE.
    Edited by: Shaik Hussain on Nov 30, 2010 1:46 PM

  • Dynamically setting where clause parameter before the page load

    Hi Experts,
    I do have the following requirement.
    I am working on jsf page in ADF10.1.3.3. I have a View Object which displays the results on the screen. Can someone provide me some example where I can dynamically set the where clause parameter to my Query in VO before the Page Load happens(By Overriding the Prepare Model) and display results on screen.
    Thanks

    Hi,
    Thanks for yor advice.
    I need to write the method in Prepare Model method when the page loads and not in AM.
    Here in the page there is no action as such.
    On the Page load we need to directly set the Where Clause on the VO.
    Provide me some examples if any.
    Thanks

Maybe you are looking for

  • File Matching with FTP Adapter

    Guys, I have particular requirement where FTP Adapter needs to read set of files FILENAME.PCL FILENAME.I01 the file name would be matching but extensions are different. the adapter needs to read the file match if they are SET of files ( based on file

  • I have dead time after a transition on one of my slides and I can not get rid of it

    I have a transition between slides and then once the transition occurs, there is dead blank space for 5 seconds and then the next slide comes in.  I have tried everything to get rid of the dead space but I can not seem to resolve the issue.  Anyone h

  • Helping getting ipod out of recovery mode

    i was updating my ipod touch to iOS 4.3 and it said there was an error at the end, and now my ipod is in recovery mode. itunes is telling me to restore it. i dont want to loose my data because if i restore i will loose everything. is there a way to s

  • Trouble moving files in lightroom 2.5

    I can't seem to resolve a problem with moving files in Lightroom 2.5. While in the program, can not drag and drop images from one folder to another. If drag and drop from IE (Windows Vista), and then go back into Lightroom 2.5, catalog does not updat

  • Assertion failed awaiting tab closing animation

    Some time after closing tab a popup shows up: ASSERT: Giving up waiting for the tab closing animation to finish (bug 608589) Stack Trace: 0:([object XULElement],[object XULElement],1) Sometimes the last argument is -1 instead of 1.