Page load event

I'm new to JSF and am looking for something equivalent to the OnPageLoad() event that exists in the ASP.Net world. Basically I want to do some initialization code, maybe prep some variables to be bound to controls, etc.
Does JSF expose an event that allows me to do this? I've read about an OnPageLoadBegin(FacesContext) event, but I tried putting code in there and placing a breakpoint - but the breakpoint never gets triggered.
Thanks
David

From what I read in those links, there is a serious limitation to JSF in the fact that there is no true "page load" event.
Consider the following example : We have a "main page" that asks a user to log in with a username and password. But if the user has been to the site before, we will store their login ID in a cookie so that when they come back, the "login" input field will be pre-populated with their info. Pretty basic and standard stuff so here.
So I want a "page load" event where I can get the request cookie map, do a lookup on our cookie, and Set the value on the input field with the value of the cookie.
Without a page-load event, I don't see how this is possible.
Any suggestions/workarounds?
TIA
David

Similar Messages

  • 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.

  • EP6 using IE page load event

    What event can I look for that will fire after the page has been formatted?
    Using Internet Explorer on Enterprise Portal release 6. Code is a mix of jsp, html and javascript referencing a bean containing the table data.
    I have built a script that will reconfigure an html table into one which uses scrollbars/sliders but it must run after the loader has determined the column widths. I have tested using a button and the code works fine but have not been able to find an event which fires late enough for the column widths to be set.
    I tried using the htmlb table but scrolling by page method is not desirable for this application. Do not want the overhead of sending requests to the server every time the user wants to adjust position within the table.

    Yes it is a problem using javascript. The problem is that the onload event fires before the html table is formatted.
    It is also a problem that the htmlb table will not allow the use of slider/scrollbars.
    Since the htmlb table will not allow sliders I must write my own table code to do so therefore I am looking for a method to fire off a javascript function after the page is formatted. This happens on the client side after it has received all the html. Unfortunately onload fires as soon as the complete script is received but before it has done the formatting.
    I don't believe there is any example which covers this as the SAP documentation is very adamant about using the htmlb table view with buttons to page even though it states that tables should be kept short because of how cumbersome it is to page a table.
    If I set visible rows to 5 but have six rows of data it requires a trip to the server and back to display the next row. If I load all rows into the table and setup a slider/scrollbar all that happens is the client scrolls the table - no server access required. Since there is no way to know exactly how many rows will be available there is no way to set the visible rows large enough. And if visible rows is set too large the page then becomes too big to fit the screen. Now add more than one table and there is really no good way to make the data visible to the user without allowing scrolling(not paging) of the table
    Users are also much more accustomed to sliders versus page buttons.
    If you have a script to do this please post it.

  • How to set Lov item property (Action type,event,parameter etc) in PR when page load

    Hi gurus
    I am new to OAF, First I need to explain my scenerio.
    I need to make some field mandatory or non mandatory based on one LOV item (Pick list or message choice list).
    for this i extended the controler and apply the changes, but in this case what heppen, It will effect only when i open the list (pop list) and click on more (Available in poplist) and it will open a new form and i select value from that form. But when I open the poplist and select the value from the same list rather going to more option (it does not open new form), then there are no effect. I though the issue with refreshing when selecting value from the same list.
    To resolving this issue what i did
    1. go to page == > the same LOV
    2. Change the Client Action properties (
         Action type  = fireAction
         event          = xxevent
        submit = true.
    After doing this when i run the page from my OAF enviroement , every thing is OK. Then I transfer the Controler to Server machine and change the controller and run the same page from the server, it has the same refreshing issue, Then I thought because I did not transfer LOV such properties so this is hepening,
    Now I want to initilize such properties in Page load or what I need to do, Please advise me.
    Regards,
    Haq

    Edward,
    Thank you for the suggestion! It directly lead to my solution wherein I used CASE statements for the column in my Region SELECT such as the following:
    WHEN (:P2_GRADING_METHOD = 'CR/NC' OR scs.scs_pass_audit = 'P') AND GET_GRADE_B93 (sac.stc_final_grade, sac.stc_verified_grade) IS NULL THEN htmldb_item.select_list_from_lov (5, 'Enter Grade', 'GRADE_LOV_CRNC','onBlur="return validate_grade(this,''FW_DATE_'||ROWNUM||''')"','NO',NULL,NULL,'GRADE_'||ROWNUM)
    When the column is NULL, the Select List (LOV) contains the entry 'Enter Grade' and that is the value displayed on page load. I bypass the value 'Enter Grade' during Submit Processing where database updating occurs.
    I did not find the need to enter values for p_null_value and p_null_text since I don't believe that it would cause the 'Enter Grade' value to display on page load for null value columns but rather would enable the user to select 'Enter Grade' from the list and have a specified return value stored in htmldb_item array.
    Again, thank you for the help!

  • Page not loading - Events, To-do list, Notes

    Hi,
    I am having this error of not loading events, to-do list or notes pages. It gives me following message.
    "Sorry, we're having some problems bringing you this page. It's our fault not yours, so please try again later."
    I saw similar posts regarding this on this discussions forums. Some suggested solutions were to change browser agent and clear browswer cache.
    I already tried signin into Ovi using different browsers (FF, IE, Opera and Chrome) on different computers. I still get the same error message.
    Also, when I try to sync Notes to my Nokia N82, Phones gives me an error message "System Error". Device firmware is V 30.0.019.
    Anybody else get this error? Any solutions?
    Your help will be really appreciated since I have important information on my notes.
    Thank you.

    Did the problem appear just now or have you had it since beginning?
    Are you using any specific language or charactersin your devices or are they all in english?
    For me the cache clear has always helped but as you mentioned, you have already tried that. so it sounds like there is something wrong with your account? Did you try to contact Nokia?

  • Can you make a DIV appear/fade on page load instead of the listed events?

    Does anyone know if there's a way to have a specific DIV fade
    in when the page loads? I know how to do it with a click or mouse
    over, but the behavior panel won't let me change the event to
    onLoad. It says that's an invalid event for the DIV tag. I found a
    javascript code that makes the DIV appear when the page loads and
    it work...until I tried to add other Spry behaviors. Then it
    refused to fade in. I can provide that code if it helps.
    Thanks!

    Thanks for the speedy response. But your answer went right
    over my head. I'm using Dreamweaver and a complete novice in
    javascript or coding...for now. (But I'm taking classes, so there'
    hope for me yet.)
    When you say "use SpryDOMUtils.js" is that a script I need to
    find, reference, load?
    Maybe I should post this question on the Dreamweaver since
    I'm so ignorant about coding?

  • Load event on page startup

    I have a page that I don't want t o display unless there is a customer session object. If there is no customer session object, I want to redirect the user to a login page. How can I do this in jsf when the page loads?
    Thanks!!

    Non-JSF solution (bad solution):
    <% if (session.getAttribute("..")==null) { %>
    <jsp:forward page="login.jsp"/>
    <% } %>
    JSF solution
    JSP1.jsf:
    <h:commandButton value="Go" action="#{bean1.action1}" immediate="true"/>
    public class SomeBean {
    public String action1(){
    if (!FacesContext.getCurrentInstance() .getExternalContext().getSessionMap().contain("something")) {
    return "goToLoginPageFirstKey";
    } else {
    return "success";
    Regards,
    Oleksa Stelmakh

  • How to call Web Services (with javascript) in a view load event ?

    Hello to the expert community,
    I'm looking for a piece of javascript code allowing to call Web Services in a view load event ?
    Any ideas will be really appreciated.
    Regards.
    Have a nice week.

    Thank you for your answer, dongmei.
    It seems that the MethodResultTableDataProvider does not return the response of the web service as a value field if the WSDL contains only one result element.
    E.g. from WSDL of the USWeather Web Service which returns theGetWeatherReportResult string:
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.webserviceX.NET" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://www.webserviceX.NET" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <wsdl:types>
        <s:schema elementFormDefault="qualified" targetNamespace="http://www.webserviceX.NET">
          <s:element name="GetWeatherReport">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="GetWeatherReportResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="GetWeatherReportResult" type="s:string" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="string" nillable="true" type="s:string" />
        </s:schema>If I drag the web service method on the page and I should be able to select the response value in the Bind to Data dialog box. But there is no value field. Value fields only occur if the web service returns more than one value.
    The question is how can I get the response GetWeatherReportResult from the service.

  • Passing data to another page loaded in the same window

    How to pass data from a page to another when new page loading
    takes place ?
    I use :
    window.htmlLoader.load( new air.URLRequest("app:/" +
    htmlfilename));
    I tried :
    window.htmlLoader.addEventListener(air.Event.CHANGE,
    passmonitor)
    but it doesn't work !

    The problem is in passing the variables . As I mentioned
    above,, the following error message gets displayed:
    Can't get property window from undefined value
    The code I tried is
    myloader = window.htmlLoader.load(new air.URLRequest("app:/"
    + filen ));
    myloader.window.somevar = "data";

  • Error while opening modal (skillbuilder plugin)  page on page load

    Hi all,
    I'm using 4.2.1. ( on 11GR2 ), theme 25.
    Skillbuilder Modal page plugin v2
    Modal pages are working great, on all kinds of events, but if I try to open one via a D.A. on page load it fails with "Uncaught TypeError: Object load has no method 'stopImmediatePropagation' " error (in the browser console).
    <edit>
    just found that this error is caused by the "cancel event" DA action which should be fired after the open modal dialog action. If I ommit this cancel event the modal page is not loaded but also no error is shown.
    </edit>
    Any ideas on how to fix this? In the end I just want to open a modal window after the page is loaded depending on the value of an item set when loading the page ( the branch sets an item value to indicate that the modal window should be opend ).
    Regards
    Bas
    Edited by: Bas de Klerk on 11-apr-2013 7:43

    Narrowed it down to change in behaviour between APEX 4.1 and APEX 4.2
    Page source for both versions is alsmost similar, besides the different APEX js libraries being loaded, so probably the source of the problem is somehow in there.
    Apex 4.1 generates code below :
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html lang="nl" xmlns="http://www.w3.org/1999/xhtml" xmlns:htmldb="http://htmldb.oracle.com" xmlns:apex="http://apex.oracle.com">
    <head>
      <title>sdfsdfsf</title>
    <link rel="stylesheet" href="/i/css/apex_4_1.min.css" type="text/css" />
    <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_4_1.css" type="text/css" /><![endif]-->
    <link rel="stylesheet" href="/i/libraries/jquery-ui/1.8.14/themes/base/jquery-ui.min.css" type="text/css" />
    <script type="text/javascript">var apex_img_dir = "/i/", htmldb_Img_Dir = apex_img_dir;</script><script src="/i/javascript/apex_4_1.min.js" type="text/javascript"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0.css" type="text/css" />
      <!--[if IE]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie.css" type="text/css" /><![endif]-->
      <!--[if IE 6]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie6.css" type="text/css" /><![endif]-->
      <!--[if IE 7]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie7.css" type="text/css" /><![endif]-->
    </head>
    <body >
    <!--[if lte IE 6]><div id="outdated-browser">You are using an outdated web browser. For a list of supported browsers, please reference the Oracle Application Express Installation Guide.</div><![endif]-->
    <form action="wwv_flow.accept" method="post" name="wwv_flow" id="wwvFlowForm">
    <input type="hidden" name="p_flow_id" value="101" id="pFlowId" /><input type="hidden" name="p_flow_step_id" value="3" id="pFlowStepId" /><input type="hidden" name="p_instance" value="3963167387744880" id="pInstance" /><input type="hidden" name="p_page_submission_id" value="1130499891713056" id="pPageSubmissionId" /><input type="hidden" name="p_request" value="" id="pRequest" />
    <div id="header">
      <div id="app-logo"><a href="f?p=101:1:3963167387744880"><span style="font-family:Arial; color:green; font-size:18; white-space:nowrap; font-weight:bold;">SoMStudie v1.06 - Productie</span></a></div>
      <div id="navbar">
        <div class="navbar-entry"><a href="javascript:{if (confirm('Applicatie uitloggen ? Niet opgeslagen wijzigingen gaan verloren !')) redirect('wwv_flow_custom_auth_std.logout?p_this_flow=101&p_next_flow_page_sess=101:1');}" class="navbar-link">Uitloggen</a></div>
        <div class="app-user">Welcome: ADMIN</div>
      </div>
    </div>
    <div id="tabs">
      <div class="frame">
        <div class="bg">
          <div class="tab-holder">
          </div>
        </div>
      </div>
    </div>
    <div id="topbar"></div>
    <div id="messages"></div>
    <div id="body">
      <table class="tbl-body" cellspacing="0" cellpadding="0" border="0" summary="">
        <tbody>
          <tr>
            <td class="tbl-main" width="100%"><div class="rounded-corner-region" id="R9719141085411482" >
      <div class="rc-blue-top"><div class="rc-blue-top-r">
        <div class="rc-title">sdfsdf</div>
        <div class="rc-buttons"></div>
      </div></div>
      <div class="rc-body"><div class="rc-body-r"><div class="rc-content-main"><table id="apex_layout_9719141085411482" border="0" class="formlayout" summary="" role="presentation" datatable=0 ><tr><td nowrap="nowrap" align="right"><label for="P3_X" tabindex="999"><a class="optional-w-help" href="javascript:popupFieldHelp('9719940026416952','3963167387744880')" tabindex="999">X</a></label></td>
    <td  colspan="1" rowspan="1" align="left" valign="middle"><input type="hidden" name="p_arg_names" value="9719940026416952" /><input type="text" id="P3_X" name="p_t01" value="" size="30" maxlength="4000" class="text_field" /></td></tr>
    </table>
    </div></div></div>
      <div class="rc-bottom"><div class="rc-bottom-r"></div></div>
    </div></td>
            <td class="tbl-sidebar"></td>    
          </tr>
        </tbody>
      </table>
    </div><div id="footer"><div class="content">
      <div id="customize"></div> 
    </div></div>
    <input type="hidden" name="p_md5_checksum" value=""  /></form>
    <script type="text/javascript">
    apex.da.initDaEventList = function(){
    apex.da.gEventList = [
    {"triggeringElement":"document","triggeringElementType":"DOM_OBJECT","bindType":"bind","bindEventType":"ready",actionList:[{"eventResult":true,"executeOnPageInit":false,"stopExecutionOnError":true,javascriptFunction:function(){
       if (this.browserEvent !== 'load'){
          apex.jQuery(document).apex_modal_page('openPageFromApexThis', this);
    },"attribute02":"STATIC","attribute03":"f?p=101:21:3963167387744880::21:::","attribute05":"data-url","attribute06":"div#success-message","attribute07":"AUTO","action":"PLUGIN_COM_SKILLBUILDERS_MODAL_PAGE"},{"eventResult":true,"executeOnPageInit":false,"stopExecutionOnError":true,javascriptFunction:apex.da.cancelEvent,"action":"NATIVE_CANCEL_EVENT"}]}];
    </script>
    <link rel="stylesheet" href="#PLUGIN_PREFIX#plugins/modal-page/server/TEST.css" type="text/css" />
    <script type="text/javascript" src="wwv_flow_file_mgr.get_file?p_plugin_id=34423998056404065675&p_security_group_id=4874907161072557&p_file_name=jquery.colorbox-min.js"></script>
    <script type="text/javascript" src="wwv_flow_file_mgr.get_file?p_plugin_id=34423998056404065675&p_security_group_id=4874907161072557&p_file_name=apex_modal_page.min.js"></script>
    <script type="text/javascript">
    <!--
    apex.jQuery(document).ready(function(){
    (function(){apex.jQuery(document).apex_modal_page({
       "transition":"none",
       "draggable":true,
       "initialHeight":100,
       "initialWidth":300,
       "overlayOpacity":.5,
       "scrolling":true,
       "loadingImageSrc":""
    (function(){apex.da.initDaEventList();})();
    (function(){apex.da.init();})();
    //-->
    </script></body>
    </html>Apex 4.2 on same server etc, after upgrade generates code below :
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html lang="nl" xmlns="http://www.w3.org/1999/xhtml" xmlns:htmldb="http://htmldb.oracle.com" xmlns:apex="http://apex.oracle.com">
    <head>
      <title>sdfsdfsf</title>
      <link rel="stylesheet" href="/i/css/apex.min.css?v=4.2.0.00.27" type="text/css" />
    <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie.min.css?v=4.2.0.00.27" type="text/css" /><![endif]-->
    <link rel="stylesheet" href="/i/libraries/jquery-ui/1.8.22/themes/base/jquery-ui.min.css" type="text/css" />
    <script type="text/javascript">
    var apex_img_dir = "/i/", htmldb_Img_Dir = apex_img_dir;
    </script>
    <script src="/i/libraries/apex/minified/desktop_all.min.js?v=4.2.0.00.27" type="text/javascript"></script>
    <script src="/i/libraries/apex/minified/legacy.min.js?v=4.2.0.00.27" type="text/javascript"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0.css" type="text/css" />
      <!--[if IE]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie.css" type="text/css" /><![endif]-->
      <!--[if IE 6]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie6.css" type="text/css" /><![endif]-->
      <!--[if IE 7]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie7.css" type="text/css" /><![endif]-->
    </head>
    <body >
    <!--[if lte IE 6]><div id="outdated-browser">You are using an outdated web browser. For a list of supported browsers, please reference the Oracle Application Express Installation Guide.</div><![endif]-->
    <form action="wwv_flow.accept" method="post" name="wwv_flow" id="wwvFlowForm" novalidate >
    <input type="hidden" name="p_flow_id" value="101" id="pFlowId" /><input type="hidden" name="p_flow_step_id" value="3" id="pFlowStepId" /><input type="hidden" name="p_instance" value="2102738057213" id="pInstance" /><input type="hidden" name="p_page_submission_id" value="6687700944614" id="pPageSubmissionId" /><input type="hidden" name="p_request" value="" id="pRequest" />
    <div id="header">
      <div id="app-logo"><a href="f?p=101:1:2102738057213"><span style="font-family:Arial; color:green; font-size:18; white-space:nowrap; font-weight:bold;">SoMStudie v1.06 - Productie</span></a></div>
      <div id="navbar">
        <div class="navbar-entry"><a href="javascript:{if (confirm('Applicatie uitloggen ? Niet opgeslagen wijzigingen gaan verloren !')) redirect('wwv_flow_custom_auth_std.logout?p_this_flow=101&p_next_flow_page_sess=101:1');}" class="navbar-link">Uitloggen</a></div>
        <div class="app-user">Welcome: ADMIN</div>
      </div>
    </div>
    <div id="tabs">
      <div class="frame">
        <div class="bg">
          <div class="tab-holder">
          </div>
        </div>
      </div>
    </div>
    <div id="topbar"></div>
    <div id="messages"></div>
    <div id="body">
      <table class="tbl-body" cellspacing="0" cellpadding="0" border="0" summary="">
        <tbody>
          <tr>
            <td class="tbl-main" width="100%"><div class="rounded-corner-region" id="R9719141085411482" >
      <div class="rc-blue-top"><div class="rc-blue-top-r">
        <div class="rc-title">sdfsdf</div>
        <div class="rc-buttons"></div>
      </div></div>
      <div class="rc-body"><div class="rc-body-r"><div class="rc-content-main"><table id="apex_layout_9719141085411482" border="0" class="formlayout"  summary="" role="presentation"><tr><td nowrap="nowrap" align="right"><label for="P3_X" tabindex="999"><a class="optional-w-help" href="javascript:popupFieldHelp('9719940026416952','2102738057213')" tabindex="999">X</a></label></td><td  align="left" valign="middle"><input type="hidden" name="p_arg_names" value="9719940026416952" /><input type="text" id="P3_X" name="p_t01" class="text_field"  value="" size="30" maxlength="4000"  /></td></tr></table></div></div></div>
      <div class="rc-bottom"><div class="rc-bottom-r"></div></div>
    </div></td>
            <td class="tbl-sidebar"></td>    
          </tr>
        </tbody>
      </table>
    </div><div id="footer"><div class="content">
      <div id="customize"></div> 
    </div></div>
    <input type="hidden" name="p_md5_checksum" value=""  /><input type="hidden" name="p_page_checksum" value="E08AB8A6D69B3450572EC2E89A528B29" id="pPageChecksum" /></form>
    <script type="text/javascript">
    apex.da.initDaEventList = function(){
    apex.da.gEventList = [
    {"bindEventType":"ready",actionList:[{"eventResult":true,"executeOnPageInit":false,"stopExecutionOnError":true,javascriptFunction:function(){
       if (this.browserEvent !== 'load'){
          apex.jQuery(document).apex_modal_page('openPageFromApexThis', this);
    },"attribute02":"STATIC","attribute03":"f?p=101:21:2102738057213::21:::","attribute05":"data-url","attribute06":"div#success-message","attribute07":"AUTO","action":"PLUGIN_COM_SKILLBUILDERS_MODAL_PAGE"},{"eventResult":true,"executeOnPageInit":false,"stopExecutionOnError":true,javascriptFunction:apex.da.cancelEvent,"action":"NATIVE_CANCEL_EVENT"}]}];
    </script>
    <link rel="stylesheet" href="#PLUGIN_PREFIX#plugins/modal-page/server/TEST.css" type="text/css" />
    <script type="text/javascript" src="wwv_flow_file_mgr.get_file?p_plugin_id=34423998056404065675&p_security_group_id=4874907161072557&p_file_name=jquery.colorbox-min.js"></script>
    <script type="text/javascript" src="wwv_flow_file_mgr.get_file?p_plugin_id=34423998056404065675&p_security_group_id=4874907161072557&p_file_name=apex_modal_page.min.js"></script>
    <script type="text/javascript">
    apex.jQuery( document ).ready( function() {
    (function(){apex.jQuery(document).apex_modal_page({
       "transition":"none",
       "draggable":true,
       "initialHeight":100,
       "initialWidth":300,
       "overlayOpacity":.5,
       "scrolling":true,
       "loadingImageSrc":""
    (function(){apex.da.initDaEventList();})();
    (function(){apex.da.init();})();
    });</script>
    </body>
    </html>Any suggestions why this plugin does not load on page load in 4.2 would be great ( a fix would be even better :) ).
    Regards

  • Creation of components on page load

    Hi All,
    My question stems from the answers I received in these forum posts:
    - http://forum.java.sun.com/thread.jspa?threadID=5262963
    (how to dynamically add components to a specific position in the page)
    - http://forum.java.sun.com/thread.jspa?forumID=427&threadID=5262253
    (how to register a PhaseListener to trigger before rendering the response)
    What I'm trying to do now is to dynamically create components inside a container as soons as the page loads. To do this I have placed the following code inside the beforePhase() method of my PhaseListener:
    FacesContext.getCurrentInstance().getApplication().addComponent("Label", Label.class.getCanonicalName());
    Label label = (Label)FacesContext.getCurrentInstance().getApplication().createComponent("Label");
    label.setText("Hello World!");   
    panelGroup.getChildren().add(label);I've also modified my JSP page as follow:
    <webuijsf:panelGroup binding="#{TestPage.panelGroup}"/>I've tried debugging the code, and my PhaseListener is definitely working (as my code gets executed), but when the view is rendered the label isn't displayed at all. It works fine, however, if I put the code inside a method and connect an actionListenerExpression to it which gets called when a button is pushed.
    Any ideas?
    Ristretto

    Hi Ristretto,
    A couple comments. First, if the "Label" component is already declared in a faces-config.xml file somewhere, you don't need to re-register it w/ JSF... and you certainly don't need to do it each time your code is executed. If this is the Woodstock Label component (as the "webuijsf:" prefix implies for your other components), then you don't need to do this. So you can remove the first line of code (the addComponent() line).
    From what you've described, I would think it should work. Your panelGroup variable is the same instance of the object returned from the binding in your JSP, and the phase listener gets invoked before anything gets rendered. If that happens, everything should work as you want it to. Obviously something's not right, though... and unfortunately I don't see it either.
    Why do you want to do this in a phase listener instead of during your binding?
    I would not recommend creating a hierarchy of managed beans that register themselves as phase listeners and provide behavioral functionality for your application. This is very likely to be difficult to maintain, will cause every page to execute these phase listeners, and simply cause you problems. That said... there may be cases where phase listeners are a good fit in order to execute code on every request, so maybe what you're doing is ok for your use-case -- that's your call. :)
    Let me show you a complete, runnable example of how JSFT can do exactly what you described below w/o writing any Java code or compiling, etc.:
    <sun:page>
    <sun:html>
    <sun:head title="Woodstock Example" />
    <sun:body>
    <sun:form id="form">
    <sun:panelGroup id="panelGroup">
        <!afterCreate
            createComponent(type="sun:label", id="label", parent="$this{component}", component=>$attribute{comp});
            setUIComponentProperty(component="$attribute{comp}", property="text", value="Hello World!");
        />
    </sun:panelGroup>
    </sun:form>
    </sun:body>
    </sun:html>
    </sun:page>The "sun:" tags are the same as the "webuijsf:" tags (woodstock) you are using. If you use the facelets syntax w/ JSFT, you can map the prefix to "webuijsf:" also. When run, the panelGroup part of the page looks like this in the browser's source:
    <span id="form:panelGroup"><label id="form:panelGroup:label" class="LblLev2Txt_sun4">
    Hello World!
    </label></span>The "createComponent" and "setUIComponentProperty" handlers are builtin to JSFT and do what your simple example needed, however, using a simple annotation you can create your own custom handler to do anything you want (assuming your performing some logic or retrieving data from somewhere to create these components on the fly). These handlers demonstrate that there are better alternatives to "managed beans." Managed beans tend to get tied to a particular page and scope... but logic should neither be tied to a page, scope, or a particular use-case. By allowing parameterized handlers to exist, you can invoke them from anywhere. This is the re-usability you are trying to achieve through inheritance without the overhead that you will incur.
    If you'd rather add the component during the rendering phase instead of the restore view phase (afterCreate is during the restore view phase in JSFT), you can use the "beforeEncode" event. And furthermore, you don't have to associate the event w/ the component in which it should be associated with (although you can)... for example you could put this event at the top of the page so that it gets invoked at the beginning of the render response phase:
    <!beforeEncode
        getUIComponent("form:panelGroup" component=>$attribute{parent});
        createComponent(type="sun:textField", parent="$attribute{parent}", component=>$attribute{comp});
        setUIComponentProperty(component="$attribute{comp}", property="text", value="#{pageSession.foo}");
    />This causes a woodstock textfield to be added before rendering the page. However, unlike creating a component tree, rendering happens each time the page is refreshed. So, this code could potentially get invoked many times... just add a button w/o any navigation rule and you'll see it add a new text field each time you click the button.
    Last... you may want to consider using facelets way of composing pages. This allows you to create a template which may include page-based phase listeners, or events (as shown above), or bindings... as well as the obvious header / footer and other template content. This again is a much better re-use strategy than maintaining a bunch of JSPs. And JSF 2.0 is going to emphasize Facelets syntax over JSP for this reason.
    Good luck!
    Ken Paulsen
    https://jsftemplating.dev.java.net

  • Embedding video in a dinamic page loaded using ajax

    I've been trying to do this for some days now, and still couldnt find a solution.. this is the story:
    I need to embed a movie (.mov, mp4, m4v) in a dynamic page loaded by an ajax call, i followed the recommendations specified in apple's page so i can monitor progress, and listen DOM events:
    QuickTime and JavaScript
    on Firefox, everything works very well, i can monitor progress, listen events, etc.. etc... (this app is intended to be multi browser)
    On the contrary, IE is driving me crazy, it does not do anything.
    So to debug this i did the following (for IE):
    i tried then, creating a simple STATIC page in my computer, that loads the movie, and listens to its events, it worked good.
    Then i put that html file in a web server, and every "first time" that i open the page, it wont work at all. After a reload, it will work good.
    Then i created a simple page with an ajax call that will insert the html embedding the movie, and again it wont work in IE.
    I want to be able to listen DOM events in IE in a dynamic page
    Please help me with this.
    <Edited by Moderator>

    I've been fighting this last couple days as well.
    Somehow the dom events are not fired
    –in win explorer that is– when the movie is
    inserted after the document loaded.
    I've been trying many variation to get it to
    work and just found a hackish way:
    After you have added the movie via javascript
    use the movie.SetURL('/movie.mov') function
    and then the RegisterListener() function.
    This enabled the Dom event for me.
    Additionally you can use
    movie.SetResetPropertiesOnReload(false) to
    keep the movie properties.
    function insertMov() {
    var embtxt = QTGenerateOBJECTTextXHTML("../movies/main.mov",
    477,
    268,
    'obj#id', 'mainobjId12',
    'emb#id', 'mainembId12',
    'emb#name', 'mainembName12',
    'EnableJavaScript', 'True',
    'postdomevents', 'True',
    'autoplay', 'False',
    'controller', 'False'
    var mov_container = document.getElementById('mov_container');
    mov_container.innerHTML= embtxt;
    setTimeout('reg()',100);
    function reg(){
    document.getElementById('mainobjId12').SetResetPropertiesOnReload(false)
    document.getElementById('mainobjId12').SetURL("../movies/main.mov");
    RegisterListener('qt_canplaythrough', 'mainobjId12', 'mainembId12', aallrrtt);
    function aallrrtt(){
    alert('qt_canplaythrough');
    }

  • URL of the current portal page loaded using Javascript ?

    Hello:
    I am trying to add programmatically the url of the current
    page loaded in the portal to the 'Favorites List'. There
    is a pre-built KM iview to store your 'favorites'.
    I can extract and write to this 'favorites' using KM java
    API. But only challenge is to extract the current loaded
    page URL and title using Javascript.
    I would appreciate any help in this regard.
    Thank you very much,
    Prasad Nutalapati

    Dude i was having the exact same problem. I solved it using the SAP-provided EPCM (javascript client framework).
    Javascript Code
    var pageName = "";
    var URL = "";
    function bookmarkPage()
         /* page url */
         var fullURL = "https://<%=request.getServerName()%>/irj/portal?NavigationTarget=" + URL;
         /* IE bookmark */
         if(EPCM.getUAType() == EPCM.MSIE)
              window.external.AddFavorite(fullURL , pageName);
         else
              var msg = "Sorry. The \"Add To Favorites\" feature only works with Internet Explorer. " +
                          "The URL to this page is " + fullURL;
              alert(msg);
    /* get pagename from eventObject from subscribed event */
    function getPageObject(eventObj) {
        pageName = eventObj.dataObject.title;
        URL = eventObj.dataObject.URL;
    /* subscribe to event in pagetoolbar area */
    EPCM.subscribeEvent("urn:com.sapportals:navigation", "AddNavTargetAllowDuplicate", getPageObject);
    End of code
    Basically, what this does is that everytime a page loads, the innerpage, where the content is, raises an event using  the EPCM.raiseEvent() method. EPCM.subscribeEvent subscribes to an event called AddNavTargetAllowDuplicate which has an object holding the page information (i.e. page title and URL (ROLE://...)). Everytime that it notices an event raised, the function getPageObject gets called to go get data from the event object that is available globally in the framework.
    You should be able to put this code anywhere in any iview and it should work. Thou i have only tried putting it in the masthead. Try and if you still have questions please let me know.

  • Looking for hook into a mb method on page load of jsff with auto query on view criteria.

    Hello,
    I have a View Criteria that is set to Query Automatically (showing data to match today's date).  The target table has a detail table and there is a control that shows parsed XML from the current row in the detail table into a table that I build dynamically. The main table and the detail table show the proper data on page load but the table for the parsed XML is empty.  The dynamic table is bound to a managed bean where the parsing is done and data is created.  I have the control refreshing properly on a row change of the main and detail tables and on a queryListener for the view criteria.
    This is for a jsff page. I have been trying a bunch of approaches with no success.  The detail table has a ppr to the main table and the query.  I am looking some event on either the query, the main table or the detail table where I can make a call to my managed bean to parse the XML, build the table and refresh the control.  I have an attribute binding to the XML data (when I placed it in a control as plane XML it refreshed properly).  I only need this on initial page load or first time the tables are populated, I have the other use cases covered.
    Running JDev 11.1.2.4
    Thank you
    Rudy

    ok but where?
    i have read a topic about "setRefreshOption", but i need a component to execute it.
    i have read a topic about a false criteria (1=2), and when i want search, i remove it, but again, i need a component to execute it.
    i have read a topic about ${adfFacesContext.postback == true} to write into iterator proeprty, but i haven't this view into my appmodule.
    i'm really sorry, but please, can you explain me a little ?
    Edited by: bradici on 8 oct. 2009 16:36

  • 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

Maybe you are looking for

  • I bought a new iMac and the apps for iWork aren't free for me when they should be, help?

    I recently bought a new iMac this December. I thought Pages, Keynote, and Numbers are suppose to be free with the computer but it says I have to pay for them. is there any idea how to fix this issue?

  • Font in SWF file different once inserted and previewed in Captivate 5

    I have inserted a SWF File as an animation into my captivate 5 movie. When I view the SWF file independently, thus, outside of Captivate, the font looks exactly as it should: in Arial. However, once I have inserted the SWF file into Captivate and pre

  • Oracle Client OLEDB Provider Installation

    I need to call Oracle OLEDB Provider "setup.exe" once I complete installing our product (using Installshield). I tried all different ways to do this and I have absolutely no luck. 1. I tried calling LaunchaAppAndWait(SRCDIR^"disk1\\install\\win32\\se

  • VBAI2011 Save for Previous Version option

    Hello, Since VBAI 2011 is one of NI products, I am curious that it has an option of Save As For Previous version like Labview, or is there any way around it?.  I currenlty have running Labview 8.6 in my systems which doesn't work well with VBAI 2011.

  • How to restore mail with Time Machine?

    Hi, I recently (accidentally) deleted an old mail account, which also seems to delete all of the messages on that account from your mail client. Using time machine I selected the application (from a backup about a week ago), and clicked 'Restore'. I