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

Similar Messages

  • 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

  • Sun IdM: How to set a multi-value field on document.mainform via javascript

    The following will set variables.variable1 to variables.variable2 when the "Script Link" component is clicked. I would like to modify
    this so that el2 references a multi-valued element (e.g. a list generated by a Select Field)
    <Field>
    <Display class='Javascript'>
    <String>
    function myScript() {
    el=getElement(document.mainform,"variables.variable1");
    el2=getElement(document.mainform,"variables.variable2");
    el.value=el2.value;
    </String>
    </Display>
    </Field>
    <Field name='Script Link'>
    <Display class='Link'>
    <Property name='URL'>
    <String>javascript:myScript();submitCommand(document.mainform,%20'Recalculate');</String>
    </Property>
    </Display>
    </Field>
    My issue is, if variables.variable2 is a list / multivalued, i get errors trying to traverse through the "array".
    How can i read and set a list element via the javascript function above? I've tried things like get(), put() , as well
    as path expressions like variables.variable2[0] .
    any help would be appreciated....
    is there an API somewhere i can reference?

    The MultiSelect field-type is a little different than the rest of the fields. If you use the applet version, then selecting/deselecting values cannot be captured by referencing the field directly in javascript.
    The way to identify the selections is to use the javascript methods includes/MultiSelect.js file (IDM form submission uses the same method):
    fixMultiSelectAppletBeforeSubmit( )
    fixMultiSelectNonAppletBeforeSubmit( )
    .. and then referencing the "<multiselect-field>_selected" form element.
    So in your case, the code should look something like this:
    function myScript() {
        fixMultiSelectAppletBeforeSubmit(document.mainform,"variables.variable1");
        var el1 = getElement(document.mainform,"variables.variable1_selected");
        // assign the value to variable2..
        el2 = getElement(document.mainform,"variables.variable2");
        el2.value = el1.value;
    }Just make sure ":variables.variable2" is not a multi-select field, else the value set here will be reset during form submission.
    Adi
    [www.xpressutils.com|http://www.xpressutils.com]

  • Set multiple values in a web template via JavaScript

    Hi,
    I have a web template displaying a query containing a mandatory variable. Multiple values are allowed for the variable.
    By manually inserting a link in the template I succeeded in setting a single value for the variable with JavaScript, but how is it possible to pass multiple values for that variable?
    So far my link target looks like this:
    "sap/bw/BEx?sap-language=EN&bsplanguage=EN&CMD=LDOC&
    TEMPLATE_ID=ZJS_WT_1&VAR_NAME_1=ZJS_V_R&VAR_VALUE_EXT_1=1"
    How do I have to modify the line?
    Cheers,
    Jost

    Jost -
    I haven't tried this yet...but I suspect it could work. In the below example, I have a variable on Company Code and am setting it equal to 3 different values. Give it a shot.
    &CMD=PROCESS_VARIABLES&SUBCMD=VAR_SUBMIT
    &VAR_ID_1=ZCCMPCOD0001
    &VAR_ID_2=ZCCMPCOD0001
    &VAR_ID_3=ZCCMPCOD0001
    &VAR_OPERATOR_1=EQ
    &VAR_VALUE_LOW_EXT_1=IP01
    &VAR_VALUE_HIGH_EXT_1=
    &VAR_SIGN_1=I
    &VAR_OPERATOR_2=EQ
    &VAR_VALUE_LOW_EXT_2=IP05
    &VAR_VALUE_HIGH_EXT_2=
    &VAR_SIGN_2=I
    &VAR_OPERATOR_3=EQ
    &VAR_VALUE_LOW_EXT_3=IP50
    &VAR_VALUE_HIGH_EXT_3=
    &VAR_SIGN_3=I

  • Firefox 3.6 crashes or hangs when setting an iframe src to a pdf via javascript. 3.5 works fine

    Firefox hangs or crashes when setting iframe src to a pdf via javascript. Works fine in all previous versions of Firefox. This is using the most recent version of Adobe Reader 9.
    == This happened ==
    Every time Firefox opened
    == I upgraded to Firefox 3.6

    More info:
    Seems to be the same issue as this
    [http://support.mozilla.com/en-US/forum/1/585926#threadId622326]
    and this
    [http://support.mozilla.com/en-US/forum/1/585926?forumId=1&comments_threshold=0&comments_parentId=585926&comments_offset=20&comments_per_page=20&thread_style=commentStyle_plain#threadId659555]

  • How to set variables values via VBA.

    Anybody please help.
    How to set variables values via VBA in workbook. SAP Netweaver 2004s.

    Pass variable values with VBA and BI 7.0 funtions to Query
    At first a remark u2013 Iu2019ve read a lot of threads saying that passing values to a query can be done by using VBA code only. Iu2019ve tested it but Iu2019m not sufficient with the new BEX 7.0 API and therefore I use a mixture of BEX 7.0 funtionality and VBA. I create a BEX 7.0 design item button passing the values to a query u2013 I hide this button somewhere on the sheet or on a hidden sheet and I then raise the event to click the button from VBA code. Works fine and the maintenance is easier if something changes in the API in the future again.
    How to start:
    Switch to design mode in BEX Analyzer:
    Implement a BEX 7.0 design item u201Cbuttonu201D
    Click on the button to implement the properties
    Make the input for the commands
    data_provider = dataprovider_1
    cmd = process_variables
    subcmd = var_submit
    No comes the part with the variables u2013 Letu2019s assume a query has 4 variables but you only want to change 1 with the button u2013 an organizational unit for instance.
    Make a range somewhere in the excel with the following structure:
    Name    Index   Value
    VAR_NAME_1      1       Variablename
    VAR_VALUE_EXT_1 1       variablevalue
    Value should contain the name of your variable of course and u201Cvalueu201D the value of your variable
    Set a name for this range with EXCEL functionality but without the header:
    Back to the properties of the button: Insert the name of the range with the variables in the field Command Range:
    If you have more variables to process you can of course enhance your Filterrange!
    In the left upper Corner you have a name for your button:
    Now you can raise the button-click in vba like this:
    Application.Run "'" & ThisWorkbook.Name & "'!Sheet2.BUTTON_35_Click"
    regards, Lars

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

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

  • How to get elements in a multi-value field via javascript?

    The following will set variables.variable1 to variables.variable2 when the "Script Link" component is clicked...
    <Field>
    <Display class='Javascript'>
    <String>
    function myScript() {
    el=getElement(document.mainform,"variables.variable1");
    el2=getElement(document.mainform,"variables.variable2");
    el.value=el2.value;
    </String>
    </Display>
    </Field>
    <Field name='Script Link'>
    <Display class='Link'>
    <Property name='URL'>
    <String>javascript:myScript();submitCommand(document.mainform,%20'Recalculate');</String>
    </Property>
    </Display>
    </Field>
    My issue is, if variables.variabl2 is a list / multivalued, i get errors trying to traverse through the "array".
    How can i read and set an a list element via javascript function above? I've tried things like get() , and variables.variable2[0] .
    any help would be appreciated....
    is there an API somewhere i can reference?

    Hi,
    thanks for your reply!
    If I have the parameters in the URL and use the method GET it works all right.
    but I need the method to be POST. I suppose, I have the wrong way identifying the parameter name
    This is from VB
    varTarget = "http://localhost:9090/gm/getData" ' getData is my servlet
    xmlSendStr = "SQLStmt=SELECT TCPD_Cars.* From TCPD_Cars WHERE (((TCPD_Cars.CarIdent)=45));"
        xmlHttp.Open "POST", varTarget, True   'True means asynchronous
        xmlHttp.Send xmlSendStrthis is part of my Servlet
         protected void doPost(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              response.setContentType("text/html");
              PrintWriter writer  = response.getWriter();
              String SQLStmt = request.getParameter("SQLStmt") ;
            //make the database query and get the returns
            writer.println(GetSQLData(SQLStmt));
            //close the write
            writer.close();                    
         }I would appreciate any suggestions

  • Using Spry Data Set Variable in Recordset

    I have a page that contains a spry data set and a recordset. The recordset uses one of the variables from the spry data set to filter its results. how do I apply the spry data set variable to the recordset?

    I believe passing this the variable through the URL requires you to update the page, right?
    Yes
    Is there anyway to grab the spry data set variable direct and apply it to your recordset filter?
    The SpryDataSet variable can only be used on the clientside (JavaScript) so you will have to get your recordset using JS.
    A page refresh can be set in motion if you add {useCache: false, loadInterval: 500} to your dataset to then set an observer to your dataset to invoke the page refreash function.
    Gramps

  • 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 can I add a watermark via JavaScript that includes the current datestamp?

    Part of my daily work process here is to scan in a huge stack of inbound mail. I then OCR the scans, delete the blank pages, and add a watermark. I've got a batch process set up for the first two steps, but I can't make a watermark for the datestamp itself and need to do so via JavaScript, but I have a luddite-level understanding of it.
    As of right now, these are my settings I'm using to add the datestamp:
    What I want to do is run a script to do the same thing and insert the current date where I have mm-dd-yy currently, but I don't have the first clue of where to start. Any help you could offer would be hugely appreciated

    You can use the doc.addWatermarkFromText() method as a JavaScript step in an Action.
    for example
    var dt = new Date();
    var stoday = (dt.getMonth() + 1) + '-' + dt.getDate() + '-' + dt.getFullYear();
    this.addWatermarkFromText({
    cText: "Deposit\r" + stoday,
    nTextAlign: app.constants.align.right,
    nHorizAlign: app.constants.align.right,
    nVertAlign: app.constants.align.top,
    nHorizValue: -72, nVertValue: -72
    See the SDK Help files for information on what all the parameters do.

  • 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

  • Uploading a File with AppleScript via JavaScript

    Hi everybody,
    being new to AppleScripting and JavaScripting I'm faced with the following problem:
    Is it possible to make AppleScript to input the path for a file to be uploaded via JavaScript? If yes, what should be the correct Path Format and how to wrap it up the JavaScript action into AppleScript? I've tried a few comands but to no success.
    On the webpage in question, there's a "Choose" button, that is defined as follows:
    <input type=​"file" class=​"gwt-FileUpload" name=​"swfFile">​
    I've been trying to use the following syntax:
    do JavaScript "document.getElementsByName('swfFile')[0].value('Macintosh HD:Users:myaccount:Desktop:Scrapbook:!动画.swf')" in document 1
    as well as this one, where the Path is definitelly understood by shellscript:
    do JavaScript "document.getElementsByName('swfFile')[0].value('/Users/myaccount/Desktop/Scrap book/!动画.swf')" in document 1
    The name of the file is (and must remain) in chinese, but for testing purposes I have also tried files with english names, without success.
    Currently I'm using a solution with JavaScript comand:
    do JavaScript "document.getElementsByName('swfFile')[0].click()" in document 1
    to click the finder  window to browse for the file, and manipulating  keystrokes by using System Events to find the right file, but it's not  infallible with a number of files and it's hardly an ellegant sollution.
    Any idea what I'm doing wrong?
    Cheers!

    @twtwtw
    the do JavaScript "document.forms[0].submit()" command didn't work, so I kept the original way of submitting by clicking the button. The submitting part works, but not the input file part.
    That's the code I used
        tell application "Safari"
            do JavaScript "document.getElementById('gwt-uid-13').value='on'" in document 1
            do JavaScript "document.forms[0].elements['swfFile'].value=" & "'" & SWFFilePath & "'" in document 1
            do JavaScript "document.getElementsByClassName('gwt-SubmitButton')[0].click()" in document 1  
            delay 1
        end tell
    with SWFFilePath set as the POSIX path as well as the default file format
    Macintosh HD:Users:myaccount:Desktop:Scrapbook:!动画.swf'
    but it did not work.
    If you've got the time, feel free to upload an .swf. The service is free and the server delats uploaded files after 15 min. (if you don't have any, you may try an empty .txt file instead - it won't get converted, but the point is just to get it into the input box).
    In the meantime, I'll have a look at adayzdone's suggestion. It's not perfect (the downside being that it requires the window to be active, so I can't run the script in the background or with my screensaver & password on), but it's still more reliable than my sollution with navigating arrowkeyes.

Maybe you are looking for

  • Itunes will not launch at all

    For a few weeks I've been having a problem with iTunes taking a long time to open, and sometimes not opening when I plug in the phone.  Last week I realized  just stopped opening at all - even by double clicking on the itunes exe file in Control Pane

  • Ultra 10 problems

    ok this is a add on from "ultra 10 not displaying anything on monitor" Ive got the problem down to being either the motherboard or the power unit.. Ive got it to this because when i managed to continue installing solaris 10 i recieved a post message

  • How do you position side by side tables so they print correctly on separate sheets?

    How do you position side by side tables so they print correctly on separate sheets?

  • Integrating Typekit fonts into BC Blogs and News

    Hi guys, Wondering what is the best way of integrating Typekit fonts into the BC Blog and News modules - more so on the layout/details of blogs and news. I can easily do it on my website when I add the blog & news modules, but CSS overrides, but when

  • A puzzled export question of Flash CS4

    I have a picture A and picture B,A is 100pix*50pix,B is 20pix*80pix,then I set document size is 100pix*50pix,and put picture A as background,then I put picture B at the right of picture A,and make B move from bottom to top,I make preview,it runs well