How to reference JavaScript functions stored in a script object on a different page?

Hi,
I have a form which has 2 pages. I have a bunch of JavaScript functions under script objects on page 1. How can I access these functions from page 2?
I tried the following but none of it work:
form1.page2.#variables[0].testScript.doThisNow();
form1.page2.variables[0].testScript.doThisNow();
form1.page2.variables.testScript.doThisNow();
Please help.

Hi,
Simplest way would be to drag the script object to be under the root node (form1). On both pages would would then be able to reference the function by:
testScript.doThisNow();
If you leave the script object under page1, then from page2, the following should work:
page1.testScript.doThisNow();
Hope that helps,
Niall

Similar Messages

  • Reference functions inside un untitled script object

    Hello,
    Does someone knows how to reference a function inside an untitled script object?
    thank you

    xfa.resolveNode("#script").functionName()
    You should always name your scriptObjects ...it makes accessing them much easier.
    Paul

  • How to call javascript function from PL/SQL procedure

    Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?

    Hi,
    I have a requirement to call Javascript function inside a After Submit Process.
    clear requirement below:
    1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
    2. user clicks on "save files" button
    3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
    Hope this clarify U.
    Krishna.

  • How to call javascript function?

    Hi,
    How to call javascript function for SAP button
    control onclick event?
    Thanks in advance.

    Hi Sundar,
      u can call java script  in design mode.
      Add this code in ur design part inside body and call the function as
    <sap:button id="a" onSelect="javascript:go();"
    Add inside body:
      <script language="javascript>
    function go(){
    alert("hai");
      </script>
    Regards,
    Vinoth.M

  • How to invoke  javascript function after business action??

    How to call javascript function(such as "window.close(), window.open(...),...") in the action method(public String doBusiness(){...}) of <h:commandButton>?If not,then,is there any alternate approach to call javascript function when the bussiness action method finished??
    Thanks a lot!

    Since your business method is called after the form is submitted, and your code is running on the server, probably the only thing you can do is this:
    Create a custom component (Maybe call it the "onLoad" component) that you always render at the top of your JSP. In the regular situation it wouldn't render anything, but in the case you mention, after your busines method, you would call a method on this new component on the server that would cause it to actually render something the next time it is rendered. When rendered this time, it could then render the "onLoad" method which has your window.close() code in it. The window would then close right away.
    The key is that you are not doing any of this on the client. The form is submitted, your business logic is executed, then the next page is rendered. When the next page is rendered, your javascript could be rendered to close the window.
    If I'm offbase here, someone please say something, I'd hate to send this guy on a wild goose chase.
    Dave

  • How to link Javascript code stored in a separate folder to a Form

    I have some Javascripts stored in a differnt Folder. If I want to achieve some different functionality in my forms , how and where do I link this folder. I tried in the Form Edit mode to attach it in the HTML code in the Script tag with the SRC attribute but not been successful.
    Help on this will be highly appreciated
    Thank you all in anticipation
    Cheers
    Nitin

    Hi,
    Simplest way would be to drag the script object to be under the root node (form1). On both pages would would then be able to reference the function by:
    testScript.doThisNow();
    If you leave the script object under page1, then from page2, the following should work:
    page1.testScript.doThisNow();
    Hope that helps,
    Niall

  • How to return javascript function value to jsp page

    Hi i want to retrieve values from javascript function to jsp page, how can i do that ? i am trying this but its not working
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/config.js"></script>
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/richtext.js"></script>
    <td>
    <jsp:param id="description" value= "<%=request.initRTE('', '')%>"/>
    </td>
    here this initRTE function is used for displaying rich text editor .....i want to retrieve back the contetnt written in this editor and save it to DB.
    Please help.
    Edited by: xtech on Apr 4, 2008 12:00 PM

    surely i will do that but my app is still not working.....
    here is my code
    </td>
    <td align="left">
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/config.js"></script>
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/richtext.js"></script>
    <h:inputHidden id="introtext" value= "<%=request.getParameterValues(description)%>">
    <script>
    initRTE('','');
    </script>
    </td>
    in java script function i am geeting the text content
    function initRTE(rtePreloadContent, rteCSS) {
    rtePreloadContent=document.getElementById('surveyinfo:introtext').value;
    startRTE(rtePreloadContent);
    menuBuilder();
    var description= document.getElementById(rteFormName).value;
    return description;
    basically i want to get the text written in text editor in jsp and want to send it to DB.(Here initRTE() function is calling rich text editor)
    i have downloaded this editor from this url
    http://freerichtexteditor.com/page/4.htm
    and trying to embed it in my app.

  • How to put javascript function to AIR

    Hi,
    first I had Flex web application with onet javascript function in index.html file. Now I copied my code from web project mxml file to AIR project and it working properly. How can add this javascript function now. There is no html file now...
    EDIT: I am trying to do (in my AIR application) copy to clipboard using roll Over the button. Maybe I can do this in another way instead of javascript function (as i did in my web application).

    SET CLIPBOARD DATA:
    import flash.desktop.Clipboard;
    import flash.desktop.ClipboardFormats;
    var textToCopy:String = "Copy to clipboard.";
    Clipboard.generalClipboard.clear();
    Clipboard.generalClipboard.setData(ClipboardFormats.TEXT_FORMAT, textToCopy, false);
    GET CLIPBOARD DATA:
    import flash.desktop.Clipboard;
    import flash.desktop.ClipboardFormats;
    if(Clipboard.generalClipboard.hasFormat(ClipboardFormats.TEXT_FORMAT)){
        var text:String = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT);
    (From LiveDocs: http://livedocs.adobe.com/flex/3/html/help.html?content=CopyAndPaste_1.html)

  • Issue with firePartialAction or how to include JavaScript Functions

    We are using the Client Action Type: firePartialAction on an element in a region of type: TABLE. When a user enters data in here and tabs away, the action fires and recalculates 2 other fields in the same region. On a object with a small number of rows, it seems to work fine. However, when you have a large number of rows (anything over 25), the page seems to hang for nearly a minute and then when it does come back, the values are sometimes not calculated properly.
    The only reason we are using firePartialAction is because the dev guide says that JavaScript is not supported by OAF. We would much rather use a client-side JavaScript function to do these simple arithemtic operations rather than do them on the server.
    My question is two-fold:
    1 - Has anyone experienced this issue and are there any other settings or coding tricks that we should be aware of.
    2 - Has anyone ever rendered a page with a custom JavaScript tag (or library)? Also, where would you add the code in JDeveloper to get a particular element to execute a particulate javascript function (ie: onchange=MCalc())?

    The firePartialAction event is not working for us, so we need to be able to at least try out javascript. We're rendering the page from an XML file, so it's not clear to us how we would even get a custom HTML tag to render into the page at all. Normally, I'd use some kind of HttpServletResponse.getWriter()...println method call to write html (as in a controller servlet), but how would you do that using the OAWebBean? I checked the OAFromattedTextBean, would that allow me to embed onchange into the field?

  • How to call javascript function in Flash

    Please help...
    I have a site that run multiple of domain for example
    Domain (A): raymond.com
    Domain (B): raymond.ca
    The problem is this.. when (B) html page load the flash file
    that locate at (A) it load but non of the buttons work which call
    javascript function using getURL("javascript:showpopup()"); But it
    work fine if all reside on the same domain,eg( (A) html page load
    flash file form (A)). Anyone know how to solve this other than
    create a set of flash files on (B).
    Regards,
    Raymond

    http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?cont ext=Flash_MX_2004&file=00001750.html

  • How to call javascript function with dynamic data in display tag

    Hi,
    Iam new to pagination concept. Iam using display tag to display rows in jsp by strtus.
    I have a problem when calling the javascript function using ahref in attribute in display tag.
    <bean:define name="form1" property="EditDetails.List" id="ListDisplay"/>
    <display:table name="pageScope.ListDisplay" cellpadding="0" cellspacing="1" pagesize="10" partialList="false" size="listSize" requestURI="">
    <display:column property="poNo" href='javascript:searchEditDetails("./submitOrder.do? actionID=getMISLoadEdit&poNumberSel=<%=((com.po.bean.EditDetails)poListDisplay).getNo()%>&statusIdSelected=<%=((com.po.bean.EditDetails)ListDisplay).getStatusId()%>")'
    title="Number"/>                         
    <display:column property="strDate"title="Date" />
    <display:column property="orderValue"title="Order Value(INR)"/>
    <display:column property="stringRequestedDeliveryDate"title="Suggested Delivery Date"/>
    <display:column property="statusDescription" title="Status" />
    </display:table>
    The above code display the data in row format is working fine when I click the No It thow javascript error and its not redirecting to the other page.
    When I try this with ordinary struts its working fine the code is:
    <logic:iterate id="polist" name="Form1" property="EditDetails.List" indexId="i" type="com.bean.EditDetails">
    <tr>
    <td ><a href="javascript:searchEditDetails("./submitOrder.do?actionID=getMISLoadEdit&NumberSel=<%=((com.bean.EditDetails)polist).getNo()%>&statusIdSelected=<%=((com.bean.EditDetails)polist).getStatusId()%>")"><html:hidden name="polist" property="No" write="true" /></a>     </td>
    <td><html:hidden name="polist" property="strDate" write="true" /></td>
    <td><html:hidden name="polist" property="orderValue" write="true" /></td>
    <td><html:hidden name="polist" property="stringRequestedDeliveryDate" write="true" />     </td>
    <td><html:hidden name="polist" property="statusDescription" write="true" /></td>
    </tr>
    </logic:iterate>
    Please help me how to call javascript with dynamic data.
    Thanks in advance

    The ADF Mobile Container Utilities API may be used from JavaScript or Java.
    Application Container APIs - 11g Release 2 (11.1.2.4.0)

  • How to call javascript function & action method on clicking jsf  button?

    I have one jsf custom button. I am checking client side validations in mail by calling javascript function & also sending mail by calling action method of a bean which will execute at server side for onclick event of that button. Because of this when I click on that button its calling both javascript function and action method. So even though validations failed its sending mail. How can I overcome this problem?? Please help me....

    I am asking regarding commanLinks in jsf. I have the following code block in jsf. Even though mailSentMessage('true'); returns false, its calling action="#{emailObjectAction.sendEmail}" method. thats why I got that doubt. try the following code.
    <h:commandLink id="mailBtn123Send"      onclick="return mailSentMessage('true');" value="send mail"     action="#{emailObjectAction.sendEmail}">          
    </h:commandLink>

  • How to execute javascript function then Code Behind in an ASP Button

    Hi Guys,
    I am currently working in a web application. I have a problem with calling a js function and codebehind.
    I have this asp button that when clicked, a javascript function should be called.
    My javascript function is like this:
    function Calculate(){
    // Set Route in google map
    // Store distance, lat/long in an array
    Then, after the Calculate function was executed, it should execute the code behind:
    protected void btn_calculate_onclick(object sender, EventArgs e)
    // Pull data stored in the array created by javascript
    // connect to db
    // store data
    But the javascript function doesn't execute.
    What should i do?
    Thanks in advance

    Hello,
       javascript function can not executed in server side, you can tranlate javascription fuction to c# function.
     if the reply help you mark it as your answer.
     Free
    Managed .NET
    Word Component(Create,
    Modify, Convert & Print)

  • How to call javascript function in back bean of jsf

    hi,
    i am trying to call java script function in back bean but not done. Is there any code for call javascript function in bean file.

    Java runs at server side.
    JSF produces HTML output.
    Server sends HTML output to client.
    Java stops running.
    HTML runs at client side.
    JS starts to run in HTML.
    Clear? Java is a server side language. JS is a client side language. To run JS using JSF, simply print it out to the HTML so that it get invoked when the HTML runs.

  • How to use javascript functions in struts jsp page

    hi
    iam using struts jsp pages. here iam calling one javascript function. but iam not able to access the form in javascript.
    wat i have to give as form name to get the elements of the form.
    please reply me soon
    it is urgent
    vamsi

    your form has no name liek this one:
    <html:form action="/userRegistration.do" >so you cannot access the elements inside your form?
    accessing the elements inside the form will be like this:
    document.forms[0].propertyName.value;

Maybe you are looking for

  • Can't search event in iCal Leopard

    After upgraded to Leopard, the search function in iCal doesn't work. When typing a event title in the search field, the search pan appears with empty contents. Does anybody get the same result?

  • How to open a new tab in safari

    how do i open a new tab in safari and how do i copy and paste a simple sentence?

  • Problem calling BPEL process using apache axis client

    We have a BPEL process which we are trying to call from apache axis client. The problem is when we execute "call.invoke(new Object[] { xmlStr }) ", it adds an "argo" element to the message, and the xpath is unable to evaluate the message. We are able

  • Subcontracting  Critical scenario

    I have scenario like this I doing subcontracting with subcontractor For that we have give him 5 Machines  of worth 10 laces Against that, we reduce processing rate but I want to know that how to map this in SAP HOW TO send him machines in SAP & How t

  • Response from Tomcat Server slow and Invariable to JSP

    Hello, I have developed an application which is an INTRANET PORTAL in advanced java. My database is MySQL and Server is Tomcat V5.5 The problem is server response is very slow and sometimes it stops responding, also when I try accessing it from remot