# HG changeset patch # User Sebastian Kruse # Date 1362664056 -3600 # Node ID ed444173aef072a6eb2f0501b55fc129ec489430 # Parent 108c853e090092fb5a0766fb6efad772140814c0 local CSV loading diff -r 108c853e0900 -r ed444173aef0 src/econnect/wp3_3/client/core/ApplicationGrid.java --- a/src/econnect/wp3_3/client/core/ApplicationGrid.java Thu Mar 07 14:35:30 2013 +0100 +++ b/src/econnect/wp3_3/client/core/ApplicationGrid.java Thu Mar 07 14:47:36 2013 +0100 @@ -182,6 +182,10 @@ //skruse: The element will be accessed by its ID in the JS code //either don't change this name, or change it also in STICore.js uploadKML.getElement().setId("localKMLFileChooser"); + final FileUpload uploadCSV = new FileUpload(); + //skruse: The element will be accessed by its ID in the JS code + //either don't change this name, or change it also in STICore.js + uploadCSV.getElement().setId("localCSVFileChooser"); for( int i=0; i 0){ + var file = filelist[0]; + + var reader = new FileReader(); + + reader.onloadend = (function(theFile) { + return function(e) { + status.innerHTML = "Parsing Data ..."; + + var kmlText = core.convertCsv(reader.result); + + var localkmlDoc; + try { + localkmlDoc = $.parseXML(kmlText); + } catch (e) { + alert("KML file is not valid XML. Please check opening/closing tags and check the spelling."); + + core.unblockUI(); + + return; + } + + setTimeout( function(){ core.parseIt(localkmlDoc,filename,ds); }, 1 ); + }; + })(file); + + reader.readAsText(file); + } + + return; + }, + + /** * parses the kml-file which includes the results for a given search request * * @param {File}