Changeset 249

Show
Ignore:
Timestamp:
09-03-10 00:03:22 (4 years ago)
Author:
jahn
Message:

Made controller for saving action used by create and edit. Still needs to be tested and debugged as well as adapted for the eaiser create case. Code needs to be cleaned up!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/eventDescription/showMyProtocolFilled.gsp

    r247 r249  
    1010<% dbnp.studycapturing.ProtocolParameterType.list().each{ print "parametertypes.push(\'${it}\');" } %> 
    1111 
     12 
    1213/* create a prefix for all members of a protocol */ 
    1314function setName(element,protocolId) { 
    14     element.name='protocolId_'+protocolId+'_'+element.id; 
     15    element.name='row_'+protocolId+'__'+element.id; 
    1516} 
     17 
    1618 
    1719function addRowEmpty(id){ 
     
    2022    row.setAttribute('id','new' + (newRows++) ); 
    2123 
    22     addTextFieldToRow(row,'classification',20); addTextFieldToRow(row,'unit',6); 
     24    addTextFieldToRow(row,'name',20); addTextFieldToRow(row,'unit',6); 
    2325    var textField=addSelector(row,null,[]); addTextFieldToRow(row,'reference',10); addTextFieldToRow(row,'description',20); 
    2426    addElementToRow(row,textField,'option',6); addRowButton(row); tbody.appendChild(row); 
     
    3234    row.setAttribute('id',newId); 
    3335 
    34     addTextFieldToRow(row,'classification',20).value=name; 
     36    addTextFieldToRow(row,'name',20).value=name; 
    3537    addTextFieldToRow(row,'unit',6).value=unit; 
    3638    var textField=addSelector(row,type,options); 
     
    103105        var input=document.createElement('input'); 
    104106        var id = tbody.rows.length + 1; 
    105         input.setAttribute('name','parameterStringValue__new'+id+'__protocol__'+rowId); 
     107        input.setAttribute('name','row_'+rowId+'__parameterStringValue__new'+id); 
    106108        var tr=document.createElement('tr'); 
    107         tr.id='rowparameterStringValue__new'+id+'__protocol__'+rowId; 
     109        tr.id='row_'+rowId+'parameterStringValue__new'+id; 
    108110        tr.insertCell(-1).appendChild(input); 
    109111        tbody.appendChild(tr); 
     
    137139         var input=document.createElement('input'); 
    138140         input.value=unescape(options[i]); 
    139          input.name='parameterStringValue__'+options[i+1]+'__protocol__'+rowId; 
     141         input.name='row_'+rowId+'__parameterStringValue__'+options[i+1]; 
    140142         var tr=document.createElement('tr'); 
    141          tr.id='rowparameterStringValue__'+options[i+1]+'__protocol__'+rowId; 
     143         tr.id='row_'+rowId+'__parameterStringValue__'+options[i+1]; 
    142144         tbody.appendChild(tr); 
    143145         tr.insertCell(-1).appendChild(input);