Ignore:
Timestamp:
Jan 29, 2010, 6:08:49 PM (9 years ago)
Author:
jahn
Message:

Updated editing of Events. RemoteFunction? calls work. Still needs cleaning up (but its Friday evening).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/studycapturing/EventDescriptionController.groovy

    r123 r150  
    4747
    4848    def showMyProtocol = {
     49        println params  // dbg, remove
    4950
    50         def protocol = ( params.protocol) ?  Protocol.get(params.protocol) : Protocol.find("for Protocol id")
    51         def description = EventDescription.get(params.id)
    52         def protocolInstance = description.protocol
     51        def protocol = ( params.protocolid) ?  Protocol.get(params.protocolid) : Protocol.find("for Protocol id")
     52        def event = Event.get(params.id)
     53        def protocolInstance = event.eventDescription.protocol
    5354
    5455        println params
     56        println event
    5557        println protocol
    56         println description
    5758        println protocolInstance
    5859
    59 
    60         if( protocol.id==protocolInstance.protocol.id ) {
    61             println "redner this FILLED rubish"
    62             println protocolInstance
    63             println "the fuck?"
    64             render( view:"showMyProtocolFilled", model:["protocolInstance":protocolInstance] )
     60        if( protocolInstance && protocolInstance && protocol.id==protocolInstance.id ) {
     61            def parameterStringValues = event.parameterStringValues
     62            println parameterStringValues
     63            print "showFull"
     64            render( view:"showMyProtocolFilled", model:["protocolInstance":protocolInstance,"event":event,"parameterStringValues":parameterStringValues] )
    6565        }
    6666        else {
    67             println "redner this EMPTY rubish"
    68             render( view: "showMyProtocolEmpty", model:[protocol:protocol] )
    69             //render( view:"showMyProtocolEmpty", model:[protocol:protocol] )
     67            print "showEmpty"
     68            if(protocol!=null) render( view: "showMyProtocolEmpty", model:["protocolInstance":protocol] )
     69            else               render( "NULL" )
    7070        }
    7171}
     
    131131
    132132
    133     /* Jahn - For development only
    134      * Create one dummy instance of EventDescription */
    135     def createDummies =
    136     {
    137          def newInstance = new EventDescription()
    138          newInstance.name = "dummmy name"
    139          newInstance.description = "dummmy description"
    140          newInstance.protocol = ProtocolInstance.find("from ProtocolInstance p ")
    141          newInstance.classification = Term.find("from Term t")
    142 
    143          if( newInstance.save() )
    144               { redirect( action:show, id: newInstance.id ) }
    145          else { chain( action:list ) }
    146     }
    147 
    148 
    149     def test = { render("test") }
     133    def test = { println "test"
     134            render("test") }
    150135}
Note: See TracChangeset for help on using the changeset viewer.