Changeset 7388


Ignore:
Timestamp:
26/08/10 15:29:45 (9 years ago)
Author:
astephen
Message:

More work on UI aspects of dynamic arguments.

Location:
cows_wps/trunk/cows_wps
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • cows_wps/trunk/cows_wps/public/js/ui/submit_utils.js

    r7387 r7388  
    6262} 
    6363 
     64 
     65function callWPSToUpdateForm() { 
     66        var resp = new WPSResponse(); 
     67        resp.callWPS("http://ceda-wps1.badc.rl.ac.uk/wps?Request=Execute&Format=text/xml&Identifier=ListPPFileHeader&Store=false&Status=false&DataInputs=FilePath,/disks/kona1/cwps-test-data/africa-lam/prods_op_afr_20100813_18.006pp"); 
     68} 
     69 
    6470/*  
    6571 function updateForm: 
    6672   * updates the form by making an AJAX request to WPS or other service and parsing XML 
    6773*/  
    68 function updateForm() { 
    69         // Call WPS and return response 
    70         var resp = new WPSResponse();  
    71         var dct = resp.response_dict; 
     74function updateForm(response_dict) { 
     75        var dct = response_dict; 
    7276 
    7377        for (var key in dct) { 
     
    7680 
    7781                var new_values = dct[key]; 
    78 alert(new_values.length); 
     82 
    7983                for (var i = 0; i < new_values.length; i++) { 
    8084                        var opt = document.createElement("option"); 
     
    8488                        elem.appendChild(opt); 
    8589                } 
    86 /* 
    87                                 for (var i = 0; i < this.option_ids.length; i++) { 
    88                         var opt_id = this.option_ids[i]; 
    89                         var opt_name = this.option_names[i] 
    90  
    91                         var opt = this._createElement(opt_id, opt_name, "option"); 
    92                         var opt = document.createElement("option"); 
    93                         opt.setAttribute("value", opt_id); 
    94                         opt.appendChild(document.createTextNode(opt_name)); 
    95  
    96                         // Now add the option to the select input 
    97                         sel.appendChild(opt); 
    98                 } 
    99                  
    100                 alert(key); 
    101 */ 
    10290        } 
    10391}        
  • cows_wps/trunk/cows_wps/renderer/proc_config_renderer.py

    r7387 r7388  
    231231 
    232232        if triggers_present != []: 
    233             resp += '<input type="button" id="update" name="update" value="Update form" onClick="updateForm();" />' 
     233            resp += '<input type="button" id="update" name="update" value="Update form" onClick="callWPSToUpdateForm();" />' 
    234234 
    235235        resp += '<input type="submit" value="Submit" /> Click this button when you are happy with your selections.</td></table>\n</form>\n'  
Note: See TracChangeset for help on using the changeset viewer.