MultiChoice Input Example ========================= Location: ``examples/webapp/multichoice/`` This example demonstrates the ```` input type -- a checkbox list where multiple options can be selected simultaneously. tool.xml -------- .. code-block:: xml multichoice (rappture2web) python3 @tool/multichoice.py @driver Choose the countries to analyze. Zimbabwe Script ------ .. code-block:: python import sys import rappture2web.rp_library as Rappture rx = Rappture.PyXml(sys.argv[1]) choice = rx['input.multichoice(countries).current'].value rx['output.string(outs).about.label'] = 'Echo of multichoice' rx['output.string(outs).current'] = 'Selected countries: %s' % choice rx.close() Key concepts ------------ - Multiple selections are returned as a comma-separated string of values. - Like ````, each option can have a ```` that differs from its ``