Webservice call on page load

Hi,
I have an ADF application which uses webservices. I have two .jspx pages, one which calls the webservice 'pending contacts' on page load and displays the Pending contact list. The other page is for the new user registration, when I click on the register button on the Registration page it navigates back to the first page where the pending contacts needs to be loaded again with a new pending contact which doesn't happen. The new contact is displayed only when I re run the page.
How do I refresh the page in the sense get the data from the database on navigation?
Thanks,
Sal

Use a method call as the default activity of a bounded taskflow (not based on fragments since you use jspx).
You can always navigate back to the default activty which in turn has control flow cases to the page.
Working with Task Flow Activities - 11g Release 1 (11.1.1.6.0)

Similar Messages

  • Method called at page load time of jspx page

    I am using the jdeveloper11.1.1.1.0 version.
    is there any method that is called at page load time. in this method i need to apply the set where clause on view object and some more functionality i need to add here.in ADf life cycle , is there any method like init() ?
    Sailaja

    you would have implement PagePhaseListener and extend this from your backing bean class..
    package view.controller;
    import oracle.adf.controller.v2.context.PageLifecycleContext;
    import oracle.adf.controller.v2.lifecycle.Lifecycle;
    import oracle.adf.controller.v2.lifecycle.PagePhaseEvent;
    import oracle.adf.controller.v2.lifecycle.PagePhaseListener;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.binding.BindingContainer;
    public class CustomPagePhaseListener implements PagePhaseListener  {
         * Before the ADF page lifecycle's prepareModel phase, invoke a
         * custom onPageLoad() method. Subclasses override the onPageLoad()
         * to do something interesting during the
         * @param event
        public void beforePhase(PagePhaseEvent event) {
          PageLifecycleContext ctx = (PageLifecycleContext)event.getLifecycleContext();
          if (event.getPhaseId() == Lifecycle.PREPARE_MODEL_ID) {
            bc = ctx.getBindingContainer();
            onPageLoad();
            bc = null;
         * After the ADF page lifecycle's prepareRender phase, invoke a
         * custom onPagePreRender() method. Subclasses override the onPagePreRender()
         * to do something interesting during the
         * @param event
        public void afterPhase(PagePhaseEvent event) {
          PageLifecycleContext ctx = (PageLifecycleContext)event.getLifecycleContext();
          if (event.getPhaseId() == Lifecycle.PREPARE_RENDER_ID) {
            bc = ctx.getBindingContainer();
            onPagePreRender();
            bc = null;
        public void onPageLoad() {
          // Subclasses can override this.
        public void onPagePreRender() {
          // Subclasses can override this.
      }add your backing bean class as controllerClass in the corressponding pageDef <pageDefinition....> tag.
    ControllerClass="#{backingBeanScope.backing_YourBackingBean}"
    in your backing bean add pageload method like below and put your code (this method being called when the page loads...)
    public void onPageLoad() {
    Edited by: puthanampatti on Sep 30, 2009 2:33 PM

  • ItemStateChanged function calling on page load - How to avaoid?

    Hi,
    I have one combo box in my application. When i m going to select combo box value, the listener will be called. Now what my issue is i have to avoid to call itemStateChanged() function when the Frame is opening in first time. Pls anyone give solution to solve this issue.
    package timer;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    public class SelectItem extends JFrame implements ItemListener {
        BorderLayout bord = new BorderLayout();
        JTextField result = new JTextField(27);
        JComboBox pick = new JComboBox();
        public SelectItem() {
            super("Select Item");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            pick.addItemListener(this);
            pick.addItem("Navigator");
            pick.addItem("Internet Explorer");
            pick.addItem("Opera");
            pick.setEditable(false);
            result.setHorizontalAlignment(SwingConstants.CENTER);
            result.setEditable(false);
            JPanel pane = new JPanel();
            pane.setLayout(bord);
            pane.add(result, "South");
            pane.add(pick, "Center");
            setContentPane(pane);
            pack();
            setVisible(true);
        public static void main(String[] arguments) {
            JFrame frame = new SelectItem();
        public void itemStateChanged(ItemEvent evt) {
            System.out.println("Inside Item Event...");
            Object source = evt.getSource();
            if (source == pick) {
                Object newPick = evt.getItem();
                result.setText(newPick.toString() + " is the selection.");
            repaint();
    }Thanks & Regards,
    S Senthilkumar

    I would guess:
    //package timer;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    public class SelectItem extends JFrame implements ItemListener {
        JTextField result = new JTextField(27);
        JComboBox pick = new JComboBox();
        public SelectItem() {
            super("Select Item");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            pick.setEditable(false);
            pick.addItem("Navigator");
            pick.addItem("Internet Explorer");
            pick.addItem("Opera");
            pick.setSelectedIndex(-1);
            pick.addItemListener(this);
            result.setHorizontalAlignment(SwingConstants.CENTER);
            result.setEditable(false);
            JPanel pane = new JPanel(new BorderLayout());
            pane.add(pick);
            pane.add(result, BorderLayout.SOUTH);
            setContentPane(pane);
            pack();
            setVisible(true);
        public static void main(String[] arguments) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new SelectItem();
        public void itemStateChanged(ItemEvent evt) {
            System.out.println("Inside Item Event...");
            result.setText(evt.getItem() + " is the selection.");
    }

  • Execute javascript on page load

    All,
    I have a javascript working well on click button via javascript:html_Submit_Progress(this) but now i want to use the same code to execute onload page can somebody help me with the necessary change on this code please to make it work whenever the page loads,
    function html_Submit_Progress(pThis){ 
         $x_Show('AjaxLoading');
         window.setTimeout('$s("AjaxLoading",$x("AjaxLoading").innerHTML)', 100);
         doSubmit('APPLY_CHANGES');
         function submit_HideAll(pThis){ 
         $x_Hide('wwvFlowForm');
         doSubmit('APPLY_CHANGES');
         function submit_ButtonRegion(pThis){ 
         $x_Hide('button_region');
         doSubmit('APPLY_CHANGES');
    ..appreciated in advance.

    So I assume your code in PageLoad looks something like this?
    $x_Show('AjaxLoading');
    window.setTimeout('$s("AjaxLoading",$x("AjaxLoading").innerHTML)', 100);
    doSubmit('APPLY_CHANGES');Don't put the doSubmit call in page load. That will cause a submit, then the page loads again, submits again as a result of being called on page load, etc. and that's why you're looping over and over...every time the page loads you're submitting again.
    I would instead do this.
    1. Make a function somewhere on your page wherever appropriate:
    function html_Progress(pSubmit){
    $x_Show('AjaxLoading');
    window.setTimeout('$s("AjaxLoading",$x("AjaxLoading").innerHTML)', 100);
    if(pSubmit)
      apex.submit(pSubmit); //doSubmit is "old"...apex.submit is the new Apex 4 way of submitting
    } 2. In page load DA do this:
    html_Progress();
    3. Anywhere else you need it called and submitted too:
    html_Progress('APPLY_CHANGES');
    In other words, if the caller doesn't pass anything for pSubmit, don't submit. (This would be in a page load context.)
    If the caller does pass something for pSubmit, then submit. (This is likely to be pressing the Apply Changes button or whatever else.)
    Edited by: gti_matt on Sep 26, 2012 1:31 PM

  • Redirect on page load (table-driven rules)

    ADF 11gR1 PS1
    Hi all,
    On some pages, I need to redirect the user based on a table driven rules (eg page is active only between dates x and y, etc). Because there will be numerous pages with this functionality, as well as table driven configuration with regards to the rules (eg which page is affected, what dates are valid, what url should the user be redirected to), and since this can happen for both unbound and bound tasks, I'm not sure if using a router is the best way to do this.
    Per this thread
    Redirect in adfc
    I'd like to attempt to do this via a bean method called during page load. Here's what I can't figure out:
    1) Is there a way the bean method can figure out the calling page name?
    2) How to call the bean method on page load that would allow a redirect.
    Regarding #2, on the previously mentioned thread, someone mentioned a PhaseListener on RESTORE_VIEW, but I don't quite understand how do to that.
    Thanks.

    Hi,
    the after RESTORE_VIEW phase can be listened for in a PhaeListener you configure in the faces-config.xml file. This RESTORE_VIEW phase has accec to the FacesContext and thus to the ViewRoot, which provides information about the requested viewId. You can then change the ViewId of this ViewRoot based on your redirection needs.
    A router activity is the best practices here because the use case you describe is conditional navigation. So if you need to have the logic in a managed bean, then why don't you point the router case to this ?
    Frank

  • How to call a action on page load in jsf

    Hi all,
    i am having a JSF page where i want to display the records from the datatable. I have a method in bean which call database and gets the list of records. If i call this method from a link (action on this link) present on this page i can display the records on this page.
    But i want to display these records at the time of page load only. How we can do this? How to call a action at the time of page load?
    Thanks in adv.

    If i am calling the database class and get the list in constructor only i am able to display list in the datatable on page load. This works fine. But the requirment is that if there are no records in the list display a error page with message-No records found! . But how i can navigate from the constructor to error page?
    Like-
    class MyBeam{
    MyBean{
    private List requestVOList = null;
    MyDao dao = new MyDao() //for fetching list from DB
    List records = dao.getList()  //get list from dao class
    if(records==null)
        //Navigate to error page. How to do this navigation here?
    else
        requestVOList  = records;
    //setter/getters for requestVOList 
    }

  • Method called three times on page loading

    I have a page with panelTabbed and several showDetailItems. On the first showDetailItem I have ADF Query component with the results table.
    I want the second showDetailItem to be enabled or disabled depending on whether there is a selected row in the results table or not.
    I have second showDetailItem's Disabled property set to an EL expression referring to a method in a backing bean.
    This method is called three times during initial page loading. I suspected that it was caused by some partialTriggers, but without any partialTriggers
    ADF behave the same way.
    Moreover, first two times there is a selected row in an iterator. Only the third time there's no selected row (empty initial state of the results table).
    And if this method returns false (not disabled) first two times and true (disabled) third time only, the second showDetailItem is enabled after page is loaded.
    What is responsible for these redundant calls of the method?

    Studio Edition Version 11.1.2.0.0
    Build JDEVADF_11.1.2.0.0_GENERIC_110531.1615.6017

  • Very simple question: Call JavaBean method on page load?

    Someone clicks on a URL that contains parameters like: http://server/page.jsf?param=b
    How do I trigger a JavaBean method to run during page load? I see many JSF examples where JavaBean methods get called during form clicks and that works great but here I want to run code on page load.
    This must be really simple; sorry I'm new to this technology.
    Must I use <% ... %> syntax or can I use actual JSF tags or configuration to accomplish this?
    Thanks very much in advance!

    Putting a lot of logic in getter( ) function is not the best idea considering that getter( ) could be called all over the place. Using constructor for same purpose is also a bad idea especially with request scope beans. This could also happen many times at different stages. You are right, having a page load concept could be useful. Unfortunately JSF framework does not support. You could architect around it in case desperate. Or if using JSF implementation of certain vendors like IBM, you can take advantage of their implementation that was extended to support pageLoad and postBack events (similar to .NET).
    Many postings on this forum dealt with topic. Feel free to review like this one:
    http://forum.java.sun.com/thread.jspa?forumID=427&threadID=541382

  • How to call webservices from ADF page

    Hi,
    I am using ADFBC.
    I want to call webservices from ADF page.please give examples of sample program on how to call a web service from the ADF pages.please give examples.
    please help me.
    Thanks,

    http://marianne-horsch-adf.blogspot.com/2011/03/how-to-create-web-service-based-adf.html
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/70-dependent-listboxes-using-ws-286107.pdf
    http://www.oracleimg.com/technetwork/developer-tools/jdev/adfcomplexwstypes-101013.html
    http://technology.amis.nl/blog/9726/quickly-creating-reploying-and-testing-a-webservice-interface-for-adf-business-components
    http://oracamp.com/passing-parameters-between-web-services-and-jsf-pages

  • Calling managed bean method using ajax on jsp page loading

    Hello,
    I am using jsf1.1 i want to call managed bean method when page gets loaded using ajax.
    Thanks
    K.Ramu

    Use an ajaxical JSF framework, for example Ajax4jsf (part of RichFaces).
    But why don´t you just use the constructor of the bean class to do some stuff prior to page loading?

  • Method call before visual web jsf page loads

    Hi All.....
    I have written a method in a java class that accesses the mysql backend db to check if a process is still running. If the process is still running, a JOptionPane is produced informing the user of this and offers an <ok> option(to check the process status again) and a <cancel> option(to redirect the user to the homepage). If the process is completed, I want the page to just load as normal. I want this method to be called before the visual web jsf page loads. I have the method call in the super_init() method of the page and everything seemed to be working fine, the problem I have run into is that if I set the value in the db to show the process is running, the JOptionPane is produced(like it should be), and then if I set the value to show the process has completed and choose <ok> from the pane, the page loads.....this is what I want. Now, after the page loads, if I set the value in the db to show the process is running again, the JOptionPane is produced again right after I apply the changes to the db edit!!!!. I don't know why this is happening. Should I be calling the method from somewhere other the super_init()????? I have tried the method call in the prerender(), preprocess(), and destroy() methods all with the same results.
    Anyone have any ideas on what the problem could be??
    Thanks in advance.
    Silgd

    The Java part of a JSP/Servlet based webapplication runs physically at the server machine.
    Only the HTML/CSS/JS part which is generated by the webapplication and sent to the client physically runs at the client machine.
    JOptionPane is a Java Swing component which thus runs at the server machine. So you as client would only see it when both the server and the client runs at physically the same machine. Which is often only the case in development environment and doesn´t occur in real life! There is normally means of two physically different machines connected through the network/internet.
    To solve your actual problem, look for Ajax poll techniques. To display an alert or confirm dialogue in the client side, you use Javascript for this.

  • Crash when calling Clipboard.GetContent() in Page Loaded event

    Hello
    I found a crash when using
    Clipboard.GetContent() method ,
    the steps to reproduce this are very simple:
    -create C# Windows store application ,
    -add loaded event for main page
    -call Clipboard.GetContent()  inside it(loaded event handler).
    -run the application as release Ctrl+F5 , the application will crash , note that when you run as debug no problems
    -this problem appears not on GetContent() only , it appears when you use any method of ClipBoard class indside main page loaded event.
    Is this bug? , if yes , what is the workaround for this.

    Hi shaker,
    Firstly, I have to say that, yes, I can reproduce your issue on my side.
    However, as far as I know that the Clipboard operations are used to enable users to cut, copy, and paste data, but why you just call the Clipboard.GetContent() method in the Grid_Loaded event? Could you please show me more information
    about your requirement so that I can better understand your scenario?
    Thanks.
    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • How to call java method on page load?

    How to call java method on page load?
    Thanks

    Hey Dan,
    Well, if you want to execute a java method when page is load, you need to put the clientlistener in af:document. Let me to show you an example (I can't find my post :P),
    JSPX page:
    <f:view>
    <af:document>
    <f:verbatim>
    <script>
        function loadPage(event) {
            alert('Hello World!');
    </script>
    </f:verbatim>
    <af:clientListener method="loadPage" type="load"/>
    </af:document>
    </f:view>If you try this code you can see that when the page has been load, you recieve the alert "Hello World!".
    Furthermore, this is the javascript AJAX function that let you to call a servlet:
    function ajaxFunction () {
        var httpRequest;
        if (window.XMLHttpRequest) {
            httpRequest = new XMLHttpRequest();
        } else if (window.ActiveXObject) {
            httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
            httpRequest.overrideMimeType('text/xml');
        httpRequest.onreadystatechange = function() { alertContents(httpRequest); };
        httpRequest.open('GET', '/appname/servletname', false);
        httpRequest.send('');
    function alertContents(httpRequest) {
        if (httpRequest.readyState == 4) {
            if (!httpRequest.status == 200) {
                alert('Request error. Http code: ' + httpRequest.status);
    }Where 'appname' is your application name and 'servletname' is the name of the servlet that you want to call. Obviously, you can call any URL ;)
    JVN

  • How to call a TopLink Query on ADF Page Load (onload)

    Hi,
    I am new to ADF wants to find out how to call a TopLink Query whenever a page loads. I saw SRDemo Sample but all the queries are bound to some kind of an action method i.e. clicking on a button executes a query etc. But I need to call a toplink query on my page load. Any small sample will help.
    Thanks

    Try this approach:
    http://blogs.oracle.com/shay/2007/07/25

  • Calling a java script function while page loads in ebiz

    Hi OAF gurus,
    I have a requirement of Calling a java script function at each OAF page renders or Loads.
    I.e. when any OAF page loads or render in Oracle e-biz i have a java script function which needs to be called Is there any way to implement the above mentioned requirement.
    Many thanks in advance..
    Sourav

    Hi!
    From OAF classes java doc:
    oracle.apps.fnd.framework.webui.OAPageBean
    A class for processing and rendering HTML pages, designed to be invoked from either a JSP page or a servlet.
    Allows you to:
    Validate a user's session and redirect to a login page.
    Set the servlet Response content type to the correct character set as defined by the ICX_CLIENT_IANA_ENCODING profile. (The character set should NOT be set in the JSP page ContentType declaration.)
    Parse a HTTP Request and initialize BC4J application modules and view objects. (For HTML post, apply the content of the submitted form parameters to view objects.)
    Render a HTML page header and body
    It has 2 metods:
    public void renderDocument()
    Renders the HTML document. This is the most common API invoked by JSPs or servlets, and is used to render both the HTML header and body.
    renderBody
    public void renderBody()
    Renders the HTML body only.
    I think you can decompile this class or get the source from oracle and add your javascript code into this method.
    When OA page rendered, your code would be added to avery page, i think
    But it's some kind of hack or something ;-)

Maybe you are looking for

  • Error while executing infopackage of 2lis_03_bx

    Hi, I am using a multiprovider which gets data from 3 cubes OIC_C03 ,ORT_C37 and my customized ZRT_C37. When i am executing infopackage  2LIS_03_BX(Stock Initialization)  which updates data into three specified cubes , its giving me below specified e

  • Installing Windows 8.1 on Ideapad - unable to activate

    Hi, I've installed Windows 8.1 on my Ideapad z500 which I understand is a free update if you have Windows 8 (Which came pre-installed) I've come to install it, and there's no product key on the machine. I've read that the Windows 8 key is in the bios

  • Static Electricity causing Aluminum Shelled Notebooks to freeze??

    Once in awhile, when I come back to my computer, I get "shocked" by the aluminum body of my MacBook Pro (just for the record, this has happened to me too since the Titanium and the previous [same design] Powerbook) .... and it'll freeze the OS. Nothi

  • Apple AV Composite Cables / TV Out and iPhone 4

    Hiya folks: I can't seem to get my iPhone 4 to work with my AV cables for TV out. Seems like it should be pretty simple to me, but it just will not pick up the signal. Has anyone else had success with this? Can I be missing something simple? TIA, SAS

  • Java Embedded Database Recommendation

    Does anyone have a recommendation for a Java embedded database solution? I have been using Borland's JDatastore for a while and I have become frustrated by some of its' bugs. Has anyone had a better experience with some of the other Java embedded dat