We help IT Professionals succeed at work.

JAVA script code Modification

atwork2003
atwork2003 asked
on
271 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:
This one is on us!
(Get your first solution completely free - 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>

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

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