Move links to javascript value when the page is loaded

Hello

I use JDeveloper 11.1.2.4.0.

When loading my jsf page, I want to pass the value of the lat, long columns of links the attribute so that the map google map is rendered correct loading of the page.

I can do when a button is clicked.  But I want to do it when the page is loaded.

Any ideas?

Thanks in advance.

Here is the code snippet, which includes the javascript function: instead of coding hard - 34.397 and 150.644, I would like to happen next as parameters or

access it some how from the pagedef attribute binding.

< f: facet name = "metaContainer" >
" < af:resource type = 'javascript' source = ' https://maps.googleapis.com/maps/API/js?v=3.exp & Sensor = false "/>
< af:resource type = "javascript" >
var map;

initialize() function
{
var mapOptions =
{
Zoom: 8, Center: new google.maps.LatLng (-34.397, 150.644)
};
card = new google.maps.Map (document.getElementById('map-canvas'), mapOptions);
}

google.maps.event.addDomListener (window, "load", initialize);
< / af:resource >
< / f: facet >

Hello

set a listener of phase for the view (using the beforeMethod on the f: view of the page markup). In the method, then use the ExtendedRenderKit Service to call JavaScript from Java. The method must listen for the phase PREPARE_RENDER, who is the liaison for the page to exist. You can access the link from BindingContext.getCurrent () .getCurrentBindings () layer. From there, you call (AttributeBinding) bindings.get ("the binding of the attribute name") to get the attribute mandatory and then - in a next step - the inputValue with data to transmit

Call JavaScript from Java:

String script = «...» Add JS calls to set values in JS variables accessed by Google Maps"

ExtendedRenderKitService erks = Service.getRenderKitService (context, ExtendedRenderKitService.class);

erks.addScript (context, script);

Frank

Tags: Java

Similar Questions

  • Need to call the javascript function when the page is loaded

    Hello - I have a javascript function defined on Page 0 of my application. It is in the source of an unconditional
    region whose view point is after the header.

    I call successfully the function of event onchange on individual page elements. (The function
    sets the value of an element based on the value of another).

    But I also need to call the function when the page is loaded. The page is a form of data modification,
    so many values is filled when it is loaded, and I need the dependent values populated
    also.

    I tried to add the call to function in the following way. It is not at all get called (alerts are not forthcoming)
    and there is no error in the Firefox error console...
    - as an event onload in individual items
    -call directly to the edit HTML page header
    -call directly from the HTML body of the edit page (which, from what I've read, sounds
    as to execute onload and my page template doesn't have a defined substitution onload string).

    In these 2 cases, I simply call it like: jsLookupValue ($v ("P8_OBJECTTYPE_ID"), "objecttype_id", "P8_OBJECTTYPE_NAME", "objecttype_name", "hdb_objecttype");

    How can I do this?

    Thank you
    Carol

    If you define the function on the zero page and any page you should be able to call using something like:

    
    

    Have you tried to put just a statement alert() on the page in order to check that it runs just about anything?

  • [ADF, JDev12.1.3] Call ExecuteWithParams operations programmatically when the page is loaded. How...?

    Hallo,

    in a working group, I have a 'readonly' page that uses in many istances VO (for fields, tables,...).

    When the page is loaded, I need to call its ExecuteWithParams operation for each VO.

    I would drag / drop (cascading) the operation of each VO ExecuteWithParams in the workflow, but the problem is that I need to run logic to call.

    For example, I have some cases in which I have to exec VO, and then pass the value of a field in the returned to the VO ExecuteWithParams, another record.

    I guess I can't manage this 'declarative' in the taskflow but I use code in a managed bean.

    So far, I've added for each VO ExecuteWithParams action page links.

    I know I can use a code like this to call the ExecuteWithParams for each VO...

    OperationBinding operationBinding = BindingsUtils.getBindings().getOperationBinding("ExecuteWithParamsToCall");
    operationBinding.getParamsMap().putAll(paramsMap);
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
      return false;
      }
    

    ... but the problem is... where and when I call?

    I wrote in the managed bean extended view a public function initPage() tha called the ExecuteWithParams.

    How to use this function?

    I can use it during the lazy fo page load?

    Can I use it as a method call to place in the working group before the page? I have to admit that I already tried that way, but it did not work...

    In addition, after calling a VO ExecuteWithParams, as I said before, I may have the need to treat the VO after his execution to gather values for some fields (I'll pass these values to the other VO ExecuteWithParams).

    Can I access the iterator from the bean by using the iterator binding?

    Thank you very much

    Federico

    Instead, I have to create it in the the methodCall1 pageDef?

    Yes

    And if methodCall1 calls - as in my case - the function of a bean that uses the ExecuteWithParams many istances VO... I create all the necessary links in the methodCall1 pageDef?

    Yes

    And Yes... Links ExecuteWithParams that I created in the page untitled1 aren't necessary?

    Once again Yes (except if you do not have to invoke to untitled1 page)

    If you have 2 minutes trying to download the app, so you'll have is that I was

    I have more than 2 minutes (I hope), but I did not immediately jdev

    Dario

  • Empty search results message will appear when the page is loaded

    ******************
    If ($totalRows_rs_searchresults == 0)
    {/ / Show if recordset empty? >}
    < div align = "center" class = "body" > sorry your search gave no results, please try again < / div >
    ******************

    That works very well, but obviously it appears when the page is loaded first that the number of search results is zero. So, how can I get this message to NOT show up until the form has been submitted for the first time?

    See you soon

    Dave


    davecheet wrote:
    > ******************
    > If ($totalRows_rs_searchresults == 0)
    > {/ / Show if recordset empty? >}
    >

    Sorry, your search returned no results, please
    > try again

    > ******************
    >
    > Which works very well, but obviously it appears when the page is loaded first as the
    > number of search results is zero. So, how can I get this message to does NOT display
    > until the form has been submitted for the first time?

    If you use the GET method to send the search form, change the
    conditional statement like this:

    If (isset($_GET['search'])) & $totalRows_rs_searchresults == 0)

    Change the value of 'search' for the name of the field used to
    filter the results. If you use the POST method, use instead of $_POST
    from $_GET.

    --
    Adobe Community Expert David Powers
    Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • How to set the time to refresh the page items when the Page is loaded

    Hi all

    When my pages load, some hidden page items are displayed, and when the page load they are hidden again. Is it possible to keep hidden without this time to refresh?

    Thank you

    Bsalvador

    bsalvador wrote:

    You know the syntax of css to hide the label too?

    #P1_ITEM_X, label[for="P1_ITEM_X"],
    #P1_ITEM_Y, label[for="P1_ITEM_Y"],
    #P1_ITEM_Z, label[for="P1_ITEM_Z"] {
      display: none;
    } 
    

    However this will not affect the underlying layout grid, which still affects the appearance of the page. If possible you can put the items in question in separate regions [sub] and show/hide those, rather than the individual elements.

    Post edited by: fac586

  • Table does not display data when the page is loaded.

    Hi all

    I am using jd 11.1.1.4

    I have an adf Table in my web page created from a VO and a query pane to find the table,
    When I initially loda page table shows all the lines, but when I press the search button in the query Pereira, the table displays lines.
    I want the data in the table shows that when the page loads, pls tell me how to do this.

    Thanx

    Hello

    Try to set the option to refresh on the iterator in the PageDef to "always."

    Or add the pageDef ExecuteQuery method and add an invokeAction to your executable files.

    Kind regards
    Stijn.

  • How return values when the page of the ofa procedure call

    Hello

    I need to return multiple values in the OPS page calling procedure.i using below code.bt I'm able to return a single value. Please suggest me how to return multiple values.

    Co:

    -----

    If (pageContext.getParameter ("Calc")! = null) {}

    Vo1 OAViewObject = (OAViewObject) am.findViewObject ("AddonBillingVO");

    System.out.println ("VO");

    {if(VO1!=null)}

    CNT int = vo1.getRowCount ();

    System.out.println ("count:" + cnt);

    If (cnt > 0)

    {

    RowSetIterator rs = vo1.createRowSetIterator("empIterator");

    System.out.println ("EMP");

    If (rs! = null)

    {

    While (rs.hasNext ())

    {

    AddonBillingVORowImpl line = rs.next ((AddonBillingVORowImpl));

    System.out.println ("impl");

    If (line! = null)

    {

    String laseid = row.getAttribute("LeaseId").toString ();

    System.out.println (laseid);

    String billingid = row.getAttribute("AddonBillingId").toString ();

    System.out.println (billingid);

    [Serializable] param = {}

    laseid, billingid

    };

    String newupc = (String) am.invokeMethod ("callPLSQLProc", param);

    System.out.println (newupc);

    String myValue = newupc;

    OAMessageTextInputBean textBean = (OAMessageTextInputBean) webBean.findChildRecursive ("prorate");

    textBean.setValue (pageContext, myValue);

    }

    }

    AM:

    --------

    public String callPLSQLProc (String laseid, String billingid)

    {

    OracleCallableStatement callableStatement = null;

    Try

    {

    String callProc = "BEGIN LEASE_PRORATE_PKG. LEASE_PRORATE_PROC1 ' + '.

    "(p_lease_id = >: 1,» +)"

    ' p_billing_id = >: 2 +,

    "(p_prorate = >: 3) +;

    'END;';

    callableStatement (OracleCallableStatement) = getOADBTransaction ().createCallableStatement(callProc,1);

    callableStatement.setInt (1, Integer.parseInt (laseid));

    System.out.println (laseid);

    callableStatement.setInt (2, Integer.parseInt (billingid));

    System.out.println (billingid);

    callableStatement.registerOutParameter(3,OracleTypes.VARCHAR,255);

    callableStatement.execute ();

    String resultMessage = (String) callableStatement.getString (3);

    System.out.println (resultMessage);

    Return resultMessage;

    }

    catch (System.Exception e)

    {

    e.printStackTrace ();

    System.out.println ("execepn");

    throw new OAException (try (), OAException.ERROR);

    }

    printscreen.PNG

    Khalil.

    Hello

    You are the PL/SQL procedure in a loop on the right? Just assign the value to the attribute appropirate.

    if (pageContext.getParameter("Calc")!=null)  {
      OAViewObject vo1 = (OAViewObject)am.findViewObject("AddonBillingVO");
      System.out.println("vo");
      if(vo1!=null) {
      int cnt = vo1.getRowCount();
      System.out.println("count :" + cnt);
      if (cnt > 0){
      RowSetIterator rs = vo1.createRowSetIterator("empIterator");
      System.out.println("emp");
      if (rs != null){
      while (rs.hasNext()){
      AddonBillingVORowImpl row = (AddonBillingVORowImpl) rs.next();
      System.out.println("impl");
      if (row != null){
      String laseid = row.getAttribute("LeaseId").toString();
      System.out.println(laseid);
      String billingid=      row.getAttribute("AddonBillingId").toString();
      System.out.println(billingid);
      Serializable[] param = { laseid,billingid };
      String newupc = (String) am.invokeMethod("callPLSQLProc",param);
      System.out.println(newupc);
      //String myValue = newupc ;
      //OAMessageTextInputBean textBean = (OAMessageTextInputBean)webBean.findChildRecursive("prorate");
      //textBean.setValue(pageContext, myValue);
      row.setAttribute("Prorate",newupc);
      }
      }
      }
      }
      }
    }
    

    Check the last lines. If the attribute name is nothing else than "Pro rata", updated accordingly.

    See you soon

    AJ

  • Setting Focus when the Page is loaded

    Apex 3.2

    Theme 15

    IE8

    I'm trying to focus on the loading of the page with javascript

    OnLoad = "$f_First_field ('P10_BMI_EXTKEY')" "

    Now users have asked for this field a dynamic default value (always 4 characters),

    for example, DEM -.

    I'll put this using one before the header is calculated.

    How can I set the focus when loading for the fifth character in my field, that is to say, after DEM -.

    Thanks in advance

    Gus

    Gus,

    It's true. SelectionRange works only when the focus is actually on the ground. Indeed, so you will first need to focus on the issue and then run the code selectionrange. Take care of property: the post SO talking about a 'problem' of synchronization, where the focus is always past before execution of the selection range. Try it, you need it. Basically, with the polyfill in place you will be able to use the code in the linked thread stackoverflow. To keep your manageable onload tag, you can move the focus + selection code in a function.

  • Af fill: table when the page is loaded.

    Hello

    I am required to complete the table on the page loading. In the newspapers, it indicates that the SELECT view query is run before displaying the page. However "No data to display" is displayed.

    When clicking on the link 'Search' of af: corresponding QuickQuery, it displays the data.

    JSPX table code is as follows:

    < af:table summary = "list of countries".
    value = "#{bindings." CountrySetupVO1.collectionModel}.
    var = "row".
    lines = ' #{bindings. " CountrySetupVO1.rangeSize}.
    emptyText = "#{bindings." CountrySetupVO1.viewable? "{'No data to display.': 'Access Denied.'}".
    contentDelivery = "immediate".
    fetchSize = "#{bindings." CountrySetupVO1.rangeSize}.
    rowBandingInterval = '0 '.
    selectedRowKeys = ' #{bindings. " CountrySetupVO1.collectionModel.selectedRow}.
    selectionListener = "#{bindings." CountrySetupVO1.collectionModel.makeCurrent}.
    rowSelection = 'single '.
    partialTriggers =": qryId1: cb3: cb1"id = "t1"
    styleClass = "AFStretchWidth" >

    Suggestions please!
    Thank you
    Amar

    The component causes the framework call ViewObject.executeEmptyRowSet () when you navigate to the page for the 1st time. Try setting InitialQueryOverriden = true on the region corresponding search link in the PageDef in order to change this behavior. You can get more information in this blogpost:
    Dimitarhttp://jobinesh.blogspot.com/2009/11/displaying-pre-executed-query-result-in.html

    Dimitar

  • erase the data when the page is loaded...

    I have page contain 4 regions. the region is in a table which is fetch and display when I run the page. Thus, the loading of the page I want to erase the data on this page?

    How to do this?

    Thanks and respect,
    SKUD

    Hello

    Change the attribute of tabular report.
    Under section sign

       short_name 
    

    Kind regards
    Shijesh

  • Form sent automatically when the page is loaded

    DW8 / PHP / MySQL
    How can I submit a form when the user enters the page? I want to imitate the user by selecting the page and clicking on the submit button. Is it possible easily?
    Thank you
    [email protected]

    Thank you for pointing me in the right direction. It was late and I was stuck on this method to solve my problem! I used your suggestion and all woks perfect now!
    Dennis
    [email protected]

  • scope pageFlow Managed Bean cannot be instantiated when the page is loaded.

    12.1.3 jdev

    When I set the java class as session or endossage extended bean in my BTF, my page OK.

    But if I set the same class as pageFlow brought in my BTF, I got error:

    javax.el.PropertyNotFoundException: //opt/jdevhome/system12.1.3.0.41.140508.1628/o.j2ee/drs/ProgrammaticLOV/ViewControllerWebApp.war/glog/fusion/flow/test/ShipmentLOV.jsf @10,44 value="#{shipmentLOV.shipmentXid}": Target Unreachable, identifier 'shipmentLOV' resolved to null 

    It's very strange for me. I set autresclasses pageFlow brought in before BTF. They all work.

    Any idea what can cause this error?

    Thank you.

    This works for scope request and the scope of session because these scopes are scopes of normal jsf that you don't have to precede the name of scope (and not precede with their scope names). JSF numbers what scope are that beans in and instantiated automatically for you. Scopes added by the ADF, as pageFlowScope aren't standard scopes and it must be prefixed by the name of scope. In addition, they are different instantiated of broad beans normal.

    Check again that the bean is set that once in right in the workflow definition file, the bean is up to. Don't do anything in the constructor of this bean so-called probably not at the right time.

    Timo

  • Avoiding the Vo to run when the page is loaded.

    Hi friends,
    When I drag and drop an object View to JSPx page at run time, I had the values of data in the tables. But I need empty lines only... Any type of suggestions always welcome.


    Thank you
    Arun D.

    >
    When I drag & drop as a form of jspx page at run time I form with values from database. But I need to tag with empty lines
    >

    You must use CreateInsert action, you can use the method call activities before your jspx page.
    Check this box:
    http://tanveeroracle.blogspot.com/2009/09/ADF-11g-CreateInsert-to-display-blank.html
    http://blogs.Oracle.com/Shay/entry/executing_an_action_on_jsf_pag

    Published by: M.Jabr on June 21, 2011 17:56

  • ADF how complete the data when the page is loaded

    I want to fill with data on a table page loading time 2 or more by pressing the key.

    Hello

    "Expensive another problem that I have a parameter for example P_teacher_id and which connection teachers with his ID he can see his own presence and review... mean how to pass single parameter on multiple pages."

    Equip your variable longer scope (Session or Page Flow) range use throughout the application...

    Thank you.

  • When I click on a FF article "farm" while it loads. I get my desktop with the FF icon in the status bar when the page is loaded FF goes full screen again.

    This happened with greater frequency since my last update of FF. I sometimes blue spinning circle, sometimes not. Running Win 7 on a Dell Inspiron

    Thanks for the suggestion, I changed it to false - we'll see.

Maybe you are looking for

  • Apple Mail keeps asking for password and won't accept it.

    My iMac mail keeps asking for the password for one of my email addresses. The address is... @hotmail.co.uk, when I enter the password it doesn't recognize it and declare it invalid. Moments later, the mail is delivered. A month ago I had the same pro

  • Bookmarks - a better Export / exposure amount of file in the status bar

    I did this macro to get my favorites unordered Firefox (the steps are listed, not the actual macro). I keep my favorites in a spreadsheet, where I currently have 12 levels of ability to sort. * * * * * * * * * * * * * * * * * * * * * * * As you can s

  • Refresh rate of the external monitor (closed macbook) reset

    Hello Im very new to OS X, I have a macbook air 13 "that I have it plugged into my external monitor acer, when he was in closed mode (clamshell) I changed frequency by accident and now I can't change this back as the ' entry is not displayed. How can

  • From a ReadWaveform on an external trigger?

    I have a DigitalMultiChannelReader that I need to start reading a waveform when a change of external line.  For example, I want to read Port3 lines 3 and 4, when PFI5 is high for a number of samples. readWaveformTask = new NationalInstruments.DAQmx.T

  • Media Player will not play. WVM files... rrrrr

    I have a Sony VIAO with plenty in the VISTA neck pain. Please help with above.Windows Media Player... Version 11.0.6001.7004 ERROR MESSAGE... Windows Media Player cannot play the file. The player might not support the file type or does not support th