We help IT Professionals succeed at work.

JAVA script code Modification

atwork2003
atwork2003 asked
on
265 Views
Last Modified: 2010-05-18
Hi
I am trying to display the result set that I get back from this code to be displayed in an Alert Box Instead of a Table which it was previously doing. Can some one please modify this code so I can do that.
Thank you


function getColumnValues(){
  getElement('filterValueList').options.length = 0;
  var oid = getElement('currentViewId').value;
  var ot = getElement('objectName').innerHTML;
  var soid = getElement('filterColumns').value.split(/[\.:]/)[0];
  if (soid == null || soid == '') {
   
    return;
  }
  var filter = 'ot=' + ot + '&ua=Values&oid=' + oid + '&soid=' + soid;
  document.finishLoading = finishGetFilterColumnValues;
  loadDynamicData(filter);
}

function finishGetFilterColumnValues(responseDoc,generatedValues){
  document.finishLoading = null;
  if (document.getElementById('confirmationMessage').value == '1') {
    var soid = responseDoc.location.href.match(/soid=([^&#]*)/i)[1];
    var currentSoid = getElement('filterColumns').value.split(/[\.:]/)[0];
    if(soid != currentSoid)
      return;
    savedColumnValues[soid] = generatedValues;
    addSelectOptions(getElement('filterValueList'),generatedValues,false,false);
  }
}
Comment
Watch Question

Software Engineer
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
on click of a button a table is filled with values from a table in the database. so this dataloader is getting values from the database to be loaded in that table. these are the filter values that are related to the column values selected.
Thanks

Author

Commented:
The solution u gave me is not working can u please let me know another way of doing this. Also the script after" Return" actually display the result of the code. So if you can some how change it to display the result in alert box that will be really nice.

Thank you
HonorGodSoftware Engineer
CERTIFIED EXPERT

Commented:
When you say "table", are you talking about an HTML table?
Or a database table?
Or something else (like a javascript array)?

In order for the code above to work, the data is expected to
be in an array.  For example:
----------------------------------------------------------------------
<html>
<head>
<title>DisplayArray example</title>
</head>
<body>
<script type="text/javascript">
  function DisplayArray( name, data ) {
    var result = name + "[", comma = "";
    for ( var i = 0; i < data.length; ++i ) {
      result += comma + data[ i ];
      comma = ", ";
    }
    alert( result + "]" );
  }

  var info = [ 1, 2, 3, 4, 5 ];
  DisplayArray( "info", info );
</script>
</body>
</html>
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.