AdfActionEvent and AdfPage.PAGE.findComponent not working - Sample Provided

Ladies and Gents,
Using JDev 11.1.2.3.0.
I just can't get this simple example to work.  On page load, I'm calling ADF's find component by id method, which for some reason, returns null.  I can do the same thing by using javascript's getElementById and that finds the component just fine.  However, if I use the getElementById and then push that into the AdfActionQueue, I get a different error 'Error: Object doesn't support property or method 'queueEvent''
Can anyone see off-hand what I'm doing wrong here?
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
        <af:document title="home.jspx" id="d1">
            <af:form id="f1">
                <af:commandButton text="commandButton 1" id="myRefreshButton" action="#{myBean.onAction}"/>
            </af:form>
            <af:resource type="javascript" source="/resources/js/jqPlot/jquery.min.js"/>
            <af:resource type="javascript" source="/resources/js/jqPlot/jquery.jqplot.min.js"/>
            <af:resource type="javascript" source="/resources/js/jqPlot/plugins/jqplot.canvasTextRenderer.min.js"/>
            <af:resource type="javascript" source="/resources/js/jqPlot/plugins/jqplot.canvasAxisLabelRenderer.min.js"/>
            <af:resource type="javascript" source="/resources/js/jqPlot/plugins/jqplot.dragable.min.js"/>
            <af:resource type="css" source="/resources/js/jqPlot/jquery.jqplot.min.css"/>
            <af:resource type="javascript">
              function doClick() {
                  var clientId = 'myRefreshButton'; // id of the button in the page's HTML code
                  // This returns null
                  // var button = AdfPage.PAGE.findComponent(clientId);
                  // button is found but then receive error
                  var button = document.getElementById(clientId);
                  AdfActionEvent.queue(button, true);
              $(document).ready(function () {
                  doClick();
            </af:resource>
        </af:document>
    </f:view>
</jsp:root>

Hi Frank,
I agree manipulating the DOM directly is generally bad (I've watched those training videos!), but after doing some decent searching (with quite a bit of trial and error) I'm not sure there exists a purely ADF way of achieving a solution.
Inside of a region, I have a master (Companies) and a child (Orders) table relationship.  Within the same region, I also have a charting tool which displays the monthly order totals of the selected company.  A customer can select a company and see the related monthly orders in the orders table along with a graph showing the visual sales.  If I were using ADF DVTs, this would be pretty straightforward, but I am not.  To get this to work then, I have a few obstacles.
1) On jsff load, the chart must initialize with the displayed monthly order data.
2) On new customer select, the chart must refresh with the newly displayed order data.
The easiest way to update the chart would be to hook into the orders table component and, whenever the shown data refreshes or initializes, also refresh the chart.  However, I'm not sure where the hook is located for that so I'm back to my two obstacles.
For the first obstacle, ADF does not (to my knowledge) have an "on jsff load" option so I'm stuck with jquery's load and corresponding id lookup functions.  In my case, that load function looks for a hidden output text component's value whose getter returns the order table row's current monthly data.  This is somewhat of a hack that, in effect, calls a managed bean method from javascript.  Now that I have that data, I can input that into my chart and refresh.
For the second obstacle, I simply hook into the customer table's selection listener and after the current row is updated, retrieve the order table's current monthly data, refresh chart, etc.
The question I asked is a simplified version of overcoming the two obstacles above and while my jquery $('#myRefreshButton')[0] is extremely brittle, it was only meant as a quick demonstration.  One could make it less brittle by iterating through the returned array, making sure the desired element contained any regions / naming containers and had the myRefreshButton portion at the end of the id string.
What would be the desired ADF way of achieving this result?  Do you do something with your Data Visualization Tools that might be applicable here?  Is there a way to hook into the child table and refresh my chart any time child table refreshes or initializes?

Similar Messages

  • Keep getting error message saying ipod detected but could not be identified properly - I have tried all the steps on the support page twice and it still will not work!  I am running windows 8 (which it has worked with ok before) - struggling :(

    keep getting error message saying ipod detected but could not be identified properly - I have tried all the steps on the support page twice and it still will not work!  I am running windows 8 (which it has worked with ok before) - struggling
    I recently bought some new albums and can't play them on my ipod

    I just encountered the same problem on my 2 month old MBPro.  I found a work around by changing USB ports.  As for the actual cause or the reason why that worked, I dont know.  The USB port I was using works fine with my phone or other USB devices.

  • After upgrade to 4.0, the controls on mymsn page do not work and several of my content items are not displayed.

    The stock quotes, fox sports and movie times content fields do not display and the controls do not work on any of content boxes. The customize and add content tabs do nothing. This all worked with 3.6 but not with 4.0.

    A column in the search results was changed to a Simple Checkbox when we upgraded to 4.0 (it has always been a checkbox in the older APEX versions). When I put it back to Standard Report Column I no longer get the page not found error.
    Is there some additional/different setting I need to do in order to use the simple checkbox option in a search results set?
    ETA: I see now that Checkboxes are not intended to work in standard report regions so I'll change them to LOVs or something and my problem should be solved.
    Edited by: mimi_jones on Jul 18, 2011 6:16 AM

  • HT1338 For the past 2 weeks I have not been able to open any small video on the yahoo page or face book. I get  Blocked Plug In. I have installed Adobe and that still does not work. Help.

    For the past 2 weeks I have not been able to open any small video on facebook or on the yahoo page . I have installed Adobe and it still dies not work. Help.

    Use "Firefox/File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit") to close Firefox if you are currently doing that by clicking the close X on the title bar.
    See "Hang at exit":
    *http://kb.mozillazine.org/Firefox_hangs
    See "Firefox hangs when you quit it":
    *https://support.mozilla.org/kb/Firefox+hangs

  • Recent iOS update has made my iPad 2 unusable. The screen locks up. It's very laggy and web pages do not load correctly.  Is there a fix for this or are they even working on a fix.

    Recent iOS update has made my iPad 2 unusable. The screen locks up. It's very laggy and web pages do not load correctly.  Is there a fix for this or are they even working on a fix.

    Try some basic troubleshooting:
    (A) Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    (B) Try reset all settings
    Settings>General>Reset>Reset All Settings
    (C) Setup as new (data will be lost if you do not have backup)
    Settings>General>Reset>Erase all content and settings

  • At the top of my Mozilla home page, it lists the current URL site I am on. How do I delete them and the others in the drop down box? Highlighting and hitting delete does not work

    At the top of my Mozilla home page, it lists the current URL site, such as http://www.safeco.com, I am on plus the others in the drop down box. How do I delete them. Highlighting and hitting delete does not work.
    I am using windows Vista 007 and Mozila 3.6.1.3

    Do those entries have a yellow star at the far right?
    If they have then they are bookmarks. You can remove them if you open that link and click the star to open the Edit This Bookmark dialog and click the Remove button in that dialog.
    * [[Clearing Location bar history]]
    * [[Cannot clear Location bar history]]

  • Since last update of Pages, my Pages app in iPad anda iPhone doesn't open, it closes suddenly. I already deleted it and reinstalled, but still not works.

    Since last update of Pages, my Pages app in iPad anda iPhone doesn't open, it closes suddenly. I already deleted it and reinstalled, but still not works.
    Can someone help? Do I need to wait for another update?
    Thanks

    This is my problem that has to originate from the update.  So glad that I did not purchase a MacBook!  Apple products/apps are appearing to be not different from Windows products.
    I have deleted and reinstalled from the device and desktop, resets, etc.  When I uninstalled and reinstalled while connected to my desktop, the older version of pages was installed.  I was able to see all of my files that were saved to the cloud.  I was forced to update again to access any of the saved files.  Once updated again, I could no longer open pages.  It began, to open and abruptly shut down.

  • I have worked many hours on an iphoto book and I am up to page 29.  I cannot add any more pages and I need to!  Please help!!  "Add page" is not working!!!

    I have worked many hours on an iphoto book and I am up to page 29.  I cannot add any more pages past that and I need to!  Please help!!  "Add page" is not working!!!

    Fixed it thanks to similar questions and answers to them.  Thanks all!

  • MySite – My Content Page is not working and giving error for existing customers

    We are using SharePoint 2010 and recently moved to SharePoint 2013. Central Admin run under SP 2013 and Content Db Front End run under SP 2010.
    After migration the MySite – My Content Page is not working and giving error for existing customers (http://mysite.ss.com/_layouts/MySite.aspx?Error=4705).
    New users (after migration) are able access the My Content and adding documents but old users can’t.
    Can anyone help me on the above?

    I think you might be using non claims web app in 2010, if that is the case, you 'd need to convert your existing users to claims users for which you can refer to http://technet.microsoft.com/en-us/library/gg251985(v=office.15).aspx
    to check if your exisiting users are claims or classic users , try 
    get-spuser -web http://mysite.ss.com -limit all
    check in the output if you see the claims GUID in form of user names like i:0#.w|domain\username, if yes, they claims users if you just see Domain\username, you want those users to be converted to calims.
    i'd need more details to be specific about my answer but aforementioned scenario is most common of all, hope this helps, 
    Thanks, Noddy

  • Why do the "SHOW THE PREVIOUS PAGE arrows not work on some websites such as when I try to return to the previous page the arrows at the top right of the page are not dark black they are light grey and do nothing---HELPPPP

    why do the "SHOW THE PREVIOUS PAGE arrows not work on some websites such when I try yto return to a previous page the arrows at the top right of the page do not work instead they are light grey instead black and do nothing---this is frustrating to not be able to return to the page before--HELP

    If a page you go to opens in a new tab, there is no 'back' to go to. If that is the case, just close the tab and you'll be at the page you came from.

  • When I start it up it shows two two nested windows on the screen, has a Firefox yellow tab in the corner, does not display the toolbar bookmarks, the back and forth buttons do not work and there is no page refresh. No clue what is going on.

    Every time I open up Firefox it appears to open two nested and linked windows, each with their own minimize, maximize and close buttons but the both work the same. The homepage does not come up, the back and forth buttons do not work. Both the refresh button and F5 do not work. The Bookmark Toolbar does not show up until I disable it in View and then re-enable it and this causes the outer nested window to disappear or close.

    This issue can be caused by an extension or theme that isn't working properly.
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • AdfPage.PAGE.findComponent FAILED with WebCenter

    Dear all,
    I have to get in javascript a component with id="pdfBtn"
    BUT I have to set the parameter r1:0:pdfBtn => AdfPage.PAGE.findComponent('r1:0:pdfBtn')
    It works when I develop a task flow and manage by myself, but it failed when I add this into WebCenter the ID change.
    Any Idea?
    Thanks

    Have you tried
    AdfPage.PAGE.findComponentByAbsoluteId('pdfBtn')Timo

  • AdfPage.PAGE.findComponent method usage

    I have a function.js file which has the showMap() function. I am trying to display something using the AdfPage.PAGE.findComponent method which keeps returning undefined for any component I try to find from the js file. What am I doing wrong? Is it because I am finding the component before page loading. Please advise
    function.js file
    function showMap() {
    alert(AdfPage.PAGE.findComponent('f1'));
    baseURL = "http://"+document.location.host+"/mapviewer";
    var mapCenterLon = 145.07;
    var mapCenterLat = -37.57;
    var mapZoom = 1;
    mapview = new MVMapView(AdfPage.PAGE.findComponent('map'), baseURL);
    //var map = AdfPage.PAGE.findComponent("map");
    //mapview = map.getMVMapView();
    mapview.addMapTileLayer(new MVMapTileLayer("gis_data.AV_VICMAP"));
    mapview.setCenter(MVSdoGeometry.createPoint(mapCenterLon,mapCenterLat,4283));
    mapview.setZoomLevel(mapZoom);
    mapview.addNavigationPanel("WEST");
    showOverviewMap();
    addThemeBasedFOI();
    mapview.display();
    JSPX file
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:trh="http://myfaces.apache.org/trinidad/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:dvt="http://xmlns.oracle.com/dss/adf/faces">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" binding="#{backingBeanScope.mapsBean.d1}">
    <f:facet name="metaContainer">
    <af:group id="g3" binding="#{backingBeanScope.mapsBean.g3}">
    <trh:script id="script1" source="/jslib/oraclemaps.js"
    binding="#{backingBeanScope.mapsBean.script1}"/>
    <trh:script id="script2" source="/jslib/functions.js"
    binding="#{backingBeanScope.mapsBean.script2}"/>
    <trh:script text='' id="script3"
    binding="#{backingBeanScope.mapsBean.script3}"/>
    </af:group>
    </f:facet>
    <af:form id="f1" binding="#{backingBeanScope.mapsBean.f1}">
    <af:panelStretchLayout id="psl1" topHeight="5px" bottomHeight="115px"
    endWidth="373px"
    binding="#{backingBeanScope.mapsBean.psl1}">
    <f:facet name="bottom">
    <af:panelBox text="Watch Options" id="pb1"
    binding="#{backingBeanScope.mapsBean.pb1}">
    <f:facet name="toolbar"/>
    <af:selectBooleanCheckbox label="Auto Refresh"
    id="sbc2"
    binding="#{backingBeanScope.mapsBean.sbc2}"/>
    <af:selectBooleanCheckbox label="Show Vehicle Locations"
    id="sbc1"
    binding="#{backingBeanScope.mapsBean.sbc1}"/>
    <af:commandButton text="Refresh Now"
    id="cb1"
    partialSubmit="true"
    binding="#{backingBeanScope.mapsBean.cb1}"/>
    </af:panelBox>
    </f:facet>
    <f:facet name="center">
    <af:panelGroupLayout layout="scroll"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    id="pgl1"
    binding="#{backingBeanScope.mapsBean.pgl1}">
    <af:group id="g1" binding="#{backingBeanScope.mapsBean.g1}">
    <dvt:mapToolbar mapId="map"
    id="mt1"
    binding="#{backingBeanScope.mapsBean.mt1}"/>
    <dvt:map startingY="-36.88" startingX="145.26" mapZoom="1"
    mapServerConfigId="mapConfig1"
    baseMapName="GIS_DATA.AV_VICMAP"
    inlineStyle="width:100%; height:793px;"
    id="map" binding="#{backingBeanScope.mapsBean.map}">
    <f:facet name="rtPopup"/>
    <f:facet name="popup"/>
    </dvt:map>
    </af:group>
    </af:panelGroupLayout>
    </f:facet>
    <f:facet name="end">
    <af:panelBox text="List Vechicles"
    id="pb2" binding="#{backingBeanScope.mapsBean.pb2}">
    <f:facet name="toolbar"/>
    <af:inputText label="Area Code"
    id="it1"
    binding="#{backingBeanScope.mapsBean.it1}"/>
    <af:inputText label="Vehicle Number"
    id="it2"
    binding="#{backingBeanScope.mapsBean.it2}"/>
    <af:commandButton text="Search"
    id="cb2"
    binding="#{backingBeanScope.mapsBean.cb2}"/>
    </af:panelBox>
    </f:facet>
    </af:panelStretchLayout>
    </af:form>
    <af:clientListener type="load" method="showMap()" />
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:mapsBean-->
    </jsp:root>
    Edited by: user5108636 on 29/04/2010 18:22

    It is now detecting the map component, but the map object retrieved in the javascript seems to a new object. I had set the srid and ceterX and centerY.
    In my javascript, I do
    var map = AdfPage.PAGE.findComponent('map');
    mapview = map.getMVMapView();
    alert("Zoom:"+ mapview.getZoomLevel());
    alert("Srid:"+ mapview.getSrid());
    alert("CenterX:"+ mapview.getPointX());
    alert("CenterY:"+ mapview.getPointY());
    where the map object parameters are already set in the ADF page, which is not reflecting. I am not getting access to the same map
    object. My javascript method runs on page load. Is it because the javascript method is getting called before the ADF map object exists.
    dvt:map id="map" startingX="145.26"
    mapServerConfigId="mapConfig1"
    baseMapName="GIS_DATA.MAP" mapZoom="1"
    startingY="-36.88" unit="METERS"
    inlineStyle="width:100%; height:793px;" srid="4283"
    />
    Let me know if any more code needs to be posted for clarification.
    Regards
    Edited by: user5108636 on 9/05/2010 19:20

  • With version 5 of Firefox, if I open more than 1 session, most of the time I cannot see anything in the navigation bar and my back and forward buttons do not work.

    I open 1 session of Firefox 5.0.1 and everything seems to work fine. Then I open a second session of Firefox and most of the time the navigation bar does not show the page that I am on and the back and forward buttons do not work. When this happens, the first session always remains working. I am an internet marketer so I have at least 2 or 3 sessions going at any given time.

    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • I am trying to open a service request and the site does not work.

    I am trying to open a service request and the site does not work with ANY browser. I get the page https://getsupport.apple.com/GetParts.action which says "Send in for service. We just need a little more information." The continue button does not work. I've seen this problem before trying to file support requests. It's as if Apple simply does not want you to create requests.

    I just went through several screens and had no problems.  Try clearing your browser's cache and/or history.

Maybe you are looking for

  • Can't install Hyper-V on Windows 8.1 Pro

    I have a Dell XPS L702x laptop with 2 hard drives, one of them has a MBR partition and has Hyper-V running without problems, but in the second drive, which is a SSD disk and has a GPT partition, I can't install it. It seems to install, gets to about

  • Servicelayer.exe crashes when backing up

    Hi there guys, I am currently having a problem with PC Suite where the servicelayer.exe crashes when doing a phone backup. OS: Windows Vista PC Suite: 6.82.22.0 Phone: N80 Whenever I try to do a phone backup it gets to 50% the servicelayer.exe crashe

  • Is there a security fix for Java 6 Update 34 for OS X 10.5.8?

    Firefox is warning me my Java plug in is still a security risk, despite having the latest update for my system. Apple do not seem to have fixed Java 6 Update 34 for 10.5.8 users, only Java 6 Update 35, which is only for OS X 10.7 and higher. Any help

  • Sony A7 RAW images don't convert

    Why don't my new Sony A7 RAW images open automatically in bridge after installing the new dng converter 8.3 in PS CC?

  • CS6 web premium vs. CC access for After Effects - conflicts?

    Hi all, Apologies if there was any response to a similar question. If so, I've certainly struggled to find it. I currently have CS6 web premium installed (student edition), but I require access to After Effects for a single assignment. Obviously ther