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

Similar Messages

  • Set jsp variable in javascript

    I have a simple question.
    I have a section in jsp as below
    <%!
    String initial = "true";
    %>
    Can I set the "initial" parameter in javascript function in the same jsp like below?
    function init() {
    <%! initial = "true"; %>
    If not, would you please give me the syntax to do it?
    Thanks in advance,
    Mustafa

    the jsp scriptlet code, everything in between your <% ... %> marks, is compiled on the server.
    the javascript code is run on the client.
    therefore, you can NOT edit the scriptlet code from javascript. it cannot be done.
    you CAN however edit your javascript code with the jsp scriplet. see the below example, which shows me setting a javascript variable based on some scriplet code...
    <% String name = "Joe Schmoe"; %>
    <script>
    function doSomething() {
    var something = '<%= name %>';
    </script>
    When that page is rendered it will look like this...
    <script>
    function doSomething() {
    var something = 'Joe Schmoe';
    </script>

  • 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

  • Setting the value of a java variable in javascript function

    How can i set the value of a java variable in a javascript function?
    <%
    String fName = "";
    %>
    now i want to define a javascript function which can set the value of fName to the value it has been passed.
    <script language="javascript">
    function setJValue(val)
    </script>
    Thanks

    The only way you could simulate this, would be call the same page inside the Javascript function, and send it the parameter that was passed. Then you would have your Java code retrieve this parameter by request.getParameter("value");, and set the variable accordingly.

  • Set variable via Javascript

    I got a long string (length exceeds 32512) from Javascript, and want to pass the sting to a variable to a item called P_SQL
    I use *$x("P_SQL").value* in javascript to set the value, but my process couldn't get the value before I submit, however, when I do submit it reports an error like this :
    Bad Request
    Your browser sent a request that this server could not understand.
    mod_plsql: /pls/alq/wwv_flow.accept HTTP-400 Value param too long. Length is 216343. Upper limit is 32512
    Anyone knows how to handle this conflict ?

    Try like this to set the value in javascript, consider the string is stored in the variable 'pValue'.
    $s('P_SQL',pValue); Please read the document http://docs.oracle.com/cd/E3709701/doc/doc.42/e35127/javascript_api.htm#autoId36_
    Thanks,
    Lakshmi

  • 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.

  • Set Presentation variable using external Javascript?

    I want to create a user defined filter using custom java-script drop-down and wish to set a presentation variable on the dashboard. I have looked into various JS files to find the method for setting a presentation variable but have failed badly. If there is a way to set this variable please do help me out.
    thanks in advance
    ~V
    Edited by: user4555163 on Mar 9, 2011 5:42 PM

    Provide js-library you found and method for setting pres. variables and your custom js code.

  • 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

  • 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

  • Set client var using javascript

    i have a form where a user enters a line of info, and i want
    to save that as a client variable without having to post the form.
    is it possible to set a CF client variable using javascript?

    > cookies can be created/edited/deleted using js, so i just
    need
    > to know how i would go about editing a cf created
    cookie using js.
    You've inched away from your original question. It was about
    how to use Javascript to save form data in Coldfusion without
    having to send the form from the browser. The answer is, you can't.
    > i used javascripts document.cookie to make changes to the
    correct coldfusion
    > client variables..works like a charm
    You've not changed any Coldfusion variable at all. What
    you've simply done is use Javascript to write a new cookie, which
    Coldfusion then reads later. To see that, do this test.
    Save and run the following code as the page
    testCookieJS.cfm
    <html>
    <head>
    <title>testCookieJS</title>
    <script type="text/javascript">
    document.cookie="JS test cookie";
    </script>
    </head>
    <body>
    Coldfusion cookie struct dump:
    <cfdump var="#cookie#">
    </body>
    </html>
    You will find that the "JS cookie" is not dumped. However,
    you will find that the cookie is actually present in the browser.
    Now, close the browser and delete all cookies. Save and run
    the following code as the page
    testCookieCF.cfm
    <cfcookie name="CFCookieTest" value="CF test cookie">
    <cfdump var="#cookie#">
    You will find that the "CF cookie" is dumped. The difference
    in the result of the two tests shows that one cannot use Javascript
    to change the cookie that Coldfusion sets. In fact, generally
    speaking, you cannot use Javascript to modify any Coldfusion
    variables. If you could, anyone would be able to use an HTML page
    to rewrite your Coldfusion site.

  • Apex listener installed no test and set bind variables buttons

    I have installed Apex listener and while creating restful service module i dont see test and set bind variables buttons in the source region.
    I went through the many posts. Installed apex listener successfully.
    getting http://localhost:8080/ords/ started message when i start the listener.
    and using Apex URL as http://localhost:7780/pls/htmldb.
    What are the possibilities for this issues?
    Please help me on this.
    Thanks
    Chandran

    Apex listener version is 2.0.9
    Apex version is 4.2

  • How to set a variable value on the BPC Data Manager

    Hello BPC Experts,
    I'm creating a BPC10 NW version demo environment for our prospect customer.
    I made a data manager to import  BW data into BPC model from BW cube.
    I need to import just one month data into BPC from the BW cube that has more than one month data.
    When I run the data package manually, I can select a member of the time dimension prompt and I can import specific month data I want.
    But, in a case where the program (data manager) runs by JOB monthly,
    I can't select a member of the time dimension prompt manually.
    So I want to know how to set a  variable value to the time dimension prompt from a system date etc. automatically.
    Are there any way to set a variable value to the time dimension prompt on the data manager automatically from a system date?
    Or, do you have any other solution to import just one month data into BPC from the BW cube that has more than one month data  by the data manager running on JOB ?
    (without selecting a member of the time dimension prompt of the data package manually)
    Thanks in advance,
    Keisuke

    Hi Gersh
    Sorry for my late reply and thanks for your helpful information.
    I tried the second way of your information and I could configure it.  
    And I 'll try first way of your information.
    Regards,
    Keisuke

  • How can I set #HOST# variable referenced in the Chart template?

    #HOST# and #HOST_PROTOCOL# are being set incorrectly by APEX from CGI variables when I create a chart. I am using APEX 4.1 and Oracle 11g. The get the continual "Loading data..." and then after it times out I get "Error loading file".
    Before we changed to a secure http environment, our charts worked. After we changed to the new web layer, the charts do not work. The #HOST# substitution was set to http://correctservername/ and #HOST_PROTOCOL# was set to http. We set PlsqlCGIEnvironmentList REQUEST_PROTOCOL=https in the dads configuration file and now the #HOST# displays https but it also includes the default port number which we do not want (https://correctservername:port/) The charts work without the port. REQUEST_PROTOCOL is not in the cgi list and setting this variable set #HOST_PROTOCOL#. What variable can we set to make #HOST# correct. It seems like #HOST# is being set by #REQUEST_PROTOCOL#'://'||HTTP_HOST||':'||SERVER_PORT||SCRIPT_NAME||'/'. SERVER_NAME could also be used in of HTTP_HOST. I don't know how APEX is setting #HOST#. Does it come from a host alias somewhere in the environment?
    I don't want to add a new cgi variable called HOST because HOST sounds so generic and it might interfere with something else running in our environment. Or, I don't want to change the plsql cgi environment variable (such as HTTP_HOST) because many developers may use owa_util.get_cgi_env('HTTP_HOST') to get the current server. If the SERVER_PORT is part of the #HOST# then what could I change it to if it needs to be null. If you leave it blank, then the default SERVER_PORT comes from the CGI variables.
    I would rather not create a global variable (hard-coding) and create a new chart template using the global variable or create a before header application process to re-direct url without a port.
    Edited by: Donna C-Houston on Oct 10, 2012 1:06 PM

    Hi Donna,
    changing the CGI environment variables HTTP_HOST, REQUEST_PROTOCOL and SERVER_PORT is the correct way how to resolve this, because it appears that your hiding the web server where you have installed mod_plsql or EPG by a different outside facing web server (also called reverse proxy). That's why APEX gets the host name, protocol and port of the internal web server, but should actually get the values of your reverse proxy web server. Can can fix that by changing the following CGI environment variables.
    HTTP_HOST should just contain the domain name (no protocol or port). For example: www.oracle.com
    REQUEST_PROTOCOL should contain http or https
    SERVER_PORT should be the port for https
    I don't want to add a new cgi variable called HOST because HOST sounds so generic and it might interfere with something else running in our environment. Or, I don't want to change the plsql cgi environment variable (such as HTTP_HOST) because many developers may use owa_util.get_cgi_env('HTTP_HOST') to get the current server. If the SERVER_PORT is part of the #HOST# then what could I change it to if it needs to be null. If you leave it blank, then the default SERVER_PORT comes from the CGI variables.The value of HTTP_HOST is wrong anyway and points to your internal web server, but I assume your developers actually want to get the host name of your external web server if they use it to generate absolute URLs. That's why I wouldn't bother and set it to the correct host name.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • How can I set a variable number of values in a SQL IN clause?

    Hi,
    How can I set a variable number of values in a SQL IN clause without having to change the text of the SQL statement each time?
    I read the link http://radio.weblogs.com/0118231/2003/06/18.html. as steve wrote.
    SELECT *
    FROM EMP
    WHERE ENAME IN (?)
    But we need the steps not to create type in the system and would there be any other solution if we would like to use variable number of values in a SQL IN clause ?
    We are using JDeveloper 10.1.3.2 with Oracle Database 10.1.3.2
    Thanks
    Raj

    Hi,
    can you please explain why the solution from steve is not the right solution for you.
    regards
    Peter

  • Setting Environment Variable CPIC_MAX_CONV

    Hi Experts,
    In of  the steps during POST INSTALLATION of PI7.0 it says to set the variable CPIC_MAX_CONV, using the transaction RZ10.
    When i logged in to the abap system , and checked in RZ10,did find any variable of this name.
    Do I need to create it first and then set the value gw/max_conn_per_wp.
    If yes, give me the steps to do this. or else any other alternative.
    Thanks in advance,
    Younus

    Hi,
      Check this note : 
    1.- https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bc_fes/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d333136383737%7d
    2.- /thread/174978
    The parameter CPIC_MAX_CONV is a environment variable that you find in Unix or windows, depends where you had installed SAP PI.
    Best regards
    Ivá

Maybe you are looking for

  • Pictures not in iTunes Prefs with 10.4.3

    Want to add pics to my 4G Nano, but the Pics Pref button doesn't show up in iTunes 6.0.1 using 10.4.3 on my G4 iMac. Works fine on the G4 PowerBook running 10.3.9 with iTunes 6.0.1. Have searched all the posts and knowledge docs and done everything I

  • Serial to USB converter with GPS error

    I recently created a program to log GPS information from a Garmin GPS18 antenna.  The GPS uses a serial port on the docking station of my laptop for communication and USB for power.  In order to deploy this application to a field location, I need to

  • My Macbook Pro Wont Make it Past the Boot Screen

    I was using Safari and GarageBand today when my computer froze entirely (so that i could not access force quit, restart, etc.). I held down the power button to turn it off and now when i try to turn it on only the white/gray apple screen with a spinn

  • Soap response Error when processing XML CF.

    Hello, I have problems with soap response and wondered if you could give some advice. Every time I send my message via soap I get the following error: com.sap.aii.af.ra.ms.api.RecoverableException: SOAP: response message contains an error XIAdapter/H

  • 10.5.7 Deleted Files

    When I upgraded to 10.5.7 it deleted Movies folder, Music folder, and Safari Bookmarks also reset all user preferences to default. Ouch!!!! Didn't have back-up as this system is just used as a media server.