Ignore:
Timestamp:
Feb 12, 2010, 7:56:06 PM (10 years ago)
Author:
jahn
Message:

Sample selection of the query controller: added buttons for subgroup selection, controller changes for passing on subselections, and some JS for selecting the checkboxes. The actual function of the checkboxes has to be clearified. When I check only subject, should the parent subject also be ticked? Or should it be the other way round? Plenty needs to be done in this step of the query still.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/SearchableController.groovy

    r193 r196  
    2121 * Basic web interface for Grails Searchable Plugin
    2222 *
    23  * @author Maurice Nicholson
     23 * @author Adem and Jahn
    2424 */
    2525class SearchableController {
     
    2828    def selectsample = {
    2929
     30            println "in selectsample: "
     31            params.each{println it}
     32
     33            // prepare showing all studies selected in the previous view
     34            def selectedStudies = []
     35            def selectedStudyIds = params['selectedStudyIds']
     36
     37            if(selectedStudyIds!=null)
     38            {
     39                 def list = selectedStudyIds.findAll(/(\d)+/)
     40                 selectedStudies = list.collect{ dbnp.studycapturing.Study.get(it) }
     41            }
     42            else
     43            {
     44                 def tmpList = []
     45                 def studyList = dbnp.studycapturing.Study.list()
     46                 selectedStudyIds = []
     47                 params.each{ key,values->
     48                     if (values=="on")  tmpList.add(key)
     49                 }
     50
     51                 for (i in studyList)
     52                     if (tmpList.contains(i.getId().toString()))
     53                     {
     54                         selectedStudyIds.add(i.id)
     55                         selectedStudies.add(i)
     56                     }
     57           }
     58
     59
     60
     61        // subgroups
     62        // provide list of subgroups depending on the type of subgrouping
     63        // selected by the user
     64        def subgroups = []
     65        def submitButton = params["submit"]  // this button's value determines the kind of subgrouping
     66
     67        switch(submitButton)
     68        {
     69             case "Subject Groups":
     70                  render(params)
     71                  render("Subject Groups")
     72                  subgroups=["subject group 1","subject group 2"]
     73                  render(view:"selectsample",model:[selectedStudies:selectedStudies,selectedStudyIds:selectedStudyIds,subgroups:subgroups])
     74                  break
     75             case "Event Groups":
     76                  render("Event Groups")
     77                  subgroups=["event group 1","event group 2"]
     78                  render(view:"selectsample",model:[selectedStudies:selectedStudies,selectedStudyIds:selectedStudyIds,subgroups:subgroups])
     79                  break
     80             case "Starting Time Groups":
     81                  render("Starting Time Groups")
     82                  subgroups=["time group 1","time group 2"]
     83                  render(view:"selectsample",model:[selectedStudies:selectedStudies,selectedStudyIds:selectedStudyIds,subgroups:subgroups])
     84                  break
     85             case ">> Execute and continue with biomarker selection":
     86                  render("Starting Time Groups")
     87                  break
     88             case "<< Back to study selection":
     89                  break
     90        }
     91        render(view:"selectsample",model:[selectedStudies:selectedStudies,selectedStudyIds:selectedStudyIds,subgroups:subgroups])
    3092    }
     93
     94
     95
    3196    /**
    3297     * Index page with search form and results
     
    60125        render("unindexAll done")
    61126    }
     127
     128
     129    def subjectGroups = { render ("hello") }
     130
     131
    62132}
Note: See TracChangeset for help on using the changeset viewer.