Error in Dynamic Value Change Using Java script

Hi ,
I am trying to put dynamic value sin tabular form report.
I used the below code
function updateLOV3(filter, listName,itemId,po_no){
var xml = null;
var list = document.getElementById(listName);
  var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=Update_Invoice_UOM',0);
alert(po_no);
alert(itemId);
get.add('TEMPORARY_ITEM', po_no);
get.add('TEMP_ITEM', itemId);
alert(list);
ret = get.get('XML');
if(ret){
  var s = ret.getElementsByTagName("select");
  if(s){
   var o = ret.getElementsByTagName("option");
   oCount = o.length;
   if(oCount!='0'){
        var l_Opt_Xml = o[0];
        appendToSelect(list, l_Opt_Xml.firstChild.nodeValue);
if(oCount=='0'){
alert('entering');
   list.value=0;
get = null;
function appendToSelect(pSelect,pContent) {
alert(pContent);
pSelect.value=pContent;
}my Application Process code is
declare
begin
owa_util.mime_header('text/xml', FALSE );
htp.p('Cache-Control: no-cache');
htp.p('Pragma: no-cache');
owa_util.http_header_close;
htp.prn('<data>');
htp.prn('<select>');
for rec in (SELECT UNIT_OF_MEASURE r ,UNIT_OF_MEASURE d FROM HOMES_RGP_PURCHASE_ORDER_LINES WHERE ITEM_ID = :TEMP_ITEM AND
PURCHASE_ORDER_ID = :TEMPORARY_ITEM)
loop
htp.prn('<option value="' || rec.d || '">' || rec.r || '</option>');
end loop;
htp.prn('</select>');
htp.prn('</data>');
end;In my application process if i removed the PURCHASE_ORDER_ID = :TEMPORARY_ITEM then the value is coming.
Java Script giving both values like item id and purchase order id.
If i ran the sql query manually its giving values.
i hope thers is some error in get.add method in java script.
Its always going into the below condition
if(oCount=='0'){
alert('entering');
   list.value=0;
get = null;but manually i have checked the database the value is present.
Please anyone help me out in this.
Regards,
Shan...

Hi all,
The same i have checked with emp table but still i got the same problem.
Its my application process
declare
begin
owa_util.mime_header('text/xml', FALSE );
htp.p('Cache-Control: no-cache');
htp.p('Pragma: no-cache');
owa_util.http_header_close;
htp.prn('<data>');
htp.prn('<select>');
for rec in (SELECT ename r,ename d FROM 
emp
WHERE  empno = :TEMP_ITEM)
loop
htp.prn('<option value="' || rec.d || '">' || rec.r || '</option>');
end loop;
htp.prn('</select>');
htp.prn('</data>');
end;My Javascript code is
<script type="text/javascript">
function setvalues(itemId,list)
var s = $v(itemId);
alert(s);
var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=POPULATE_EMPNAME',0);
get.add('TEMP_ITEM', s);
ret = get.get('XML');
if(ret){
  var s = ret.getElementsByTagName("select");
  if(s){
   var o = ret.getElementsByTagName("option");
   oCount = o.length;
   if(oCount!='0'){
        var l_Opt_Xml = o[0];
        appendToSelect(list, l_Opt_Xml.firstChild.nodeValue);
if(oCount=='0'){
   list.value=0;
get = null;
function appendToSelect(pSelect,pContent) {
pSelect.value=pContent;
</script>Can anyone suggest me what i have missed???
Cheers,
Shan

Similar Messages

  • Acrobat standard 9.0 error while enabling commets option using Java script object

    I'm using the below java script code in my VB 6.0 application for enabling commets options in the PDF file
    Dim oJSO As Object
    Set oJSO = mPDDoc.GetJSObject
    oJSO.Collab.showAnnotToolsWhenNoCollab = True
    It is working fine till Acrobat 8.0. Now I'm trying with Acrobat 9.0 standard edition, it is throwing scripting error 'An unhandled Win32 exception occured in Acrobat.exe[308].
    Can anyone suggest the way to enable 'comment' options in Acrobat Standard 9.0 using Java Script Object?
    Thanks

    I get much the same problem with VB6, Acrobat 9 Pro and WinXP SP3. When I single step the line:
    oJSO.Collab.showAnnotToolsWhenNoCollab = True
    in debug I go to the error handler for my Sub. Inspecting the VB Err object has Number = -2147417851 and Description = "Automation error
    The server threw an exception." I get a Microsoft crash notice about Acrobat a short while later.
    I've experimented with the JavaScript debugger in Acrobat and you can execute Collab.showAnnotToolsWhenNoCollab = True and reference the value of Collab.showAnnotToolsWhenNoCollab in the console. The problem appears only when accessing Acrobat Javascript through the Interapplication Communication API.
    If anyone can help it would be appreciated. I tried Adobe's Acrobat support and they were no help at all.

  • Unable to read values populated using Java Script

    hi Experts,
    we generated a BSP Page through some SPRO setting it contains HTML and ABAP scripts.
    in that we have 2 select - option - dropdowns. i first one is being populated by ABAP script. second one is being populated by java script.
    the BSP page is working fine. but i am unable to read the second dropdown value using a class method
    we call this class method in the BADI : CRM_SERVICE_WEBREQ. method : FORM_ON_EVENT
      CALL METHOD cl_uxs_xml_services=>get_value_via_xpath
      EXPORTING
        ir_node                   = ir_form_data
        id_xpath                  = 'secondChoice'
         id_xpath_namespace_uri    =
         id_xpath_namespace_prefix =
         id_multi_namespace        =
      RECEIVING
        rd_value                  = lv_value
      EXCEPTIONS
        not_found                 = 1
        not_unique                = 2
        OTHERS                    = 3
    but i am able to read other fields in the page. i am not sure but i changed the id and name on the second drop down.
    pls let me know how to read the value for second drop down.

    Hi Ben Grice,
    ASP.NET questions should be post in
    ASP.NET forums. You can get better help there.
    Thanks for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Need to compare html text area values by using java script

    I have one html text area in my JSP file. when i click on that text area, a pop-up will come, in that pop-up i have list of items. So after selecting a item from that pop-up list, need to click okay. so that text area will update with the selected value.
    In this case, i need to compare the first text area value and updated text area value. How can i do that in Java Script.

    I suggest you look for a Javascript forum to ask questions about Javascript. This is a Java forum.

  • How to pass values to variables in WAD 7.0 using java script

    Hi.,
    My requirement is based on WAD 7.0.
    The sales value has to displayed in WAD using graph with various chart types.
    I have created variables for plant and material group in a query.
    I have created drop down box for plant with all plants in it, check box for material group and a Submit button in WAD in FORM tag of HTML coding.
    Once all the values are set in drop down box, checkbox and if the user clicks on submit button, the values has to captured by the variables for which I have created and the graph has to be aligned to the new values in variables.
    Kindly help me how to use java script to get the values from FORM and pass it to variables.
    Regards,
    Selva

    Hi Selva,
    You do not need to use Javascript for this. Instead you can achieve this by using API Commands in WAD 7.0.
    Please configure Action on the ButtonGroup webitem to use 'Commands'.
    ->Choose Command 'Set Variables Values / SET_VARIABLES_STATE' under Commands for Web Templates
    ->Set Display Variable Screen setting to OFF
    ->Choose Query Variable for Plant, Select Variable Type as 'Binding Type', Binding Type as 'Data Provider Selection', Data Provider as the one you have assigned to the Dropdown webitem, Characteristic as 0PLANT or as that assigned to the Dropdown webitem
    ->Repeat above steps for Query Variable Material Group
    Now when you make a selection from the Dropdown webitems, the Chart output will change accordingly. Let me know if this helps.
    --Priya

  • Read, Modify and Apply Report XML using Java Script

    Hi Guys,
    Is there any way that we can Pragmatically Read, Modify and Apply Report XML using Java Script or some other way.
    Thanks
    Kaushik
    Edited by: Kaushik K on Jun 20, 2012 8:36 PM

    Requirement ::
    Users should be able to add Column to the Report Dynamically at Runtime.
    (There are around 1000+ Users, Answers Approach is not acceptable)
    So we are planning to provide a Multi Select / Shuttle Box Option for Users to add Columns dynamically. (Only for Table View)
    What we planned to DO ::
    Create a Presentation Variable Prompt, Which reads the Metadata Table (Presentation Table.Column Name, populated using the Metadata Dictionary)
    And Create a report with One Column and the Column Fx like @{var_dynamic_columns}{'"Time"."Year","Time"."Month"'}
    With this, OBIEE is rewriting the Logical SQL Currently as "Select "Time"."Year","Time"."Month" from "A - Sample Sales" "
    But getting an error
    The number of columns returned in retrieving column metadata was invalid (expected: 1; received: 2)
    So we want to see, if we can rewrite the Advanced XML of the Report to have dynamic columns based on the Values from the Presentation Variable.
    Please help me if this is a viable solution or any other better solution.

  • How to  build a  Calculator in WAB Template  by using  Java Script......

    Hi ,
    I am  trying   to build a dynamic  calculator in WAD which is as  similar to one in Executive view in Cognos. The  problem i am  facing  is,  i can  able to build a normal  calculator  by using  java script  but  i am  unable  to read the  key figure  values from  the  analysis  item  on from the  data  provider  in to  by  calculator  by using  on click  function. I wanted  to get the all  the  values in to a internal excel , so  that  my calculator can read the  values from  that. can  any  one  help  me  on getting  values in to internal excel by using   java before the  executing the  web template ?...
    Thanks in advance....
    Jhon.
    Edited by: sap bw on Jul 31, 2008 5:51 PM
    Edited by: sap bw on Jul 31, 2008 5:52 PM

    I might not be understanding your question completely since you mention WAD and then Excel, but if you are asking how to get the key figure values using Javascript in WAD, you can go to the Dataprovider properties and enable 'Output Result Data'.  This will embed an XML element into the HTML output that you can then parse using standard Javascript DOM navigation.
    Hope this helps.

  • Read Text file using Java Script

    Hi,
    I am trying to read a text file using Java Script within the webroot of MII as .HTML file. I have provided the path as below but where I am not able to open the file. Any clue to provide the relative path or any changes required on the below path ?
    var FileOpener = new ActiveXObject("Scripting.FileSystemObject");
    var FilePointer = FileOpener.OpenTextFile("E:\\usr\\sap\\MID\\J00\\j2ee\\cluster\\apps\\sap.com\\xapps~xmii~ear\\servlet_jsp\\XMII\\root\\CM\\OCTAL\\TestTV\\Test.txt", 1, true);
    FileContents = FilePointer.ReadAll(); // we can use FilePointer.ReadAll() to read all the lines
    The Error Log shows as :
    Path not found
    Regards,
    Mohamed

    Hi Mohamed,
    I tried above code after importing JQuery Library through script Tag. It worked for me . Pls check.
    Note : You can place Jquery1.xx.xx.js file in the same folder where you saved this IRPT/HTML file.
    <HTML>
    <HEAD>
        <TITLE>Your Title Here</TITLE>
        <SCRIPT type="text/javascript" src="jquery-1.9.1.js"></SCRIPT>
        <script language="javascript">
    function Read()
    $.get( "http://ldcimfb.wdf.sap.corp:50100/XMII/CM/Regression_15.0/CrossTab.txt", function( data ) {
      $(".result").html(data);
      alert(data);
    // The file content is available in this variable "data"
    </script>
    </HEAD>
    <BODY onLoad="Read()">
    </BODY>
    </HTML>

  • Binding of JSF componenent using java script

    Hi friends,
    How can we set the "ID" and "Binding" property of JSF Tag( <ui:textfield>) using java script?
    Sample Code:
    <ui:script>
    var name="xyz";
    var value="abc";
    </ui:script>
    <ui:textField id="'+name+'" binding="#{bean.dataMap['+value+']}"/>
    When i try to run the above code, there is no compilation and run time error. But the id which assigned to TextField is '+name+' as a string rather than "xyz".
    How can we overcome the below problem? Please guide me?

    The binding and the id attributes are server side. You cannot set them via javascript

  • How to pass parameters to a page invoked using java script.--- Very Urgent.

    Hello,
    I have an advanced Table in my page. In the first column there is a
    messageChoice. In the second column there is link item.On the link item i have set the following value for destination uri.
    javascript:var a=window.open('OA.jsp?page=/AutoSales/oracle/apps/per/auto/webui/AutoSurrogatesPG&retainAM=Y','a','height=500,width=900,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbar=yes'); a.focus();
    The user selects a value from the message choice and when he clicks on the link item, the value selected from the list should go to the new page invoked using java script as a parameter. I need the value selected from choice to generates few fields in the new page. I have preferred java script because i need the base page and a model window should open. I have tried using setForwardUrl() and setting '_blank' and new window for target frame property on the link item. But it isnt working. The new page is opening in the same window.
    I have also tried putting the value in a session.
    Please help with any kind of suggestions or solutions.
    Thank you.

    Uma,
    You need to
    - Have a PPR Action on the messageChoice (this would trigger a form submit to populate the underlying View Attribute)
    - Either
    - Retrive the value from the View Attribute in the pop-up page (as I could see that you are retaining the AM)
    - Use a SPEL in the link (on the modal page) to use the value from the View Attribute as the parameter value (in the form ${oa.current.<ViewAttributeName>)
    HTH

  • Display pop ups in the jsp by using Java script

    Hi
    can any body say ,how to display pop ups in the jsp by using Java script ?

    that's correct. You can use the below code for AJAX request.
    <script type="text/javascript">
    var httpObject = getHTTPObject();
    //create XMLHttpRequest object
    function getHTTPObject() {     
         var xmlhttp;
         if (window.XMLHttpRequest) // if Mozilla, Safari etc
              xmlhttp = new XMLHttpRequest();
         else if (window.ActiveXObject){ // if IE
              try {
                   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
              catch ( e ){
                   try{
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                   catch ( e ){}
         return xmlhttp;
    //define the function to send the request
    function sendRequest(){
        var currDesc = document.getElementById("description").value;
        var URL =  "manageMaintAction.do"; //action mapping in your struts-config
        var queryString = "currDesc="+escape(currDesc); //get the currDesc value in your action class like request.getParameter("currDesc")
        httpObject.open( "Post", URL, true );
        httpObject.onreadystatechange = cbFn;
        httpObject.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded");
        httpObject.send(queryString);
    //callback fn
    function cbFn() {
        if (httpObject.readyState == 4)
             if (httpObject.status == 200)
              var result = httpObject.responseText;
              alert(result);
    </script>

  • As i am fresher Please share the doc of ECMA script using java script in SharePoint 2013 also how we can insert,update,delete records in list using ECMA script.

    As i am fresher Please share the doc of ECMA script using java script in SharePoint 2013 step by step also how we can insert,update,delete records in list using ECMA script.
    Thanks and Regards, Rangnath Mali

    Hi,
    According to your post, my understanding is that you want to use JavaScript to work with SharePoint list.
    To create list items, we can create a ListItemCreationInformation object, set its properties, and pass it as parameter to the addItem(parameters) function
    of the List object.
    To set list item properties, we can use a column indexer to make an assignment, and call the update() function so that changes will take effect when you callexecuteQueryAsync(succeededCallback,
    failedCallback). 
    And to delete a list item, call the deleteObject() function on the object. 
    There is an MSDN article about the details steps of this topic, you can have a look at it.
    How to: Create, Update, and Delete List Items Using JavaScript
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Adobe Form : detect page break using java script

    Hi,
    How can we detect a page break at a runtime using java script? I need to display a data in internal table at header and unique for a document number. i've 10 order list which has multiple items, each of the orders are printed in a new page and i wanted to know this event using a java script which could help me to add some additional logic at header.....pls can someone help on this?

    Hello Prabhu,
         From your doubt, what I understand is that, You have designed a header in Master Page. You need to fill this header using the Item table which is already designed in the design view(body page). Means you want to fill the Item details(which are in body page) into the header(which is in the master page).
    To read the contents from body page into master page, you need to write Javascript code on the header fields(which is in the master page) in the Layout Ready Event.
    For example, if you want to fill the field Order_description in header(master page) from the column Order_Description which is in the Item table(body page)
    In the form layout, select the order_description field and in the event READY LAYOUT write the below JavaScript code.
    var currpage = xfa.layout.page(this);------> Get the current page
    var fields = 0;------> Variable to store the number of fields in that page.
    fields = xfa.layout.pageContent(currpage-1, "field", 0); ------> Get the number of fields
    for ( i=0; i<= fields.length-1; i++ ) ------> Loop on each field on the page
        if ( fields.name == "ORDER_DESCRIPTION" ) ------> Check if the corresponding field is in the Item table
             this.rawValue = fields.item(i).rawValue; ------> Assign that value in the Header field
    Repeat the same steps for other fields in the Header. This will work for all Purchase Orders spanned across multiple pages.

  • How can I get selected EXCEL area using java script office API (v 1.0)

    Hello everyone,
    I need to get values of specified area in an excel sheet using java Script Office API. For an example,
    A1:A7 row load into array using JS. 

    And you posted to a C++ forum, not a JavaScript or Excel forum.... why? 
    Visual C++ MVP

  • How to generate Serial numbers using JAVA SCRIPT

    how to generate serial numbers(incrementing by 1) using JAVA SCRIPT
    thanking you,
    pola pradeep

    i am afraid that whether ur looking for this. bcoz its a simple for loop
    <script language="JavaScript">
    //count = limit value for u
    for(i=0;i<count;++i){
         alert(i);
    </script>
    or if ur looking for something else, pls mention ur requrment precisely
    aleena

Maybe you are looking for