Changeset 1445 for trunk/grails-app
- Timestamp:
- Jan 27, 2011, 1:43:36 PM (10 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/studycapturing/AssayController.groovy
r1440 r1445 141 141 Assay assay = Assay.get(params.assayId) 142 142 143 // check if assay exists 143 144 if (!assay) { 144 145 flash.errorMessage = "No assay found with id: $params.assayId." … … 159 160 } catch (Exception e) { 160 161 161 flash.errorMessage = e. toString()162 flash.errorMessage = e.cause?.message ?: e.message 162 163 redirect action: 'selectAssay' 163 164 -
trunk/grails-app/views/assay/selectAssay.gsp
r1430 r1445 14 14 function updateAssay(jsonData, selectID) { 15 15 var a = eval(jsonData); 16 var sel = $('#'+selectID).empty() 16 var sel = $('#'+selectID).empty(); 17 17 18 18 $(a).each(function(i, el){ 19 sel.append($("<option></option>").attr("value",el.id).text(el.name)) ;20 }) ;19 sel.append($("<option></option>").attr("value",el.id).text(el.name)) 20 }) 21 21 } 22 23 $(document).ready(function(){ 24 // trigger change event to load assay based on currently selected study. 25 // After pressing 'Back', the browser may use last selected study. 26 $('#study').change() 27 28 }) 22 29 </script> 23 30 </head> … … 27 34 </div> 28 35 <g:form name="assaySelect" action="exportAssayAsExcel"> 29 <g:select optionKey="id" optionValue="title" name="studyId" from="${userStudies}" 30 onChange="${remoteFunction(controller:'study',action:'ajaxGetAssays',params:'\'id=\'+escape(this.value)',onComplete: 'updateAssay(XMLHttpRequest.responseText, \'assay\')')}"/> 31 <g:select optionKey="id" name="assayId" id="assay" from="${assays}"/> 36 <g:select optionKey="id" optionValue="title" name="studyId" from="${userStudies}" id="study" 37 onChange="${remoteFunction(controller:'study',action:'ajaxGetAssays',params:'\'id=\'+escape(this.value)',onComplete: 'updateAssay(XMLHttpRequest.responseText, \'assay\')')}"/> 38 <g:select optionKey="id" name="assayId" id="assay" from=""/> 39 %{--<g:select optionKey="id" name="assayId" id="assay" from="${assays}"/>--}% 32 40 <g:submitButton name="submit" value="Submit"/> 33 41 </g:form>
Note: See TracChangeset
for help on using the changeset viewer.