Passing java parameter to javascript function in oa framework

hi all,
can anybody tell how to pass parameter to javascript function from java for example
OAMessageTextInputBean txtbean = (OAMessageTextInputBean)webBean.findChildRecursive("BuyerPrice");
String row = "rowid";
txtbean.setOnKeyUp("javascript:checkNumber("+row+")");
checknumber is javascript function defined .

Hi,
go through http://forum.java.sun.com/thread.jspa?threadID=174157&messageID=539357
if ur requirement is just to pass a string to a JS function.
Thanks

Similar Messages

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

  • Can i write java code in JavaScript function

    I want to call JavaBeans within JavaScript function. Can I do it?
    I have a button in JSP . When the button be clicked,the data be inputted will be checked by JavaScript function. If check is ok, then call a Bean's function to write the data to database.
    Please Help!

    well indeed u can write java code in javascript functions. But probably it will not work the way u want it to.
    when u say that u click a button, it means that some client side action is performed. Now if u wud require a java bean to be called then it means that the server needs to be contacted for the same, and if that has to be done, necessarily the form needs to be submitted.
    U can populate values from a java bean and then the same can be made available to a javascript variable / function when the page is loaded rather than, when the button is clicked.
    What u can do is on click of button u can process [display / calulate..etc ] the information which has already been got by the java bean.
    Kris

  • Pass a Java Bean into Javascript function.

    Good day. Please help urgent :
    I am trying to pass an instance of MyBean class into a javascript function
    This code is added to the form.
         private String getJavaScriptForLaunchNewComponent()
              StringBuffer sb = new StringBuffer();
              sb.append("<SCRIPT language='JavaScript'>");
              sb.append("    function testFunction(zBean) { ");
              sb.append("popAssetWinSpecs = \"left=250,top=250,width=300,height=300,scrollbars=no,toolbar=no,menubar=no,resizable=no,status=no,titlebar=no,location=no\";");
    sb.append("htmlfile=\"/irj/servlet/prt/portal/prtroot/com.roche.mss.pdf.comp.PDFLauncher?zBean=\"+zBean;");
    sb.append("window.open(htmlfile,\"editWindow\",popAssetWinSpecs);");
    sb.append("return false;");
    sb.append("    }");
    sb.append("</SCRIPT>");
    return sb.toString();
    This code is set in the create component meth
         private Component buildLink(){
              GridLayout grid = new GridLayout(1,1);
              grid.setCellSpacing(5);
              TestBean zBean = new TestBean();
              zBean.setValue("Me Now");
              Link link = new Link("myLink");
              link.addText("Print PDF");
              link.setOnClientClick("testFunction("+zBean +")");
              grid.addComponent(1,1,link);
              return grid;
    Is this possible ????
    Thanks.

    solved it. Thanks

  • Access Java Array in Javascript function

    Hi, could someone please help me, I have an array that gets populated in java code and I need to see it in a javascript function.
    Here's what I have so far:
    //In java class for AvgCostChart.jsp
    private String[] month;
    public String[] getMonth()
    {//code to populate
    return month;}
    Then in my javascript onLoad function I try to access it. I know how to access the values one at a time like this.
    var month1='#{AvgCostChart.month[0]}';
    But how do I pass this to a function.
    I tried assigning to to another array to loop through the values like this:
    var myArr = new Array();
    myArr'#{AvgCostChart.month}';
    alert (myArr[0]);
    But that does not work, any one done this before.
    I've also tried saving it in the session and then accessing it but can't get that to work either.
    Any help will be greatly appreciated.

    Hi,
    Please go through the following thread:
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=60147
    Hope this helps
    Cheers
    Girish

  • Pass bound value to Javascript function

    I'm working in JDeveloper 10.1.2. I'm working on an application generating JSPs for the UI. I display an HTML table using a databound control from the data control pallette. The last column in the table is a button for each row. The user should be able to click a row's button and have a popup window display a page showing a table of detailed info on the the record in the html table row selected.
    Basically I want to pass the id/key for the row to a javascript function using the onclick event of the button. Here is my first attempt:
    <input type="button" onclick="popupDetail(<c:out value="${Row['AuditSeqid']}"/>)"/>
    The compiler barfed on the c:out tag. I don't know if it would even perform the subsitution correctly. The compiler seems to think the double quote starting the value attribute is ending the onclick event descriptor. Escaping with \" just brought up different errors.
    Can anyone recommend a way to pass a bound column's value from a rowset into a javascript function as a parameter?
    Thanks for any help you can give. I'm totally new to JDeveloper. This would be easy in simple JSPs, but with the Oracle data binding, I don't know what tags/objects are available from which I can grab the value.

    Found the solution:
    <td>
    <input type="button" name="detailsButton" value="Details" onClick="javascript:popupDetail('<c:out value="${Row['AuditSeqid']}" />');"/>
    </td>

  • How to pass java arraylist into javascript arrays

    Hi, i have declare an arraylist
    ArrayList list1 = new ArrayList();Inside the arraylist, there are elements. Now, i wan to pass the elements in the java arraylist into javascript arrays but i encounter javascript errors.
    This is how i code.
    var arr1 = new Array();
    <%
    for ( int x =0; x<list1.size(); x++)
    %>
         arr1[<%=x%>] = <%=(String)list1.get(x)%>;
    <%
    %>how do i solve this problem?
    Thanks for the guidance in advance

    JTech wrote:
    Hi,
    Use Quotes around string value ( arr1[indexposition] = "stringvalue";), when assign to javascript array as below.
    arr1[<%=x%>] = "<%=(String)list1.get(x)%>"; Regards,
    Ram.Hi Ram,
    How about using arr1 = <%=list.toArray()%> ??? Is this possible? I tried it but was not working on my IDE. Do you have any solutions for this??
    Regards,
    Thiagu

  • Problem in passing varchar2 parameter to Evaluate function in OBIEE

    Hi there,
    This is regarding an issue while passing parameter in EVALUATE function.
    I have to call a function with varchar parameters. parameter are nothing but my table column values.
    I've created session variables which holds value from my table column values.
    for eg:
    EVALUATE('REP1_FIRSTMONTH_F(%1)' AS  CHARACTER ( 30 ),  VALUEOF  (NQ_SESSION."month"))
    so whenever i call function using EVALUATE in OBIEE. i hve to pass ' ' (single quotes) for my varchar values. without this , i'm facing error stating :
    *State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 59015] The requested column PERIOD0 does not exist in this table. (HY000)*
    If i'll give parameter within single quotes in my dashboard prompt. it is working fine, but fails without the quotes.
    kindly help me in solving this issue.
    Thanks - Vijay
    NOTE: parameter are from column values.

    Hi
    Anyone has any input for the above issue??. Please share.
    Regards - Vijay

  • Pass session parameter with javascript

    H� all?
    I have strange problem...
    I connect some database and take some data in JSP page and after I set these data to session values and I open anothewr JSP page by using javascript window.open() method. By the way I lost session parameter in second JSP page opened by window.open();
    // Here the codes...
    there is a button in my first JSP on Click event : calling Talep_Read1() Javascript function.. This function is below.... Bu I heard about: JSP and javascript works different times...
    function talep_Read1(){
    deg = "<%=abr_kd%>";
    if( deg== "0" || deg == "9"){
    var URL = "/METSIS/talep_read.jsp;jsessionid=<%=session.getId()%>";
    newWin = window.open(URL,'SelWnd','menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=no,width=800,height=600');
    newWin.focus();
    }else{
    var URL = "/METSIS/Detay_Read2.jsp;jsessionid=<%=session.getId()%>";
    newWin = window.open(URL,'SelWnd','menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=no,width=800,height=600');
    newWin.focus();
    HOw can solve this prob...?
    Open the second page I lost session parameter but I refresh the this page session parameter is seeen
    What is the problem please helpp::
    Thanks.

    Should be:
    var URL = "/METSIS/Detay_Read2.jsp?jsessionid=<%=session.getId()%>";

  • Access Java code in Javascript function

    hi all,
    i have a requirement where i need to access a method defined in a plain java class from a javascript function.
    can anyone please let me know, who can i achieve this.
    thanks in advance

    I have a hyperlink in a JSP, onclick of this, i need to perform two tasks:
    (1) the page should be redirected to the same page.
    (2) excute a function which actually defines code to run a perl script.
    so i have wrapped the function in a class and trying to call this function in the javascript function.
    now i am not sure will this work.
    so if there are any other alternatives to achieve this, please share.

  • Pass a para to javascript function

    In a jsp page, a javascript function needs to get a parameter from a variable of the jsp page. How can I do this? Thanks a lot!
    ---a.jsp---
    <SCRIPT language=JavaScript>
    function changeR(userID){
    alert( userID + " chaged a value " );
    </SCRIPT>
    <% userID = "user1" %>
    <form>
    <input type="button" value="bbbb" onclick="changeR(userID)"> <!--it doesn't work this way-->
    </form>
    How should I write this part?
    onclick="changeR(??????)"

    <%! String userID=""; %>
    <html>
    <head>
    <script type="text/javascript">
    function changeR(userID){
    alert( userID + " chaged a value." );     // this line doesn't work.
    alert( "alert" );          // even this line doesn't work either.
    </script>
    </head>
    <body>
    <% userID = "user1"; %>
    <form>
    <input type="button" value="<%= userID %>" onclick="changeR(<%= userID %>)"> <!--it doesn't work this way-->
    <input type="button" value="userID" onclick="changeR(userID)"> <!--it doesn't work this way-->
    </form>
    </body>
    </html>
    This is the sample jsp page. There are two ways tried (two buttons), none of them works. :(
    When the first button is pushed, there's no response.
    When the second button is pushed, the status bar shows "Script Error!".

  • Is it necessary to pass RETURN parameter in bapi function module

    Hai All,
                Is it necessary to pass structure to RETURN parameter in bapi_transaction_rollback function module. If it is not necessary then how can it gives return value. Please give me the answer for this one. some sample code below...
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
    IMPORTING
       RETURN        = i_return.
            LOOP AT i_return into wa_return WHERE type EQ c_error.
              wa1_out-postdoc = wa_return-message.
            ENDLOOP.
    Thanks & Regards.
    Laxman.P

    hi
    bapi should never throw an error as it might be called for mass data proceessing
    and it is prefferred not to hault the proceess bcoz of one or two errors.
    that's why the error or success messages are caught and returned in return table.
    in bapi_transaction_rollback the return parameter is not necessary as it will work without that as well.
    the purpose of rollback bapi is just to undo whatever done before that.
    regards
    vijay
    <b>reward points if helpful</b>
    Message was edited by:
            vijay sharma

  • How to pass jsp array to javascript function()

    function delete(var arr[][])
    out.print(arr[1][2]);
    <%String [][] arra=new String[1][2];
    %>
    <select name="" onClick="delete(<%=arra%>)">
    <option>fvfvfdfdfddffdd</option>
    </select>

    Thanks again for constant support .Now , here comes my real problem .
    I'm having a listbox . I need to find out how to get the values selected in a JSP variable .
    Like I'm having names of cities in listbox .When , I click on save button , i need the names of selected cities in JSP variable or an array .
    <html>
    <head>
    <script language="JavaScript">
         function show(acl)
              for(var i=0;i<4;i++)
                   if(acl.aclnames.options.selected)
                        // i don't know what to put here
              alert("in show");
    </script>
    </head>
    <body>
    <form name="acl" method="post">
    <select name="aclnames" multiple="true" size="3">
    <option>Ahmedabad</option>
    <option>Baroda</option>
    <option>Surat</option>
    <option>Rajkot</option>
    </select>
    <input type="button" name="save" value="Save" onClick="show(acl)">
    </form>
    </body>
    </html>

  • Passing the parameter in the Function module MESSAGE_SEND_AS_MAIL

    Hi all,
    I have to send the same message to five different mail ID's using the Function module MESSAGE_SEND_AS_MAIL
    How to pass this five mail ID's in the Parameter Reciever of the Function module
    Regards
    Ajay

    see if this helps
    REPORT  Z_MESSAGE.
    data receiv type standard table of SOMLRECI1 initial size 0.
    data wa type SOMLRECI1.
    wa-receiver = 'email address in caps'.
    wa-REC_TYPE = 'U'.
    append wa to receiv.
    wa-receiver = 'email address in caps'.
    wa-REC_TYPE = 'U'.
    append wa to receiv.
    do so more more three
    CALL FUNCTION 'MESSAGE_SEND_AS_MAIL'
      EXPORTING
        msgid           = 'Z_ZZZ_CA_MESSAGES'
        msgno           = '000'
       MSGV1           = 'material'
       MSGV2           = 'MAT'
       MSGV3           = 'MM'
       MSGV4           = 'MMM'
      tables
        receivers       = receiv[]
              COMMIT WORK AND WAIT.
    then u can go to SOST transaction and see that the mail has been or is yet to be sent. It worked for me. The message comes in an PDF form to the mail box.
    Edited by: Biswadeep Ghosh on Jun 25, 2008 2:28 PM
    Edited by: Biswadeep Ghosh on Jun 25, 2008 2:30 PM

  • Passing a parameter to a function via an alias

    Hi all,
    Is it possible to pass a fixed value to a function from a alias?
    For example say you have a function which opens a web browser and that function accepts a parameter for the URL that you want the browser to load. You can then just call the function and pass the URL across. This will then load the browser with the specified
    URL.
    What I want to try and do is create an alias called openMS. This alias would call the function and pass the url microsoft.com across. I could then create multiple aliases for opening various pages and use just one function.
    I've had a bit of a search but can't seem to find anything so not sure if what I'm trying to do is possible.
    Thanks
    Peter

    You can't do that with an alias, but you can just write another function to accomplish that. The "help" and "mkdir" functions are examples of this technique in the built-in PowerShell commands. "help" pipes Get-Help to more,
    and "mkdir" calls New-Item with a hard-coded parameter of -Type Directory . You can see the code for each of those by typing $function:help and $function:mkdir .

Maybe you are looking for

  • ACH Addenda record

    Hi All, We are using PMW with an ACH CCD format to send the ACH files to our Bank. But certain vendors require us to send ADDENDA record as given below for e.g.  in the ACH payments 705ISA00NV 00NV ZZNV ZZNV 09100615300010000001 Can we enter this inf

  • Use of/effect of compression markers in Compressor 4...

    I have a question about the effect of compression markers in Compressor 4.  I know they are used to mark areas where you want compression lessened so that the video looks better (like action scenes or fast camera movement). I just worked through a Co

  • Error in Data Loading - 0Base_UOM

    Hi all, I hv received an error while loading data in BW MM-INV cube. Error is .. Record1 : Error Calling number range object 0Base_UOM dimension DU (). System is picking UOM as NO while it is NOS in R/3 up to extract structure. While rest of UOM syst

  • Upgraded to version 10.4 how do I view files in old library

    I upgraded to new version and it auto synched my ipod- somewhere I lost all but Christmas music- nice, but not in July.  I am hoping one of the library backups has the missing music- how do I open them to check the contents without plugging in touch

  • How do I get CS5 Bridge to open instead of CS3?

    When I upgraded Photoshop to CS5 I had to do it by upgrading my CS2 version because my CS3 version was part of the creative suite package.  When I open Bridge, I don't get the CS5 version, I get the CS3 version and the two are definitely different.