Ciao a tutti!
mi chiedevo come si potesse stampare un arraylist con javascript...
per essere più chiari ho una pagina che ottiene (attraverso struts) un arraylist Documenti che a sua volta contiene un arraylist ListaTag.
Sono riuscito a passare i valori di ogni documento ad una funzione javascript chiamata openWindow che apre un popup e visualizza i dati che gli passo...Sono riuscito a far visualizzare i dati passati come stringhe e ora vorrei fare un ciclo che mi visualizzasse i valori dell arrayList ListaTag (ogni elemento dell aaraylist,chiamato Tag ha due varibili stringa nome e valore)
per chiarezza ecco il codice della funzione:
codice:
function openWindow(nome,tipo,rocchio,example,bayes,data,Taglist) {
alert ('sono nella openWindow');
my_window = window.open("success.jsp", "mywindow1", "status=1,width=350,height=150");
my_window.document.write('<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>');
my_window.document.write('<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>');
my_window.document.write('<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>');
my_window.document.write('<html> <head>');
my_window.document.write('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">');
my_window.document.write('<link rel="stylesheet" type="text/css" href="css/style_final.css" />');
my_window.document.write('<title>File Download</title>');
my_window.document.write('</head>');
my_window.document.write('<body style="background: white ">');
my_window.document.write('<div>');
my_window.document.write('<div style="float: left;">');
my_window.document.write('[img]immagini/Doc_logo.png[/img]');
my_window.document.write('</div>');
my_window.document.write('<div style="float: left;">');
my_window.document.write('<h1><bean:message key="label.Document_info" /></h1>
');
my_window.document.write('<bean:message key="label.nome_file" /> '+nome+'
');
my_window.document.write('<bean:message key="label.TipoFileUpload" /> '+tipo+'
');
my_window.document.write('<bean:message key="label.data_caricamento" />'+data+'
');
my_window.document.write('<h1><bean:message key="label.Document_Classifier" /> </h1>
');
my_window.document.write('Rocchio: '+rocchio+'
');
my_window.document.write('Example: '+example+'
');
my_window.document.write('Bayes : '+bayes+'
');
my_window.document.write('<h1><bean:message key="label.Document_meta" /> </h1>
');
my_window.document.write('</div>');
my_window.document.write('</div>');
my_window.document.write('</body>');
my_window.document.write('</html>');
}
</script>
qualcuno sa come posso fare?
grazie in anticipo!