Public variables in javascript

how i can use public variables in javascript along with ADF. I am declaring a variable at the top of list but when an event is generated by ADF and i tries to access that variable, it gives me an error of undefined.
Kindly help me

Not directly, but you can with this:
http://java.sun.com/products/plugin/1.3/docs/jsobject.html
See also:
http://www.codeproject.com/jscript/javatojs.asp?df=100&forumid=736&exp=0&select=700857

Similar Messages

  • Using Flash variable in Javascript problem

    I want Flash to load a rss feed and hand it to Javascript
    which will do the parsing and rendering. AFAIK Javaswcript can't
    load external documents and include them into the current html page
    for some security reasons. So I try this approach.
    I attached the code I have. My Problem is that Flash does
    pass the variable to javascript but the document.write overwrites
    everything else in the current html document.
    I don't want to work with popups for obvious reasons. The
    variable must be included in the _current_ document.
    Can anyone give me a hint how to get this working properly?

    What is happening is the XML file is getting cached by the browser.
    There are a few different ways to fix this, but this is what I have found to be the easiest.
    In the Actionscript, where the call to load the xml is, append a random string to the end of the call.
    so:
    (This is AS2 code - so a conversion is necessary if using AS3)
    myXML.load("http://path/to/xml.xml?r="+Math.round(Math.random()*99999999999999999999999999999999999999999999999));
    What this will do is tell the browser that you are calling a unique file every time you try to load the xml, which will forcefully bypass the cached version.

  • How to pass a jsp variable into javascript??

    <p><%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
    <p><%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <p><html>
    <p><c:set var="binrmapi" value="http://localhost/paas-api/bingorooms.action;jsessionid=XXXXXX?userId=TEST2&sessionId=1&key=1" />
    <p><c:import var="testbinrm" url="${fn:replace(binrmapi, 'XXXXXX', jsessionid)}"/>
    <p><c:set var="tuples" value="${fn:split(testbinrm, '><')}" />
    <p>Time until next game
    <p><c:forEach var="tuple" items="${tuples}">
    <p><c:if test="${fn:contains(tuple, 'row ')}">
    <p> <p><code>
    <p> <c:set var="values" value="${fn:split(tuple, '=\"')}" />
    <p> <font color="blue">
    <p> <c:out value="${values[17]}" />
    <p><c:set var="remainingtime" value="${values[17]}" />
    <p> </font>
    <p> </code>
    <p></c:if>
    <p></c:forEach>
    <p><form name="counter"><input type="text" size="8" name="d2"></form>
    <p><script>
    <p>var milisec=0
    <p>var seconds=eval("document.myForm.remaining").value;
    <p>function display(){
    <p> if (milisec<=0){
    <p> milisec=9
    <p> seconds-=1
    <p>}
    <p>if (seconds<=-1){
    <p> milisec=0
    <p> seconds+=1
    <p> }
    <br>else
    <p> milisec-=1
    <p> document.counter.d2.value=seconds+"."+milisec
    setTimeout("display()",100)
    <p>}
    <p>display()
    <p></script>
    <p></body>
    <p></html>
    <p>This is my code that i was working on, in the jsp part of the script, i get a api call and save a value of time in the variable remainingtime.. and in the javascript, i try to have a countdown clock counting down the remaining time.. but i guess it doesnt work.. how can i get that working? thanks alot
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001

    Re: How to pass a jsp variable into javascript??Here is the sameple one, hope it will solves your problem.
    <html>
    <body>
    <form name=f>
    <%!
    String str = "A String"
    %>
    <script>
    var avariable = <%=str%>
    <script>
    </form>
    </body>
    </html>
    Let me know if you face any problem

  • How do I set a public variable in a native ActiveX DLL using Java?

    Hello,
    I have run into an issue that I cannot seem to find any documentation on, and all of my efforts with search engines have returned no useful results.
    Here is my situation:
    I have an Active X DLL that has a very simple configuration, but it is a third party DLL which I cannot modify. To interface with the DLL I have to set a series of public variables and then call a method with no parameters that will use the current values of the variables to perform a calculation. There are no "set" or "get" methods.
    At this point I have a very good idea about how to use JNI to create the class in java, and call the method. However, this does me no good at all if I cannot set the variables.
    Everything I have found so far defaults to an assumption of no direct access to variables, and that getter and setter methods would be available for that purpose. Anyone know of a way that this might be handled? I would provide source code, but it seems useless unless I know how to actually do this.
    Thanks in advance for any input.

    OK. Those are OLE/ActiveX/COM/WhateverTheyCallIt getters and setters, that VB makes look like object 'properties'.
    If you are familiar a bit with C#, they also have 'properties', which are getters and setters hidden behind a syntax that makes them look like member variables.
    I am affraid my help has to stop here, as I don't remember COM anymore.
    But, unless you find someone who really knows COM, you will have to investigate by yourself.
    One suggestion though: open a C++ project in VisualStudio 2005 or 2008 (not Express, it seems not to support what I describe).
    Go to something like References or Add Reference and you will see a tabbed dialog box with a COM tab (I describe all this from memory).
    Add your DLL. After this do View->Object Browser or alike. It should show your COM object. You will be able to examine its methods and properties.
    I think Visual Studio canl generate code for invoking them. This is the C code that somehow you should take from there and place in your JNI code.
    Edited by: baftos on May 9, 2010 11:22 AM
    Correction: VS2008 Express also supports this, but to get there, you do View->Object Browser->Click the "..." button->COM tab.
    VS2008 Express is free.
    Edited by: baftos on May 9, 2010 11:25 AM

  • Accessing c4 Variables in Javascript

    How do you pass a Captivate 4 variable (User or System) in Javascript when the published .SWF is embedded in another tool like Lectora or Flash?
    In Captivate, you can set a value into a Lectora variable (VARmyLectoraVariable.set('myvalue');, but I don't know how to access the Captivate variable.
    When run from Captivate, this works:
    Captivate.GetVariable('CaptivateVariable');
    But when the published .swf from Captivate is inserted into Lectora and run, I get a JavaScript error ('Captivate' is undefined).
    How do you reference the Captivate variable in JavaScript when the .swf is not embedded in the Captivate project html file?
    Thank you!

    http://pipwerks.com/journal/2009/06/07/introducing-the-captivatecontroller/
    check this out

  • Setting variables in Javascript

    Hello all,
    We are trying to set a variable in javascript like so:
    var myFish = $v('P22_EPSB_SGF_GROUP').value;
    does not work. Yet the statement
    if ($v('P22_EPSB_SGF_GROUP') == '2')
    can be evaluated.
    Any help would be appreciated.
    Thanks

    lilhelp,
    The $v function returns the value so you don't need the ".value"
    The $x function returns the element so you would need the ".value"
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

  • Using public variables in a servlet

    Hi, I have a public variable "CustID" in my servlet. Note that is a public member variable and not a static variable.
    In the doPost() method, I am trying to use the custId field.
    Pls. look at the code below. I want to know that in a multi-user environment since the custId field is defined at Servlet level as a member variable, is there a chance for this variable to be corrupted and I fire a wrong query ???
    Awaiting your answers
    public class QWCustomerServlet extends HttpServlet
    public boolean debug = false;
    public QWFieldList fieldList = new QWFieldList();
    public String custID = null;
    public doPost(HttpServletRequest req, HttpServletResponse res)
    HttpSession session = null;
    if ( (session = request.getSession(false))!= null){ 
    custId = session.getAttribute("cid");
    String query = "select * from customer where cust_id=" + custId;
    Statement stmt = conn.createStatement();
    stmt.executeQuery(query);
    }

    Yes. There is only one instance of a servlet and all requests thread through it. Don't use instance variables unless you want all threads to share (usually in a read-only manner such as a reference to a resource). In your example, move the custId declaration inside doPost and it will be thread-safe.

  • How can we  use java variable in javascript code on JSP page?

    How can we use java variable in javascript code on JSP page?
    Pls help

    Think about it:
    JSP/Java is executed on the Server and produces HTML+JavaScript.
    Then that HTML+JavaScript is transfered to the client. The client now interpretes the HTML+JavaScript.
    Obviously there's no way to access a Java variable directly from JavaScript.
    What you can do, however, is write out some JavaScript that creates a JavaScript variable containing the value of your Java variable.

  • Set global x01 variable in javascript?

    Is it possible to set the x variables in javascript ? eg.
    $s('x01', 'some text');
    alert("my value = " + $v('x01');
    does not seem to be working for me
    Thanks
    Jon

    Hello Jon,
    It seems like I owe you an apology. I didn’t pay too much attention to the logic you are trying to implement, plus I thought you’ll also consider Rutger post. To be honest, I never tried to use x01-x10 outside an on-demand process, until your thread.
    So let’s start from the beginning. Although we are using the term global variables with regards to the x01-x10 variables (and they are indeed defined as global variables in the wwv_flow package) they don’t have the same functionality as application items, and in our context, mainly persistence. In fact, they were created to save us the need to define application items as temporary items, to be used only to pass values in AJAX processes.
    If you set one of these variables, using the addParam() method, its value will be available to you in the on-demand process that you reference in your AJAX request, but the value will not be set in session-state (like application/page items) and will not be persistence.
    If you want to use this value outside the on-demand process, you need to assign it to a page or application item. In your case the code
    :P1_MY_PAGE_VALUE := apex_application.g_x01;should be part of the on-demand ‘jmf_test' process. The P1_MY_PAGE_VALUE should be set with a Source Used of “Only …” so it will be populated from session state.
    The code of
    var ajaxRequest = new htmldb_Get(null, $v('pFlowId'),null, 0);should only be used when you need to save session state of application/page items from JavaScript (and not with the x01-x10 variables).
    Hope this time things are clearer and you’ll be able to achieve what you need. If, for any reason, they are not, please post again.
    Regards,
    Arie.
    Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.

  • Passing variable from javascript to servlet!!!

    Hi all,
    I have one doubt,
    can we pass a variable from javascript to servlet???
    In Brief,
    i am getting some values in javascript through jsp and the same values i
    want to use in servlet.
    Yes, i know i can get these values in servlet by using request.getParameter("");
    But these values are dynamically generated so i dont know how many varaible are they!. so i am trying to put some array list so that i can forward this values to servlet.
    But i can't get this array which is declared in javascript!! :( so any buddy can help me how to get this dynamically generated values in servlet!!!
    Thanks in Advance!! :)

    can you post a sample of your code?
    remember to put it between tags                                                                                                                                                                                       

  • Accessing public variables

    I have the code below. What I am trying to do is to print out
    the value of a public variable. I am trying to change that public
    variable in the function that handles the result of the remote
    object call. The problem is the value only seems to change in the
    function and no where else. Any ideas?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="load_list()">
    <mx:script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    public var material1_ID: int;
    public function load_list():void{
    material1_ID = 0;
    public function addRec():void{
    Alert.show('value before' + material1_ID.toString());
    insertService.addMaterial('123'); // THis calls my webservice
    and returns a query
    Alert.show('value after' + material1_ID.toString());
    public function addMaterial(event:ResultEvent):void{
    material1_ID = 9;
    ]]>
    </mx:Script>
    <mx:RemoteObject
    id ="insertService"
    destination="ColdFusion"
    source ="insert"
    >
    <mx:method name="addMaterial" result="addMaterial(event)"
    >
    </mx:RemoteObject>
    </mx:Application>

    This function in your code:
    public function addRec():void{
    Alert.show('value before' + material1_ID.toString());
    insertService.addMaterial('123'); // THis calls my webservice
    and returns a query
    Alert.show('value after' + material1_ID.toString());
    Looks to me like you are making the remote call and then
    expecting the next line to access the result. Flex doesn't work
    that way. Remote calls (including HTTPService and WebService) are
    asynchronous. When you make the addMaterial call, the request goes
    out and the response comes back "later". So right after that
    request the value won't be changed.
    If you print the value in the result handler, you'll see that
    it will be changed.

  • How can i access and assign java xml Document variable in javascript block

    How can i access and assign org.w3c.dom.Document variable in javascript block
    I tried this xmlDoc = "<%=xmldoc%>";
    it is not working
    plz give me solution.
    thanx
    Vidya

    The solution would only work on MS IE browsers, as other browsers do not support an XML DOM.
    It can be done, but you would be stuck with using the Microsoft broswer. If that is acceptable, I have some example code, and a book recommendation.

  • JSP variable in javascript

    Can I use a jsp variable in javascript? If so, how? It would be used in an "if" statement:
    function get This() {
    if (document.form.tfName.checked==true) || (<%jsp>) {
      then do this...}
    }

    My problem is I am grabbing a persistant value from a
    value object: the value of a checkbox as
    <%=InformationVO.isChecked()%>If (==true) i want javascript to enable a button on
    load. If not disable it. Plus I hav javascript on
    the page that controls this while the page is open.
    Just don't know how to incorporate the two scenarios
    s for:
    1.checking the value to ernable/disable the sumbit on
    load with the value of the VO
    2. using javascript to control the enable/disable
    while page is laodedYou want something like this?
    <%
    boolean enableButton = InformationVO.isChecked();
    %>
    <html>
    <head>
    <script language="javascript">
    // load event, enables or displables button depending on the InformationVO.isChecked value.
    function doMyLoadEvent(){
         if(<%=enableButton%>){
              // enable mySubmitButton object
         }else{
              // disable mySubmitButton object
    // submits the form
    function submitForm(){
         var frm = document.forms[0];
           frm.action = "path to your servlet goes here";
           frm.submit();     
    </script>
    </head>
    <body onload="javascript:doMyLoadEvent()">
    Woopdy doo!
    <form method="post" action="" name="">
    <input type="button" name="mySubmitButton" value="Submit" onclick="javascript:submitForm()">
    </form>
    </body>
    </html>

  • [CS3] How to add via plugin some variable into javascript object model?

    Otherwords i need access to some plugin variable from javascript.

    The BPI plugin source is pretty well documented via comments. If you don't like page items, search the .fr for any reference to "page item" and "PageItem", then remove those references.
    Depending on your specific purposes, also eliminate the persistent BPIDataPersist and related, or anything with "Panel" in it. This should give you a very minimum plugin.
    If you don't want a structure that behaves like a "prefs", remove kBPIPrefsScriptProviderBoss and all related.
    To add a property on a another boss rather than on page items, just replace kPageItemObjectScriptElement in the kBPIScriptProviderBoss of the VersionedScriptElementInfo, e.g. with kApplicationObjectScriptElement.
    app.documents is probably not what you want to follow, because that is a collection rather than an array so you would be implementing an own object type.
    Of course, keep a copy of your intermediate steps and whenever too much breaks, retry. That's how we all started ...
    Dirk

  • Setting OBI variables in JavaScript

    Is there some way to set OBI variables from JavaScript? And I mean any way, a Go URL syntax, pretending to be a Prompt, AJAX...candles and incense...anything!! : )
    I have some embedded HTML, and when the user clicks on a button/link/whatever, I need to set one or more an OBI variables for later use by a direct query Answers report.
    Thanks very much.

    lilhelp,
    The $v function returns the value so you don't need the ".value"
    The $x function returns the element so you would need the ".value"
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

Maybe you are looking for

  • Step by Step Instructions on R12.2.0 upgrade to R12.2.3

    Hi All, I just went through an 12.2.3 upgrade and had my documentation done while upgrading. Therefore thought of sharing the upgrade procedure and possible issues you may encounter and how you could avoid them. Enviornment Details:                 O

  • Installing Windows 8 on New Hard Drive

    I am not very computer literate so please bear with me.   The hard drive went bad in m Hp Pavilion 15 Notebook PC last week.  I ordered a new hard drive from H P and installed t this morning.  I found a video online and the installation was quick and

  • Ccms alert for RFC service

    I have a simple task that i was told to monitor. There is RFC to a remote non-sap system that is setup in SM59.  This non-sap system some times stops responding.  I would like to setup a CCMS alert specific to this RFC.  I have tried creating all kin

  • SC missing in SOCO

    Hi We have a couple of SC that are approved. When looking in Monitor SC we can see that the status is Approved. However we are unable to find the SC in SOCO. When looking at other SC we can see that the status is "In purchasers work list". How come t

  • Why Does Encore 2.0 Transcode Twice?

    Hi! I prefer to transcode my assets (DV-avi's) prior to burning and have noticed several times that even if the status of all assets says Transcoded, Encore 2.0 sometimes transcode one or more items once again when i burn the DVD eventhoug they alrea