A list editor is a component that allows users to add strings to a list. It is configured using the <list-editor> element. This component has an input area that allows a user to input a string value and buttons on the side for adding or removing items in the list.
To add a value to the list box, the user enters a value into the input component and clicks the "+" button. A user removes a value from the list by selecting one or more items on the list and clicking the "-" button.
The list editor widget currently supports default values and enforces a minimum and maximum number of items in the list. Unlike other components, there may be more than one <default> element. Each default element will add another item to the list.
To add/delete/modify a list box
<component id="zip_code_list"> <description>List of ZIP Codes</description> <list-editor> <default>84043</default> <default>30052</default> <minimum>1</minimum> <maximum>5</maximum> <regex>^\d{5}$</regex> </list-editor> </component>
<component id="licenses"> <description>Software Licenses</description> <list-editor> <select-value>Matlab</select-value> <select-value>NetSuite</select-value> <select-value>Tomcat</select-value> <select-value>Windows Server 2008</select-value> <select-value>Microsoft Office 2010</select-value> <select-value>Adobe Acrobat 9</select-value> </list-editor> </component>
<component id="storage-list"> <composite-list-editor> <add-text>Add Storage</add-text> <api-value> <calculate operation="append-in-order"> <value order="1"> <component id="storage-amount" /> </value> <value order="2">:</value> <value order="3"> <component id="storage-type" /> </value> <value order="4">@</value> <value order="5"> <component id="storage-location" /> </value> </calculate> </api-value> <display-value> <calculate operation="append-in-order"> <value order="1"> <component id="storage-amount" /> </value> <value order="2"> units of type </value> <value order="3"> <component id="storage-type" /> </value> <value order="4"> at </value> <value order="5"> <component id="storage-location" /> </value> </calculate> </display-value> </composite-list-editor> </component>
A description is not required for this component. However, if one is specified, it will be placed in the upper left section of the widget:
Related topics
© 2012 Adaptive Computing