Currently, I have implemented a dropdown menu that supports single selection dropdown for a specific assessor in assessor edit page. Upon submission, the selected value is stored and displayed on the report page.
I would like to extend this functionality to support multi-selection. When multiple values are selected on the edit page and submitted, all selected values should be saved and subsequently displayed on the report page.
On the report page, the selected values should be presented as a comma-separated list, for example:
Incomplete segmentation1, Incomplete segmentation1.
How can I modify my current implementation to support this multi-select behavior?
Current working code with single selection dropdown
XDATScreen_edit_sm_brainExtraction.vm
#set($errorCodeValues = [
["Incomplete segmentation1","Incomplete segmentation1"],
["Incomplete segmentation2","Incomplete segmentation2
"],
])
<TR><TD>ErrorCodeComments</TD><TD>#cndaSelectBoxSimple("sm:brainExtraction/validation/errorcode" $item $errorCodeValues $vr)</TD></TR>
XDATScreen_report_sm_brainExtraction.vm
<tr><th>ErrorCodeComments: </th><td>$!item.getStringProperty("sm:brainExtraction/validation/errorcode")</td></tr>
schema file
sm.xsd
<xs:complexType name="brainExtraction">
<xs:complexContent>
<xs:extension base="xnat:imageAssessorData">
<xs:sequence>
<xs:element name="t1" type="xs:string" use="optional"/>
<xs:element name="validation" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="errorcode" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>