Execute JSF-Action automatic on Pageload

Hello,
i have one question: I need a jsp-site, where i execute a action automatically when the page is loaded.
I have tried the following: I've implemented a formular, and a short java script. When the page finished thje loaded, the Java-Script is called to call the submit method of the form. But this doesent work for me.
Has anyone an idea for me???
Many thanks!
Sebastian

If you use a page flow, can't you put the method call in the flow when you navigate to the page?
If you are using 11gR1 you should be able to selct the f:view component of the page and in the property inspector specify a method in the before action.
Timo

Similar Messages

  • JSF action executed twice

    Hello all,
    sorry for my bad english.
    I've a simple form with only one <h:commandButton> who execute an action method.
    In this method i need to do a sleep of 60 seconds.
    The strange thing is that while waiting the 60 seconds, the action method is executed twice !
    This is my code:
    SimplePage.jsp
    <h:form id="simple_form">
      <h:commandButton id="ok_button" value="OK" action="#{bBean.doAction}" />
    </h:form>BackingBean.java
      public String doAction()
        try
          Thread.sleep(60000);
        catch (InterruptedException e)
          e.printStackTrace();
        return "ok";
       }Any help is appreciate.
    Carlo

    Hi Raymond,
    thanks for the reply.
    As you suggested , I've created a JSP page with only one form and submit button that fires an action who sleep for 60 seconds.
    In this case action is invoked only once.
    Any suggestion ?
    Thanks in advance
    Carlo

  • Problem in JSF action mapping for ZOHOwrter

    Hello Every one,
    I am struggling with a problem by using zohowriter in JSF Frame work, my problem is..
    I have developed an application to open and edit a Document which resides in server and save it in server in another path, for this purpose we are using ZohoWriter. For this application the Struts frame work is working fine.
    I have designed xhtml page by using struts framework as bellow,
    <body>
    <form method="POST" action="http://export.writer.zoho.com/remotedoc.im?apikey=ad40de81a92f4d644b474276c7ac1640&output=editor" target="_self">
    <input type="hidden" name="url" value="http://customers.info-sun.com/itrack/templateDocuments/TestPlan.doc">
    <input type="hidden" name="saveurl" value="http://localhost:8080/Struts/zoho.do">
    <input type="hidden" name="filename" value="mydocument.doc">
    <input type="hidden" name="id" value="12345678">
    <input type="hidden" name="format" value="doc">
    <input type="hidden" name="persistence" value="true">
    <input type="submit" value="Edit" class="divbutton" name="submit">
    </form>
    By using above code that editor is calling the "saveurl" attribute value while saving the document, that is automatically executing the Action class and saving the Document in specified server path.
    But,
    In my application we are following JSF framework,
    In my application I have written the xhtml page like,
    <form id="myform" method="post" enctype="multipart/form-data" action="http://export.writer.zoho.com/remotedoc.im?apikey=ad40de81a92f4d644b474276c7ac1640&output=editor">
         <h:commandButton value="Edit" />
         <h:inputHidden id="url" value="http://customers.info-sun.com/itrack/templateDocuments/TestPlan.doc" />
         <h:inputHidden id="filename" value="TestPlan.doc" />
         <h:inputHidden id="id" value="12345678" />
         <h:inputHidden id="saveurl" value="http://customers.info-sun.com/itrack/zoho.fileDownload" />
         <h:inputHidden id="format" value="doc" />
    </form>
    in the page designing if I use <h:form> this tag is not containing action attribute , so I am giving by command button but it is not working.
    So, I continued with html form.
    also, if I specify the "saveurl" attribute mapped with backing been , it is executing in page load only , So My actual intention means after editing it needs to call but it is not happening, while loading this method is calling so other problems are raising.
    Can any one please guide me that, what is my mistake and how to over come.
    Thanks and Regards
    N.Sailaja
    Edited by: SailajaN on Jun 9, 2009 7:37 AM

    Hi,
    I got solution for the above problem.
    I am calling a servlet instead of calling jsf flow, I got that, the zohowriter calling only lifecycle method for saveurl attribute.
    Thanks and Regards
    N.Sailaja
    Edited by: SailajaN on Jun 12, 2009 6:32 AM

  • Schedule actions automatically- using selction report

    Dear Experts,
    I am facing the problem during the Background job scheduling for CRMC_ACTION_JOB using selection report for missed deadline. I have configured the action condition by using the selection report.  In Tcode- CRMC_ACTION_JOB I have scheduled the back ground job for every hour. But actions are not triggered automatically when the start condition is met.
    If I do manually in CRMC_ACTION_JOB I get a lot of actions, if I execute it actions will be triggered.
    Request your help to schedule the actions automatically by using selection report.
    Thanks / Regards
    Pramod SR

    Hi pramod ,
    I had a similar problem and after much exploration i came to this
    I'm sure you must have tested your actions with the setting "Immediately" and saving , i think there is a catch here in the action conditions
    when you are using a batch job trigger put your condition as
    for eg: when x > date+ time  instaed of when X = date +time
    the point i'm making here is try putting the condition to be > or < the time instaed of "=" this should resolve you issue .
    hope it helps
    Regards
    Raj

  • JSF Pages are not rendering correctly when  loaded using Non JSF actions

    Hi All,
    This problem is irritating me and I am posting the same query for the third time here.
    When I come from non jsf actions such as page submitting using Javascript, clicking anchor link, clicking normal Html submit button and so on my page is not rendering correctlly .
    In other words, My first GET method/Post method works perfectly for the first time when the page is loaded.
    But when we try to access the page for the second time, although logical work is perfect in bean, I am getting same old page.
    How to resolve this issue?
    or
    Is this Bug of Sun's Implementation of JSF Framework.
    Thanks,
    Sudhakar

    Hi Sudhakar,
    There is a discussion about refreshing a page, Take a look at the below thread
    http://swforum.sun.com/jive/thread.jspa?threadID=55660
    Hope this what you are looking for
    MJ

  • How do I use the same execute advanced actions?

    I am using captivate 5, windows 7
    I created a slide with several click boxes and images.  I name them, for example,
    Click Box A  Image A
    Click Box B  Image B
    Click Box C  Imsge C
    And perhaps Images D, E, F
    I created Advanced actions, for example,
    Show_Image_A - which shows A and hides B and C - and shows Image D
    Show_image_B - which shows B and hides A and C - and shows images D and E
    Show_image_C - which shows C and hides A and B - and shows Image F
    Then On Success for each of the click boxes, Execute advanced actions as below:
    Click Box A - Show Image A
    Click Box B - Show Image B
    Click Box C - Show image C
    Works fine.
    My problem:  I want to repeat this slide's actions again (and over and over) with new images, same actions of click boxes.  SO - I thought I could copy it and paste it where I wanted it.  I want to use it again later in the same project - and I want to be able to use it again in anothe project.  I was hoping NOT to have to rebuild the slide every time, but here's what I am seeing:
    The click boxes and images are in the duplicated slide - BUT they all have different names - no longer my named Click_Box_A, but Click_Box_<number>, etc each time I paste it has a new number.  SO - my advanced actions still say Click Box A, Image A, etc - and obviously they're not recognized here. SO - my actions don't work here.
    It is painful - and tedious! - to change the names of all the objects and then change the names in the advanced actions.  There MUST be a way to do this that I don't know about?
    Please can someone help me?
    THANK YOU!!

    Hello,
    You cannot copy an advanced action from one project to another, that is really a pity. Please, if you have time, fill in a feature request!
    If the actions are always similar: why not create a template with the advanced actions you mostly use and create future projects on that template. I do it that way for the advanced actions I'm using often.
    Lilybiri

  • JSF Page is not  rendering correctly on NON JSF Action

    Hi All,
    When I go from JSF actions (clicking HtmlCommandButton HtmlActionLink), I am getting the correct page. But when I come from non jsf actions say if I come through by clicking normal anchor tag or javascript action or normal html submit button, I am getting same old rendered page. How can I overcome this problem??
    Thanks
    Sudhakar

    I am getting same old rendered pageIn otherwords, page is not getting refreshed and contains old data

  • Call a dynamic action automatically on a regular basis

    Hi,
    We have a classic report on a page which we would like to refresh automaticallly every X minutes. We have done this using setInterval and $a_report however as I understand, this is unsupported functionality... So I would like to go down the dynamic action route.
    But my question is this... how can I call the dynamic action automatically say every 3 minutes, without any user interaction?

    Hi John,
    maybe it's easier for you to get the approval because it's a plug-in we (Oracle) provide.
    You mentioned that you already had a setInterval with $a_report solution in place. Instead of the unsupported $a_report you can use the supported
    jQuery( "#static_id_of_your_report_region" ).trigger ( "apexrefresh" );to trigger a refresh of your report region. That will be identical to the "Refresh" dynamic action. But I would still suggest to go with the "Timer" dynamic action plug-in, because this will be more transparent for other developers when looking at your page.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Refresh select one choice executing an action binding from ViewObjectImpl

    Hello,
    I'm using Oracle JDeveloper 11g Release 2 (11.1.2.3.0).
    I have a jspx page with a panel tabbed with 2 tabs. In the first one, I have a SelectOneChoice and a button. This command button executes a method in a ViewObjectImpl to add items on a table.
    Here the code of the button:
    <af:commandButton actionListener="#{bindings.addCarToStock.execute}"
                                                          text="Add to Stock"
                                                          disabled="#{!bindings.addCarToStock.enabled}" id="cb2"/>
    On the other tab, I have a form with another SelectOneChoice, in this SOC, you have to choice an item added in the other tab. But when I add a new item in the first tab, the new item does not appear in the SOC of the second tab.
    This would be solved if I execute an action binding on the VOIterator of the second tab, but I can do it from the method on the ViewObjectImpl.
    Can someone help me?
    Thanks in advance!

    Hi Timo,
    I've done what you tell me and still don't work.
    In tab2, I have a form with some attributtes of a VO. One of them it's a SOC (the one that I want to refresh), that takes the values from a LOV. I try to execute the method of the iterator of the LOV first, and after execute the method of the iterator of the VO, but nothing works.
    Here the code in the bean:
    public void addCarToStockActionListener (ActionEvent actionEvent){
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            OperationBinding method = bindings.getOperationBinding("addCarToStock");
            if (method == null) {
                System.out.println("Method Not Found");
            method.execute();
            List errors = method.getErrors();
            if (!errors.isEmpty()) {
                System.out.println("Error");
            OperationBinding executeCarSalesLOVIteratorMethod = bindings.getOperationBinding("ExecuteCarSalesLOVIterator");
            if (executeCarSalesLOVIteratorMethod == null) {
                System.out.println("Method Not Found");
            executeCarSalesLOVIteratorMethod.execute();
            List errors2 = executeCarSalesLOVIteratorMethod.getErrors();
            if (!errors2.isEmpty()) {
                System.out.println("Error");
            OperationBinding executeSalesVOIteratorMethod = bindings.getOperationBinding("ExecuteSalesVOIterator");
            if (executeSalesVOIteratorMethod == null) {
                System.out.println("Method Not Found");
            executeSalesVOIteratorMethod.execute();
            List errors3 = executeSalesVOIteratorMethod.getErrors();
            if (!errors3.isEmpty()) {
                System.out.println("Error");
    And here the code of the form in tab2 (with the SOC I want to update):
    <af:panelFormLayout id="pfl1">
         <af:selectOneChoice value="#{bindings.SaleCarId.inputValue}"
              label="Model"
              required="#{bindings.SaleCarId.hints.mandatory}"
              shortDesc="#{bindings.SaleCarId.hints.tooltip}" id="soc3"
              partialTriggers="cb12">
         <f:selectItems value="#{bindings.SaleCarId.items}" id="si3"/>
         </af:selectOneChoice>
         <af:toolbar id="t5">
              <af:commandButton actionListener="#{bindings.CreateInsert1.execute}"
                   text="New Sale"
                   disabled="#{!bindings.CreateInsert1.enabled}" id="cb3"/>
              <af:commandButton text="Save New Sale" id="cb6"
                   actionListener="#{salesBean.commitActionListener}"/>
         </af:toolbar>
    </af:panelFormLayout>

  • Restrict Personnel area for executing personnel actions

    Hello,
    Guys I need your help on the following issue. Any help will be appreciated.
    The project Which i am working on has 67 Personnel Areas (PA) and 24 personnel actions.
    I need to create a role in such a way the the user will be accessing some 4-5 actions for 1 particular PA. Now I know this can be done in the authorization object P_ORGIN. But i can only give one value of PA to one particular role.
    Now the long and tedious solution for me is to create 67 different roles. I need a simple and easy to maintain solution for this.
    Again any help will be appreciated.
    Thanks,
    Mangirish

    Hi sikandar,
    Thanks for your prompt reply.
    I am already done with the infogroups using user groups. What the client now require is to restrict a user in executing personnel action for one particular personnel area.
    I know this can be done through roles but there are 67 Personnel areas and 7 different levels of user (you do the math)
    Is there a easier way out??
    Thanks,
    Mangirish

  • Default Date in IT0041 On Executing Promotion Actions

    Dear Colleagues,
    I have written a Dynamic Action for defaulting the Promotion date in IT0041. It's working perfectly fine.
    However system is throwing an error on executing Promotion action for the same employee second time.
    Here client wants that the latest promotion date should get defaulted in IT0041.
    Please guide.
    Regards,
    Garima

    Yeah..sure.
    It's actually giving that Date Type is already maintained...
    Code is
    04 81 PT001P-MOLGA='40'
    04 82 P P0000-MASSN='05'
    04 83 I  COP,0041,,,(P0000-BEGDA),(P0000-ENDDA)/D
    04 84 W P0041-DAR07='R5'
    04 85 W P0041-DAT07=P0000-BEGDA

  • How can I execute an action in Acrobat XI Pro using PowerPoint VBA?

    I am using Acrobat XI Pro and PowerPoint that came with Office 2013 running on Windows 8.
    I have an action in the Action Wizard that executes JavaScript code. It works fine when I click Tools | Action Wizard | Actions | <my script>, and Start in Acrobat XI Pro.
    I would like to be able to execute the same action using VBA in PowerPoint. Is this action considered a "menu item" in Acrobat? If so then I understand I can use AcroApp.MenuItemExecute to execute a menu item. What "menu item name" should I use? If not, is there another way to execute the same action using VBA in PowerPoint?
    Thanks.
    Regards,
    John

    No, it isn't a menu item. This area is a little complex, but it's the things which are, or which used to be on the menu. I don't think that there is a way to automate running actions, and I think this is entirely deliberate. However, there is an interface to execute JavaScript code, which is described in the Acrobat SDK.

  • Button to execute custom action(s)

    I have created 3 custom actions which print, e-mail, and fax Opportunities when executed.   These actions work perfect from the SAP GUI, but I am unable to execute them from PCUI CRM as there is no button which is linked to these actions.   Please note that there is a button which prints the opprotunity, and a button which sends an e-mail, but these buttons do not execute the custom Actions which I have created!
    I would like to add a button (custom or standard) to PCUI CRM which would execute my custom Actions.
    I understand how to add buttons to PCUI CRM, but I do not know how to link that button to my custom actions.   Is this even necessary?   I see an "Actions" button, but am not sure if this will automatically link to the custom actions.
    Thanks in advance for any and all responses to my post.

    Thanks for your your help but it was the same thing Timo said before and it didn´t work for me. But I found out what was wrong :) and you were both right.
    I used a template that had a form and when I inserted a form on the page this form was inside the form in the template and that did so that it didn´t work.
    Atlantic Viking

  • Close the window (browser after execute business action

    I have ceated a JSP which will trigger a popup. How can I close the popup after executing some business action in the pop.jsf ?
    in addition, since my popup will return value to window.opener, but I have tried that I have a page forward in the popup, it cannot locate the window.opener and hence cannot return value to the opening windows but only return me error 404 page not found.
    actually my popup is just like a searching form, user can input some string to serch the DB and then display the data in datatable. then user can pick up the record he would like to choose and returning a code back to the opening windows...so i want to close the popup, or returning the value to the opening windows if i have a screen refresh in the popup
    Can anyone help in this issue? Many thanks

    Hi,
    I'm not sure I've fully understood what you require... but here's something you can try.
    Lets say that you search for some user entered criteria and display results to the user in the pop up JSP. I am assuming that there would be some user action on which you want to return something to the parent window and then close the child window.
    You can access the parent window using:
    window.opener.document.<form name>.<field name>
    and then close the pop up window using a simple window.close();
    On the other hand, if you want to close the window w/o any user inputs (directly after the server side processing), then make the server side processing send a status parameter back to the pop up window. For example, set a parameter in the request which will trigger a JavaScript in the pop up window to close itself.
    Hope this helps.
    Cheers !
    Vinay

  • Issue with JSF action method and Popup

    All,
    I have command Button, which has an action method. And my onclick function opens new popup. Once I close the popup, it has to return some values to the parent page and then my action method has to be executed.
    Issue is if I close the popup, nothing is happening in parent page.
    In my JavaScript if I return true, popup is opening and my action method is executing. But my expected behavior is after closing popup then only my action has to be executed.
    Thanks,
    Dhana

    Hi all,
    I came back to this today (after almost 2 years)... the current version of facestrace doesn't require a taglib at all: http://code.google.com/p/primefaces/downloads/list
    Just drop it in WEB-INF/lib, add *.jsf to the url mappings for the faces servlet. Then whenever you add trace=true to your URL, you get a nice dump of information there.
    Best,
    John

Maybe you are looking for