Issue with invoking javascript during jspx page load

Hi All,
I am using Jdeveloper 11gR2.
I have embedded a small javascript snippet in the adf page to invoke a managed bean method during page load.
<af:serverListener type="onloadEvent" method="#{AMBean.click}"/>
            <af:clientListener method="onLoadClient" type="load"/>
            <af:resource type="javascript">function onLoadClient(event) {AdfCustomEvent.queue(event.getSource(),"onloadEvent",{},false); return true;}</af:resource>
In the associated managed bean method, I want to change the setContentStyle of all the input text field found during run time -
        System.out.println("There control is inside the listeners");
        FacesContext facesContext = FacesContext.getCurrentInstance();
        System.out.println("facesContext"+facesContext);
        UIViewRoot root = facesContext.getViewRoot();
        System.out.println("root - " +root);
        RichPanelFormLayout formClass = (RichPanelFormLayout)root.findComponent("db");
        System.out.println("formClass - " + formClass);
        List<UIComponent> uiComponentList = formClass.getChildren();
              for (UIComponent uiComponent : uiComponentList) {
                  if (uiComponent instanceof RichInputText) {
                      //((RichInputText)uiComponent).setDisabled(false);
                      //((RichInputText)uiComponent).setColumns(100);
                     ((RichInputText)uiComponent).setContentStyle("width:200px");
                      System.out.println("uiComponent - " +uiComponent);
Currently the javascript function "queues" the setContentStyle action for an action event, i.e. during the initial page load, the properties of text fields are not changed, however as soon as i click any button on the page, the text field width is reset to what I have defined in setContentStyle property.
Is there a way to execute setContentStyle action as soon as the page loads initially?
Best Regards,
Ankit Gupta

Hi Arun,
Many thanks for the revert.
The exact Jdeveloper version is 11.1.2.4.39.64.36.1.
I have a scenario where in the the user will be navigated to a page to display an input form, but the underlying VO will change during runtime which means depending on the value selected by the user, he will be shown an ADF form accordingly.
Also during runtime, the number of input text fields will change according to the number of attributes in underlying VO.
Kindly advise based on the use case explained above.
Best Regards,
Ankit Gupta

Similar Messages

  • Issues with Executing Javascript command in Captivate

    Hi,
    I am having issues with executing javascript for a button in adobe captivate 5.  Let me explain what I am trying to do.  I am working on a WBT that has three skill checks throught the course. These skill checks are not graded or tracked for completion.  I currently have an image button that has the command "Open another project" The first image button is pointed to SkillCheck1 and I have the html file and swf file in the published root folder.  This currently works fine.
    However I want to use javascript to open a new window 800X600 with not toolbars at the top.  I got this part working with the code below:
    window.open('http://www.adobe.com','mywin',
    'left=40,top=40,width=800,height=600,toolbar=1,resizable=0');
    My only problem is, once the popup opens, my WBT goes to a page that says [object] and thats it.  I am uploading two images to show what I have.  Can someone help resolve my issue of the WBT going to

    Ok so I took this link and viewed over it.  I am new to Javascript and know very little about it.  Therefore this script kind of makes no sense to me.
    <script language="JavaScript"><!--
    var windowHandle = '';
    function myOpen(url,name,attributes) {
        windowHandle = window.open(url,name,attributes);
    //--></script>
    <a href="javascript:myOpen('page.htm','windowName','height=100,width=100')">text link</a>
    I chose the option to exectute javascript.  Does captivate need all of this including <script language=JavaScript">  Here is how I edited the script.  Should I make any changes to what is in bold?
    var windowHandle = ''; 
    function myOpen(url,name,attributes) {
        windowHandle = window.open(url,name,attributes);
    <a href="javascript:myOpen('http://www.adobe.com','Adobe Website','height=600,width=800')">text link</a>

  • af:serverListener not fired on a jspx page load

    Hi,
    I'm using JDeveloper 11g Update 1.
    I would like to fire a serverListener on a jspx page load.
    The javascript method that i'm using is fired while the server listener is not fired.
    Here's the code.
    <pre>
    //In my jspx
    <af:document title="Page Title" clientComponent="true">
    <af:clientListener method="fireServerListener" type="load"/>
    <af:clientAttribute name="serverListenerType" value="serverMethod"/>
    <af:serverListener type="serverMethod" method="#{myBean.serverMethod}"/>
    <f:facet name="metaContainer">
    <trh:script source="js/lib.js"></trh:script>
    </f:facet>
    //In lib.js
    function fireServerListener(event){
    var source = event.getSource();
    var immediate = this._immediate;
    var params = {};
    var srvLstnrType = source.getProperty("serverListenerType");
    AdfCustomEvent.queue(source, srvLstnrType, params, immediate );
    //In my bean
    public void serverMethod(ClientEvent clientEvent) {
    System.out.println("serverMethod() is called");
    </pre>
    Please, give any ideas how to resolve it.
    Best Regards,
    JavaDeVeLoper

    Hi Frank,
    I've tried what's suggested. I've placed the trh:script at the bottom of the page.
    The server listener in this piece of code at the bottom is fired, but in my case the problem (to fire a server event on body load) still exists.
    <pre>
    <af:commandButton text="Button" partialSubmit="true" clientComponent="true">
    <af:clientListener method="fireServerListener" type="action" />
    <af:clientAttribute name="serverListenerType" value="serverMethod" />
    <af:serverListener type="serverMethod"
    method="#{myBean.serverMethod}"/>
    </af:commandButton>
    </pre>
    Any suggestions :)
    Best Regards,
    JavaDeVeLoper

  • Issue with displaying summary in the Page Bottom

    Hi Friends,
    I have an issue with displaying summary in the page bottom. for this i am using command BOTTOM and ENDBOTTOM in Main Window.
    I designed 2 pages are First and Next, in the first it displays PO Header details and Item details in the Main window and also Item details continuious in the Next Page also.
    If the lines are enough in Bottom then it displays the summary. But if the lines are not enough in bottom then it does not trigger the new page, so that it doesn't displays the Summary in Bottom.
    for ex: Total lines of the page 50 and Bottom required 15 lines. In the next page contains upto 35 lines, it triggers the Bottom.
    But if the lines are more than 35 and below than 50, it does not trigger the new page so that it does not shows the bottom.
    Please help me on the same, this is very urgent.I will give a rewatrd if it is helful.
    Regards,
    Subbarao

    HI,
    Try with printing the bottom data with Protect and ENDPROTECT along with your Bottom and endbottom.
    Eg: Protect
    bottom
    text
    endbottom
    endprotect.
    Regards,
    Venkatesh

  • Issue with Proximity Sensor during calls - Continued v2

    This thread is a continuation of Issue with Proximity Sensor during calls - Continued. which was getting too long and causing some browsers to time out. That thread has been locked and the last post links to this thread.
    See also the initial thread Issue with Proximity Sensor during calls
    Thank you.
    Apple Discussions Hosts

    rbrylawski wrote:
    Goflying wrote:
    mbassoc2003 wrote:
    I wish that were so. Then they would probably be taking prompter action. But the return rate three weeks in was substantially lower than most handsets at launch and only a quarter that of the 3GS. I suspect the return rate has remained incredibly low and the figures are further slewed down the way by the worldwide distribution that is now in the tens of millions.
    At 5% return rate on a product I understand that becomes a 'significant event' that becomes declarable to shareholders, so we know they haven't reached that milestone yet.
    a disclosable event is not triggered by a specific stock return level unless apple has entered into covenants re same. Suggest you take a look at sec rules for more info
    Still, unless you have insider knowledge, you don't know Apple's buying them back at record numbers. You may be guessing, but you likely don't have proof....
    agree. I don't have any proof whatsoever, just a strong gut feeling that all is very much not as rosy in cupertino as it might seem.
    For a company whose culture is steeped in phreakery, apple is showing an amazing inability to exert control.
    too many screw ups, too many loose ends, too many whacky hires, too many media backlashes - maybe the senior staff went into dumb-mode while steve was away for so long
    null

  • Issue with Proximity Sensor during calls - Continued.

    This thread is a continuation of Issue with Proximity Sensor during calls which was getting too long and causing some browsers to time out. The old thread has been locked and the last post links to this thread.
    Thank you.
    Apple Discussions Hosts

    I find it completely ludicrous that Apple can interject on this thread and say it's received too many posts and has to be shut down and a "new" thread started. Really now? Seriously? Couldn't they also simply pop in and post 'hi guys, we hear you and are working on it' ...or something to that effect? That's my main complaint really is the deafening silence. What they're basically telling us is to complain all we want, if we don't like the phone then return it for a refund ...that is if you still have your original defective phone, for all you that already swapped phones, you're beat and are stuck with our mistake for the next 2 years when you'll be upgrade eligible again. ...WOW, thanks for the statement without technically releasing one. ...I think we're all left in the dark because Apple really doesn't know what is going on with the sensor, they can't and or won't release a statement without getting the facts straight. ...but we all know one fact is straight...the sensor is dysfunctional and that alone deserves an acknowledgement. How are we to have faith in Apple to fix the issue when we're left to believe they don't think there is one.
    ...btw update on "my fix" ...deleting all your photos and putting the phone in your arm pit and then under your pillow is only a temporary solution, for mine sensor is on the fritz again. ...shaking my head, if only this were
    funny.

  • Execute Javascript after *.jspx page rendered

    I have a page with controls and a subform with a servlet, rendering a jasper report:
                   <af:panelFormLayout id="pfl1" partialTriggers="cbReportHTML">
                    <af:subform id="sfRep">
                      <jsp:include page="/jasperservlet" flush="true"/>
                    </af:subform>
                  </af:panelFormLayout>
    I want the page to be rendered before the subform (so that user can see controls on page before the report).
    "/jasperservlet" generates the report in about half a minute.
    I want to have a JavaScript that runs after the page is rendered (and the user sees the controls) and then it starts to generate report.
    I tried to put a frame with such javascript, but the javascript is executed before user can see controls.
    How can it be done?

    Thank you for your answers.
    Yes, I'm trying to execute javascript code on the child page, the modal one.
    Basically, there's a button on my parent page which opens the modal page. The modal page has buttons Cancel, Delete and Save. Clicking Save button submits the changes and if there are errors, errors are shown and we stay on the modal page.
    My modal pages are all of fixed dimensions and if there are errors, I have to adjust the other regions (adjust their height, add a scrollbar, etc) in order to show everything in the modal page.
    I have written a function that does exactly that, but I have to execute the function after the page is loaded and the regions are shown. But, if I execute it using onload attribute, or setting a dynamic action which fires on page load, the function gets executed during the submit, before the regions are shown.
    I hope I have managed to clear up the problem.
    As always, thank you.

  • Weird Timing Issue with Custom Javascript Files

    I have attached a static javascript file to my application using the Shared Components...Static Files facility in APEX. This is working. I can call methods in my JavaScript file and they work as expected.
    The issue is that if I ever want to have JavaScript run when the page is loaded, it is as if the javascript is not in place yet when the method is called. For example, I want to set some some style characteristics of a few common fields that occur on more than one page, if I add a button to the page that I click to call the method (and don't select "Fire on Page Load"), this works fine. However, if I do select "Fire on Page Load", the javascript is invalid.
    I have tried After Refresh of the region which seems like it would work but, this event fires before* the javascript is available.
    How can I load the page, including the javascript reference, and then call the javascript method?
    -Joe
    Edited by: Joe Upshaw on Apr 3, 2012 12:49 PM

    WR,
    I think the latter, adding it to the template, sounds like the better solution. (I am using Application Express 4.1.1.00.23 BTW).
    Now for the newbie questions...
    I am trying to figure out exactly where to make this change. So, I had a couple of questions.
    1. I went into Shared Components>Templates. Then, I scrolled down to the section labelled Page. I see that the default checkmark is beside "No Tabs - Right Sidebar" so, I click this and I do indeed find a <HEAD> section defined. Is this where I need to add the reference to the javascript file?
    2. I assume I need to upload the static file to the server. Right now, I have uploaded it via the Shared Components>Static Files selection. When I add it now, I am doing this:
    var headElement = document.getElementsByTagName("head")[0];
    var currentCommonRiskPos = currentHeadHTML.indexOf( 'commonRisk.js', 0 );
    if ( currentCommonRiskPos == -1 )
       var jsRiskCommon = document.createElement( 'script' );
       jsRiskCommon.id = 'commonRisk.js';
       jsRiskCommon.setAttribute( "type","text/javascript" );
       jsRiskCommon.setAttribute("src", "#APP_IMAGES#commonRisk.js" );
       headElement.appendChild(jsRiskCommon);
    }See how I used "#APP_IMAGES#"? I am assuming that this would not work from the page template, correct? For example, in the template currently, I see:
    <script src="#IMAGE_PREFIX#themes/theme_24/js/4_1.js"></script>I am assuimng that I should upload my JS file somewhere in the images folder and reference it in the same way, right? For example:
    <script src="#IMAGE_PREFIX#JoesStuff/js/HellowWorld.js"></script>Does all of this sound correct?
    Thanks,
    -Joe

  • Execute search programatically during initial page load.

    hi,
    when the page is initially rendered, i have requirement to have the page automatically retrieve rows that belong to the user (ie execute a search programatically)
    to achieve that i did the following -
    1. created search page using autocustomizationcriteria
    2. mapped all search fields to corresponding VO fields ( i intend to not override the default where clause since all my search can directly be mapped to a VO attribute)
    3.populated the userlogin value into the corresponding search field as follows -
    String lg = pageContext.getUserName();
    OAMessageLovInputBean lovBean = (OAMessageLovInputBean)webBean.findChildRecursive("searchLogin"); //the searchfield is a messageLOVInput
    lovBean.setValue(pageContext, lg);
    the behavior i was expecting is for the page to automatically generate the where clause since i populated the search field that is mapped to the VO attribute and execute the query (i did not invoke executequery() per dev guide) BUT instead it is executing a BLIND query with no where clause.
    would appreciate any insight into what i am doing wrong....
    thank you.

    hi, i had initially done the setting of the whereclause and executing programatically. however, when you do that, subsequently, the 'Go' button also needs to be handled programatically (including all search criteria whereclause generation) and then you loose all the features of the queryBean especially the different search options (eg like , starts with etc) on the Advanced Panel unless you code for all those features yourself...... NOTE - the need to handle the 'Go' button yourself happens even though after executeQuery() for just the initial page load, i reset the whereclause and whereclauseparams to NULL....
    i also do not have a formvalue associated with the searchlogin field.
    any other inputs please ?
    thank you.
    Edited by: user8249972 on Jan 28, 2013 10:22 AM

  • Auto adjustment of page orientation causes printing issues with documents that have a page width greater than its page height.

    Hi,
    Since an upgrade from Word 2003 to Word 2010, we are experiencing printing issues with certain
    documents that have a page width greater than its page height.
    In Word 2003, it was no problem to set the page width greater than the page height while setting the page orientation to "portrait".
    In Word 2010, this seems impossible: despite leaving the page orientation to "portrait", if one changes the page width/height as stated,
    Word 2010 automatically adjusts the orientation to "landscape". Resetting the orientation to "portrait" will flip the page's width/heigth settings.
    This behaviour causes printing problems: the page prints out 90° rotated.
    I do not believe this is a printer driver issue: I tried several different printer drivers, and all give the same (bad) result. Setting the printer driver's page orientation settings (before printing) makes no difference, as
    Word 2010 seems to force the page orientation settings.
    Inserting the documents 90° rotated is not an option, since it causes problems with the printing margins.
    This is very annoying, since we have to print official documents of a municipality (driver's licences).
    Is there a workaround for this issue?
    Regards,
    Laurent Grandgaignage
    Sysadmin Gemeentebestuur Stabroek, Belgium

    Hi
    Thank you for using
    Microsoft Office for IT Professionals Forums.
    From your description, we can follow these steps to test this issue
    Step 1: Repair Office 2010
    1.      
    Click
    Start, and then click Control Panel.
    2.      
    Click
    Programs and Features.
    3.      
    Click the
    Office 2010 program that you want to repair, and then click
    Change.
    4.      
    Click
    Repair, and then click Continue. You might need to restart your computer after the repair is complete.
    Step 2:
    Rename the global template (Normal.dotm)Follow the steps for the operating system that you are using:
    Windows Vista and Windows 7
    a)      
    Exit Word 2010
    b)      
    Click
    Start.
    c)       
    In the
    Start Search box, type the following text, and then press
    ENTER:
    1.      
    %userprofile%\appdata\roaming\microsoft\templates
    d)      
    Right-click
    Normal.dotm, and then click Rename.
    e)      
    Type
    Oldword.old, and then press ENTER.
    Microsoft Windows XP
    a)      
    Exit Word 2010
    b)      
    Click
    Start, and then click Run.
    c)       
    In the
    Open box, type the following text, and then press ENTER:
    %userprofile%\Application Data\Microsoft\Templates
    d)      
    Right-click
    Normal.dotm, and then click Rename.
    e)      
    Type
    Oldword.old, and then press ENTER.
    f)       
    Close Windows Explorer.
    How to troubleshoot print failures in Word 2010, Word 2007, and Word 2003
    http://support.microsoft.com/kb/826845
    Please take your time to try the suggestions and let me know the results at your earliest convenience. If anything is unclear or if there is anything
    I can do for you, please feel free to let me know.
    Hope that helps.
    Sincerely
    William Zhou CHNPlease remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Issue with Session ID during POST

    Hi All,
    I am using Weblogic server version weblogic 9.2 and facing an issue with the session ID.
    I have a client side script with numerous GET calls and one POST call that it makes in a single session. Frequently I come across with issue that the session ID that I send in POST request is not the same as received and this affects my subsequent GET calls not to be in the same session. The call order is like this
    GETij/POSTij where i is the sent and j is the recieved session IDs.
    [GET11, GET11, GET11, POST12, GET11, GET11, <after few secs interval> GET22, GET22]
    I store the session id in a cookie. And I always create a session using the HttpServletRequest.getSession();
    Can some one advice on this.
    Thanks
    Shankar

    Hi,
    Again as a follow-up, I am using net scape ns plugin for load balancing (iPlanet/Weblogic). The issue happens when the primary server id and the secondary server id are same in the session id (set in the cookie) when the cookie is sent and received, where session id is of the default format <session id>!<primary server id>!<secondary server id>
    Any clue?

  • I am having issues with a site for work. it loads all the links on the left side of the screen. is there a way to fix this or get an older version of fire fox?

    Its my office intraweb and I was told its not compatible with this upgrade

    You can try basic steps like these in case of issues with web pages:
    Reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and the cookies from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • SUM issue with XSS components during maintenance on NDWI controlled landscape

    Hello,
    This is our first time using SUM/MOpz for a release upgrade procedure as the last JSPM update disabled the launch program.
    During our test upgrade of our Enterprise Portal HUB landscape (source NW 7.02 -> target NW 7.4) with EHP5 for ERP 6.0 - XSS Self Services for backend ERP system installed. I've encountered an issue with SUM in the Configuration stage - Target Release Components screen. the only 5 objects SUM cannot handle automatically are the XSS Self Services target release components:
    SAPPCUI_GP         633
    SAP_ESS               633
    SAP_ESS_LGP     633
    SAP_MSS               630
    UTXSSLGP             633
    The only option I have is to scan inbox to rebuild the component list. I'm assuming, since these components are being modified by us and delivered/deployed thru NWDI track, their source location on the system is now the track name instead of the SAP delivered MAIN_ERP53VAL_C. Which means that SUM is expecting updated modified SCAs from NWDI for new 633 versions in the download directory before proceeding to next phase. However, in NWDI landscape configurator for this track, I have checked the option to mark system in NWDI control and verified SUM recognizes the system as NWDI controlled.
    I'm struggling to understand the where the disconnect is between SUM and NWDI for theses components as I thought that SUM is supposed to ignore the DEV NWDI developed and wait for updates modified SCAs only in QA and PROD. Does anyone else have experience with this process to help me?
    Regards,
    Paul

    Hi Paul,
    We are facing the same issue although we can see in the process Overview of SUM that the system is not ticked as under NWDI Control.
    But we are facing problem only for SAP ESS and SAP MSS not other components. Other three components are coming up fine and ready for deployment. This is due to the issue that only these components are identified in the BUILD COMPONENT LIST UPGRADE step as modified.
    Detailed checking of the logs led us to errors identical to the KBA 2034886 - Error: Dialog eliminator ConfirmComponentsDialogEliminator does not allow to omit dialog ConfirmComponents
    The system should get picked as under NWDI control and following all steps of the upgrade for NWDI driven system landscapes
    Thanks and Regards,
    Karan Shah
    Message was edited by: Karan Shah

  • Internet speed issues.  Fast Downloads, Really Slow Page Loads.

    Hi,
    I have DSL and I get really big delays when I try to open a page, but I get really fast Downloads. What could cause this. I did notice an error in my console that says;
    mDNSResponder: Repeated transitions for interface en1 (192.168.1.101); delaying packets by 5 seconds
    Could this have something to do with it? by the way, my PC on the same network does not do this. It has to be an issue with my powerbook.
    Any suggestions?
    adrian heredia

    Hi,
    I have DSL and I get really big delays when I try to
    open a page, but I get really fast Downloads. What
    could cause this.
    Bad DNS servers. Go to your network configuration and manually enter the DNS server address supplied by your ISP.
    I did notice an error in my
    console that says;
    mDNSResponder: Repeated transitions for interface en1
    (192.168.1.101); delaying packets by 5 seconds
    Could this have something to do with it?
    Probably not. That's a bonjour issue.

  • Firefox works with dial-up but get "page load"error with FIOS

    Firefox works well with a local dial-up, but I keep getting "page load"error message when I try to use FIOS. The connections look good,and Firefox is enabled with the Windows security firewall.
    I did have some connections unplugged when I was moving the computer and router around.
    I have run out of ideas to fix it.
    == Operating system ==
    Windows XP home addition

    Note that the xpcom.dll file is no longer present in current Firefox versions, so you may have an extension or other software that needs to be updated for the current release.
    *Bug 852950 - Kill xpcom.dll/libxpcom.so/xpcom.dylib
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for

  • Error during installing oracle client on windows XP

    Hi everybody, I want to install Oracle Client on Windows XP. I downloaded and installed Client version 10g on several PCs. But one of them gives me error - 'oui.exe - error'. Cant start oui.exe. Is it problem of Windows XP or ? I just cant start GUI

  • How do I convert wmv to mov files for fcp?

    I have tried a couple of different conversion programs to convert a wmv file to mov or mp4, and all seem to result in a viewable mp4, but when I import into final cut and try to put the footage into my sequence, it won't render. The sound renders, bu

  • Is it possibile to retrieve .nav from pdf portfolio?

    Hi all! There is any way to retrieve the .nav file from pdf portfolio? Is it possible? Thanks

  • Photo's stuck on my iPad

    I have approx 1700 photo's stuck in my photo steam on my iPad. I've tried everything, even reseting the device. All photo's came back when I set my iPad back up. They are eating memory up. I've tried everything to delete them. Half of the photo's are

  • Iphoto crashes when trying to open

    I had a update on my iphoto and now it is crashing saying it cant launch. Saying.... "your iphoto library will not be readable by previous versions of iphoto after upgrade. The upgrade process may take several minutes depending on the number of photo