Changeset 242

Show
Ignore:
Timestamp:
08-03-10 01:10:54 (4 years ago)
Author:
jahn
Message:

Functionality of dynamic protocol parameter selection improved further. Added delete buttons to dynamic dialog. The buttons remove options. The view does now cover all required specifications with an Ajax based model that requires relatively little communication between the client and the server.

Points of action:
(1) Clean up code and move JS into seperate file to be included with the according Grails tag.
(2) Custom buttons.
(3) Dialog box warning when changing option names.

Location:
trunk/grails-app/views/eventDescription
Files:
2 modified

Legend:

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

    r241 r242  
    7979                            <g:if test="!editExisting"> 
    8080                                <td valign="top" class="name"> <label> This is a sampling event</label> </td> 
    81                                 <td>  <INPUT TYPE="checkbox" NAME="isSampleCheckBox" VALUE="checkboxValue"> </td> 
     81                                <td>  <INPUT TYPE="checkbox" NAME="isSample" VALUE="true"> </td> 
    8282                            </g:if> 
    8383                            <g:else> 
  • trunk/grails-app/views/eventDescription/showMyProtocolFilled.gsp

    r241 r242  
    104104        var id = tbody.rows.length + 1; 
    105105        input.setAttribute('name','parameterStringValue__new'+id+'__protocol__'+rowId); 
    106         tbody.insertRow(-1).insertCell(-1).appendChild(input); 
     106        var tr=document.createElement('tr'); 
     107        tr.insertCell(-1).appendChild(input); 
     108        tbody.appendChild(tr); 
     109        var button=document.createElement('input'); 
     110        button.type='button'; 
     111        button.value='delete'; 
     112        button.onclick=function(){jQuery(tr).remove()}; 
     113        tr.insertCell(-1).appendChild(button); 
    107114  } 
    108115 
     
    130137         input.value=unescape(options[i]); 
    131138         input.name='parameterStringValue__'+options[i+1]+'__protocol__'+rowId; 
    132          tbody.insertRow(-1).insertCell(-1).appendChild(input); 
     139         var tr=document.createElement('tr'); 
     140         tbody.appendChild(tr); 
     141         tr.insertCell(-1).appendChild(input); 
     142         var button=document.createElement('input'); 
     143         button.type='button'; 
     144         button.value='delete'; 
     145         button.onclick=function(){jQuery(tr).remove()}; 
     146         tr.insertCell(-1).appendChild(button); 
    133147     } 
    134148 
     
    243257<tr class="prop"> 
    244258    <td id='test'>  Protocol </td> 
    245     <td> <g:select name="selectedProtocol" from="${dbnp.studycapturing.Protocol.list()}" value="${protocol}" optionKey="id"   optionValue="name" 
     259    <td> <g:select name="protocol" from="${dbnp.studycapturing.Protocol.list()}" value="${protocol}" optionKey="id"   optionValue="name" 
    246260                   onchange= "${remoteFunction( action:'showProtocolParameters', update:'showProtocolParameters', params:'\'id=\'+this.value' )}; deleteHiddenDialogs();" /> 
    247261    </td>