SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatInputControl
└─SwatOptionControl
└─SwatCheckboxList
└─SwatCheckboxEntryList
public class SwatCheckboxEntryList
extends SwatCheckboxList
| Field Summary | |
|---|---|
| string | An optional title to display above the column of entry widgets. |
| integer | An optional maximum length to apply to entry widgets. |
| integer | The size of all the embedded entry widgets. |
| protected array | The entry widgets used by this checkbox entry list. |
| Fields inherited from Swat.SwatCheckboxList | |
|---|---|
| columns, show_check_all, values | |
| Fields inherited from Swat.SwatOptionControl | |
|---|---|
| options, serialize_values | |
| Fields inherited from Swat.SwatInputControl | |
|---|---|
| required | |
| Constructor Summary | |
|---|---|
SwatCheckboxEntryList(string id) Creates a new checkbox entry list. |
|
| Method Summary | |
|---|---|
| protected SwatEntry | createEntryWidget(string option_value) Creates an entry widget of this checkbox entry list. |
| void | display() Displays this checkbox list. |
| protected array | Gets the array of CSS classes that are applied to this checkbox entry list. |
| string | getEntryValue(string option_value) Gets the value of an entry widget in this checkbox entry list. |
| protected SwatContainer | getEntryWidget(string option_value) Gets a widget tree for the entry widget of this checkbox entry list. |
| protected string | Gets the inline JavaScript for this checkbox entry list. |
| array | Gets all messages. |
| protected boolean | hasEntryWidget(string option_value) Checks if this checkbox entry list has an entry widget for a given option value. |
| boolean | Checks for the presence of messages. |
| void | process() Processes this checkbox entry list. |
| void | setEntryValue(string option_value, string entry_value) Sets the value of an entry widget in this checkbox entry list. |
| void | setEntryValuesByArray(array entry_values) Sets the values of multiple entry widgets. |
| Methods inherited from Swat.SwatCheckboxList | |
|---|---|
| createCompositeWidgets, display, displayOption, getCSSClassNames, getInlineJavaScript, getLiTag, getState, init, process, processValues, reset, setState | |
| Methods inherited from Swat.SwatOptionControl | |
|---|---|
| addOption, addOptionsByArray, getOption, getOptions, getOptionsByValue, removeOption, removeOptionsByValue | |
| Methods inherited from Swat.SwatInputControl | |
|---|---|
| getForm, init | |
| Methods inherited from Swat.SwatControl | |
|---|---|
| addMessage, getNote, printWidgetTree | |
| Methods inherited from Swat.SwatWidget | |
|---|---|
| addCompositeWidget, addMessage, confirmCompositeWidgets, copy, createCompositeWidgets, display, displayHtmlHeadEntries, getCSSClassNames, getCompositeWidget, getCompositeWidgets, getFocusableHtmlId, getHtmlHeadEntrySet, getMessages, hasMessage, init, isDisplayed, isInitialized, isProcessed, isSensitive, printWidgetTree, process, replaceWithContainer | |
| Methods inherited from Swat.SwatUIObject | |
|---|---|
| addComment, addJavaScript, addStyleSheet, addTangoAttribution, copy, getCSSClassNames, getCSSClassString, getFirstAncestor, getHtmlHeadEntrySet, getInlineJavaScript, getUniqueId, isVisible | |
public string $entry_column_title = null
An optional title to display above the column of entry widgets
public integer $entry_maxlength = null
An optional maximum length to apply to entry widgets
public integer $entry_size = 30
The size of all the embedded entry widgets
protected array $entry_widgets = array()
The entry widgets used by this checkbox entry list
This array is indexed by option values of this checkbox entry list.
public SwatCheckboxEntryList(string id)
Creates a new checkbox entry list
id - a non-visible unique id for this widget.protected SwatEntry createEntryWidget(string option_value)
Creates an entry widget of this checkbox entry list
Subclasses may override this method to create a different widget type.
option_value - the value of the option for which to get the entry widget.public void display()
Displays this checkbox list
protected array getCSSClassNames()
Gets the array of CSS classes that are applied to this checkbox entry list
public string getEntryValue(string option_value)
Gets the value of an entry widget in this checkbox entry list
option_value - used to indentify the entry widgetprotected SwatContainer getEntryWidget(string option_value)
Gets a widget tree for the entry widget of this checkbox entry list
This is used internally to create the widget tree containing a
SwatEntry widget for display and processing.
option_value - the value of the option for which to get the entry widget. If no entry widget exists for the given option value, one is created.protected string getInlineJavaScript()
Gets the inline JavaScript for this checkbox entry list
public array getMessages()
Gets all messages
protected boolean hasEntryWidget(string option_value)
Checks if this checkbox entry list has an entry widget for a given option value
option_value - the value of the option to check.public boolean hasMessage()
Checks for the presence of messages
public void process()
Processes this checkbox entry list
Processes the checkboxes as well as each entry widget for each checked checkbox. The entry widgets for unchecked checkboxes are not processed.
public void setEntryValue(string option_value, string entry_value)
Sets the value of an entry widget in this checkbox entry list
option_value - the value of the option for which to set the entry widget value.entry_value - the value to set on the entry widget.public void setEntryValuesByArray(array entry_values)
Sets the values of multiple entry widgets
This is a convenience method to quickly set the entry values for one
or more options in this checkbox entry list. This calls
SwatCheckboxEntryList::setEntryValue() internally for each
entry in the $entry_values array.
entry_values - an array indexed by option values of this checkbox entry list with values of the entry widget values.
A checkbox list widget with entries per option
This widget can be used both to select multiple items from a list of options and to submit an associated text field with each selected option.
Selecting options works just like a normal checkbox list. Accessing the associated text field is done using the
SwatCheckboxEntryList::getEntryValue()andSwatCheckboxEntryList::setEntryValue()methods. For setting large numbers of text fields (during initialization, for example) use theSwatCheckboxEntryList::setEntryValuesByArray()method.