Commits

Mohana Ramaratnam  committed 31f59e9

Added check for single selection

  • Participants
  • Parent commits 036c74f

Comments (0)

Files changed (1)

File plugin-resources/webapp/xnat/java/org/nrg/xnat/turbine/modules/actions/ManagePipeline.java

 			String name = data.getParameters().get("param[" + i + "].name");
 			int rowcount = new Integer(data.getParameters().get("param[" + i + "].name.rowcount")).intValue();
 			ArrayList<String> formvalues = new ArrayList<String>();
-			if (rowcount == 1) {
-				String value = data.getParameters().get("param[" + i + "][0].value");
-				formvalues.add(value);
-			}else if (rowcount>1) {
-				for (int j=0; j < rowcount; j++) {
-					String formfieldname = "param[" + i + "][" + j + "].value";
-					if (TurbineUtils.HasPassedParameter(formfieldname,data))
-					   formvalues.add(data.getParameters().get(formfieldname));
-				}
+			for (int j=0; j < rowcount; j++) {
+				String formfieldname = "param[" + i + "][" + j + "].value";
+				if (TurbineUtils.HasPassedParameter(formfieldname,data))
+				   formvalues.add(data.getParameters().get(formfieldname));
 			}
+
 			if (formvalues.size()>0) {
 				ParameterData param = parameters.addNewParameter();
 				param.setName(name);
 					values.setUnique(formvalues.get(0));
 				}else {
 					Values values = param.addNewValues();
-					for (int k=0; k<rowcount; k++) {
+					for (int k=0; k<formvalues.size(); k++) {
 						values.addList(formvalues.get(k));
 					}
 				}
 		return parameters;
 	}
 
+
 	private String saveParameters(String rootpath, String fileName, Parameters parameters) throws Exception{
         File dir = new File(rootpath);
         if (!dir.exists()) dir.mkdirs();