Custom Renderer to Change Checkbox/Multi-Select Choice

0
Resource Type: 
OSP Form

This is a simple OSP form with a custom renderer that changes the way that OSP chooses whether to display checkboxes or a multi-select box. It would also change the same choice between radio button and a single select box. By default, checkboxes and radio buttons are used when there are fewer than 5 items in an enumeration. (The choice between checkboxes and radio buttons depends on whether there can be more than one selection. For example, maxOccurs=1 gives radio buttons for fewer than 5 items, but a single select list for more than 5 items.)

The custom renderer, formCreate-checkbox.xsl, imports the system file formCreate.xslt, which in turn includes the system file formFieldTemplate.xslt. There is a template in formFieldTemplate.xsl that defines a variable which determines the cutoff for displaying radio buttons or checkboxes. That template is named select-field, and the variable is htmldeterm. The custom renderer overrides the template and sets htmldeterm to 16.

Screenshot: 
custom renderer to set htmldeterm
AttachmentSize
Custom Renderer to Set htmldeterm Form.zip2.71 KB