Class RadioButtonItem
- All Implemented Interfaces:
Animatable<RadioButtonItem>,CanDrop<RadioButtonItem>,Clickable<RadioButtonItem>,SupportHelpIcon<RadioButtonItem>,Draggable<RadioButtonItem>,Fetchable<RadioButtonItem>,Focusable<RadioButtonItem>,HandleHotKey<RadioButtonItem>,HandleMouseEvents<RadioButtonItem>,BasedOnDataDescriptor<RadioButtonItem>,DifferentDataDisplayValue,Filterable<RadioButtonItem>,Touchable<RadioButtonItem>
Radio button item
With the use of this component, a radio button can be placed on the form. The radio button is used to select only one value from a set of values. Each value has its own radio button. By default, these are displayed under each other, but they can be set to appear next to each other.
The use of the component is only recommended, if the set of values is small, so the radio buttons don't expand the page too much.
The component reads the values automatically from the database, if the related parameters are set, or the values can be loaded with the use of a custom code.
The component is a form item, so it can be placed on, and will be handled by the Form component. The component can be used on its own, but then the developer must
implement event and value handlers.
Supported events:
AnimationStart
AnimationEnd,
Focus
FocusOut
FocusIn
LosesFocus
Click,
DoubleClick,
MouseDown,
MouseDown,
MouseLeave,
MouseMove,
MouseOver,
MouseOut,
MouseUp,
Wheel,
TouchCancel,
TouchEnd,
TouchMove,
TouchStart,
Drop,
DragStart,
DragEnd
HotKey
- Since:
- 4.0
- Author:
- JBStrap
- See Also:
-
Field Summary
Fields inherited from class com.jbstrap.ui.components.form.FormItem
appends, clearButton, column, defaultState, defaultValue, description, formItemSize, helpIcon, label, labelPosition, labelSizes, modified, originalValue, params, prepends, required, showLabel, state, tabIndex, value, visibleFields inherited from class com.jbstrap.ui.Component
animation, attributes, backgroundColor, borderColor, color, defaultHotKeyHandler, handlers, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition -
Constructor Summary
ConstructorsConstructorDescriptionRadioButtonItem(DataDescriptorColumn column) Creates a radio button from the specified DataDescriptor column.RadioButtonItem(DataDescriptorColumn column, String language) Creates a radio button using the specified DataDescriptor column and language code.RadioButtonItem(String name, String label) Creates a radio button with the specified name and label.RadioButtonItem(String name, String label, String language) Creates a radio button with the specified name, label and language code.Creates a radio button with the specified name, label and language code and populates a combobox with the specified value set.Creates a radio button with the specified name and label and populates a combobox with the specified value set. -
Method Summary
Modifier and TypeMethodDescriptionfinal RadioButtonItemaddElement(Object dataValue, Object displayValue) Adds an item to the value set.final RadioButtonItemaddElements(Map<Object, Object> data) Adds multiple items to the value set.voidThe operations to be executed after the drawing of the componentfinal RadioButtonItemclear()Clears the component’s value set and removes all value set items.voiddrawEditor(StringWriter writer) Draws the editor component.This method implements actual data retrieval.final RadioButtonItemGets the value set data from the database.final RadioButtonItemGets value set data from the database, fulfilling the specified filter criterion.final CriteriaGets the filter criterion used to query the component’s value set data from the database.Gets the name of the DataDescriptor column that contains the data values of the value set.Gets the DataDescriptor for the component value set.Gets the DataDescriptor column name containing the displayed value.Gets the names of all DataDescriptor columns that contain the specified value.Gets the separator text for the displayed values.Gets the displayed value for the component’s current value.Gets the displayed value for the component’s original value.getValue()Gets the current value of the component.booleanSets if value set data is automatically queried.booleanisInline()Sets if the value set items are displayed in a single line.voidonShow()The operations to be executed after the component is displayed on the clientfinal RadioButtonItemremoveElement(Object dataValue) Removes an item from the value set if the data value is specified.setAutoFetchData(boolean autoFetch) Sets if the component should automatically query the data for the value set from the database.final RadioButtonItemsetCollator(Collator collator) Sets the collator instance sorting the value set.setCustomFetch(FetchEvent fetchEvent) Sets a custom query.final RadioButtonItemsetDataColumn(String columnName) Sets the name of the DataDescriptor that contains the value set’s data values.final RadioButtonItemsetDataDescriptor(DataDescriptor dataDescriptor) Sets the DataDescriptor for the value set.setDefaultValue(Object defaultValue) Sets the component’s default value.final RadioButtonItemsetDisplayColumn(String columnName) Sets the name of the DataDescriptor column containing the displayed values of the value set.final RadioButtonItemsetDisplayColumns(String... columnNames) Sets the DataDescriptors containing the value set’s displayed values.final RadioButtonItemsetDisplayColumnSeparator(String separator) Sets a text separating the displayed columns.final RadioButtonItemsetFilterCriteria(Criteria criteria) Sets the filter criterion used to query the value set.final RadioButtonItemsetInline(boolean inline) Sets the value set to be displayed in a single line.final RadioButtonItemsetReadOnly(boolean readOnly) Sets the component to read-only.setSort(boolean sort) Sets if the value set is displayed to the user in a sorted fashion.Sets if the value set is displayed to the user in a sorted fashion.Sets the current value of the component.Methods inherited from class com.jbstrap.ui.components.form.FormItem
_addComponent, _setReverseShow, _setState, addComponent, addRecalcOnChangeColumn, addRecalcOnChangeColumns, addRecalcOnChangeColumns, addValueChangeHandler, clearValue, convertValueToJavaScript, convertValueToJavaScript, drawComponent, enableClearButton, eraseValue, getCalculateValue, getColumn, getComponents, getDataType, getDefaultState, getDescription, getFormItemSize, getLabel, getLabelPosition, getLabelSize, getLabelSize, getName, getOriginalValue, getParam, getParamAsBoolean, getParamAsDate, getParamAsDate, getParamAsDouble, getParamAsInteger, getParamAsLong, getParamAsNumber, getParamAsString, getRecalcOnChangeColumnsList, getState, getTabIndex, getValueAsBoolean, getValueAsDate, getValueAsDouble, getValueAsFloat, getValueAsInteger, getValueAsLong, getValueAsString, init, isAssignable, isAutoCalculate, isModified, isReadOnly, isRequired, isReverseShow, isShowLabel, isVisible, onFormItemValueChanged, onHotKeyEventHandler, redraw, removeParam, resetState, runAfterDrawOnAddon, runOnHideOnAddon, runOnShowOnAddon, setCalculateValue, setDataType, setDataType, setDescription, setEnabled, setFocus, setFormItemSize, setLabel, setLabelPosition, setLabelSize, setLabelSize, setMargin, setModified, setObjectValue, setOriginalObjectValue, setOriginalValue, setPadding, setParam, setParams, setRequired, setShowLabel, setState, setTabIndex, setVisible, triggerFormChange, writeHTMLMethods inherited from class com.jbstrap.ui.Component
_hide, _setAttribute, addAllowedRole, addComponent, addComponents, addDeniedRole, addHandler, addStyle, addStyleClass, addStyleClasses, clearfix, closeTag, combinateAccess, containsStyle, containsStyleClass, draw, drawSubComponents, error, flattendComponentTree, getAccess, getAccessMode, getAllowedRoles, getAttribute, getAttributes, getBackgroundColor, getBorderColor, getClient, getComponentById, getComponents, getComponentsByClass, getData, getDeniedRoles, getHandlers, getId, getLanguageCode, getParent, getParent, getRegisteredEvents, getStyle, getStyleClasses, getTextAlign, getTextColor, getToolTip, getToolTipPosition, getTypeName, getUI, insertComponentAfter, insertComponentBefore, isAccess, isDrawn, isEnabled, isEventBubbling, onHide, openTag, removeAllComponents, removeAllowedRole, removeAllStyleClasses, removeAttribute, removeComponent, removeComponent, removeComponents, removeDeniedRole, removeHandler, removeStyle, removeStyle, removeStyleClass, removeStyleClasses, replaceComponent, replaceStyleClass, runAfterDraw, runJavaScript, runJavaScript, runJavaScript, runOnHide, runOnShow, say, setAttribute, setBackgroundColor, setBorder, setBorderColor, setData, setDisplayType, setEventBubbling, setFlex, setFloating, setHeight100, setHeight25, setHeight50, setHeight75, setHeightAuto, setLanguage, setName, setOverflow, setParent, setScrollable, setSelectionType, setShadow, setStyle, setTextAlign, setTextColor, setToolTip, setToolTipPosition, setWidth100, setWidth25, setWidth50, setWidth75, setWidthAuto, showNotification, showNotification, showProcessIndicator, toggleStyleClassMethods inherited from class com.jbstrap.core.messagebus.MessageBus
closeMessageBus, messageBusOpened, openMessageBus, renewSubscription, sendMessageToMessageBus, subscribeMessageBus, unsubscribeAllListeners, unsubscribeMessageBusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jbstrap.ui.Animatable
addAnimationEndHandler, addAnimationStartHandler, getAnimation, removeAnimation, setAnimationMethods inherited from interface com.jbstrap.ui.CanDrop
addDropEventHandlerMethods inherited from interface com.jbstrap.ui.Clickable
addClickHandler, addDoubleClickHandlerMethods inherited from interface com.jbstrap.ui.Draggable
addDragEndEventHandler, addDragStartEventHandler, setDraggableMethods inherited from interface com.jbstrap.ui.Fetchable
addFetchDoneHandler, fireFetchDoneEventMethods inherited from interface com.jbstrap.ui.Focusable
addFocusHandler, addFocusInHandler, addFocusOutHandler, addLosesFocusHandler, setFocusMethods inherited from interface com.jbstrap.ui.HandleHotKey
addHotKey, addHotKey, removeHotKey, removeHotKeysMethods inherited from interface com.jbstrap.ui.HandleMouseEvents
addMouseDownHandler, addMouseEnterHandler, addMouseLeaveHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandlerMethods inherited from interface com.jbstrap.ui.components.form.SupportHelpIcon
getHelpIcon, getHelpText, setHelpIcon, setHelpTextMethods inherited from interface com.jbstrap.ui.Touchable
addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler
-
Constructor Details
-
RadioButtonItem
Creates a radio button with the specified name and label.- Parameters:
name- Radio button namelabel- Radio button label Ifnullis set, the field has no label.- Throws:
NullPointerException- Thrown if the specified name for the field isnull
-
RadioButtonItem
Creates a radio button with the specified name, label and language code.- Parameters:
name- Radio button namelabel- Radio button label Ifnullis set, the field has no label.language- The language code used to create the field If not specified or set tonull, the field is created using the default language of the framework. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE.- Throws:
NullPointerException- Thrown if the specified name for the field isnull
-
RadioButtonItem
Creates a radio button with the specified name and label and populates a combobox with the specified value set.- Parameters:
name- Radio button namelabel- Radio button label Ifnullis set, the field has no label.elements- The map containing the value set for the combobox The map key is equal to the combobox data value and the map value is the displayed value.- Throws:
NullPointerException- Thrown if the specified name for the field isnullIllegalArgumentException- Thrown if any of the keys or values of the specified value set isnull- See Also:
-
RadioButtonItem
Creates a radio button with the specified name, label and language code and populates a combobox with the specified value set.- Parameters:
name- Radio button namelabel- Radio button label Ifnullis set, the field has no label.language- The language code used to create the field If not specified or set tonull, the field is created using the default language of the framework. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE.elements- The map containing the value set for the combobox The map key is equal to the combobox data value and the map value is the displayed value.- Throws:
NullPointerException- Thrown if the specified name for the field isnullIllegalArgumentException- Thrown if any of the keys or values of the specified value set isnull- See Also:
-
RadioButtonItem
Creates a radio button from the specified DataDescriptor column.
The method creates and sets the radio button from the parameter-specified DataDescriptor column. The following parameters of the DataDescriptor column are used:
DataDescriptorColumn.getTitle- The field label is the one specified for the DataDescriptor columnDataDescriptorColumn.isNullable()- If the field gets a value ofnull, it is not designated as mandatory. If the field value is not set tonull, it is designated as a mandatory field.MetaParamName.DATADESCRIPTOR- The name of the DataDescriptor from where the combobox retrieves its value set If the parameter is specified, the value set of the combobox is automatically retrieved from the database and populated with data upon being displayedMetaParamName.DATA_COLUMN- The name of the DataDescriptor column from where the combobox retrieves its value set The data value of the combobox is the value to be taken by the combobox if the user selects the specified item from the value set.MetaParamName.DISPLAY_COLUMN- The name of the column from where the combobox retrieves its displayed values If multiple columns are displayed in the combobox, all column names must be specified here, separated by a ',’ character. A displayed value is a value shown on the interface if an item is selected.MetaParamName.DISPLAY_COLUMN_SEPARATOR- If multiple column values are shown in the combobox component, this parameter specifies the column separator If no column separator is specified, values are shown in a consecutive order.MetaParamName.CRITERIA- This parameter specifies the filter criterion text that we would like to use to filter the DataDescriptor values in the query. If no filter criterion is specified, all data values in the DataDescriptor are added to the combobox as a value set.MetaParamName.AUTO_FETCH- Sets if the combobox should automatically get value set items from the database If not specified, or provided astrue, the query is performed automatically. Iffalseis set, the query is not performed, data retrieval must be implemented from code by calling the methodComboboxItem.fetchData().MetaParamName.PLACEHOLDER- Placeholder text to be used in the radio button component. This text is displayed if no other text is entered into the input field.MetaParamName.SIZE- The input field size is set from the value specified here. (Available values: SMALL, MEDIUM, LARGE)MetaParamName.STATE- The input field state is set from these values. (Available values: DEFAULT, ERROR, WARNING, SUCCESS, INFO)MetaParamName.DEFAULT_VALUE- The value specified here is set as the input field’s default value. The value must be specified based on the field’s data type, in this case it must be a text value.MetaParamName.READ_ONLY- Iftrueis set, the field is created as a read-only field. Otherwise, the field is created as writable and the user is free to change its contents.MetaParamName.ENABLED- Iffalseis specified, the field is created as disabled. Otherwise, the field is created as enabled.MetaParamName.HELP- If this parameter is specified, an icon is displayed next to the input field and the text specified here appears as a help text if the user moves the mouse over itMetaParamName.HELP_ICON- If an icon name is specified in the parameter, also listed in the enumIcon, the default help icon is changed to the icon.MetaParamName.DESCRIPTION- The text specified here will appear below the field, in a smaller, italic font.MetaParamName.TAB_INDEX- The value specified here determines the order of the input focus (when the user presses the Tab key). The smaller the value is, the sooner the field gets focus. The greater the value is, the later the field gets focus. If the parameter is not specified, the field’s tab index receives the value of the field’s position in a sequence as specified in the DataDescriptor. If that is also not specified, the focus order is based on which data value was entered earlier into the DataDescriptor.
- Parameters:
column- DataDescriptor column used to create the field- Throws:
NullPointerException- Thrown if the parameter’s specified column is set tonullIllegalArgumentException- Thrown if the parameters DATA_VALUE or DISPLAY_VALUE are specified, but DATADESCRIPTOR is not specified or there are no columns in the DataDescriptor identified as DATADESCRIPTOR by the names specified in the parameters DATA_VALUE or DISPLAY_VALUE.- See Also:
-
RadioButtonItem
Creates a radio button using the specified DataDescriptor column and language code.
The method creates and sets the radio button from the parameter-specified DataDescriptor column. The following parameters of the DataDescriptor column are used:
DataDescriptorColumn.getTitle- The field label is the one specified for the DataDescriptor columnDataDescriptorColumn.isNullable()- If the field gets a value ofnull, it is not designated as mandatory. If the field value is not set tonull, it is designated as a mandatory field.MetaParamName.DATADESCRIPTOR- The name of the DataDescriptor from where the combobox retrieves its value set If the parameter is specified, the value set of the combobox is automatically retrieved from the database and populated with data upon being displayedMetaParamName.DATA_COLUMN- The name of the DataDescriptor column from where the combobox retrieves its value set The data value of the combobox is the value to be taken by the combobox if the user selects the specified item from the value set.MetaParamName.DISPLAY_COLUMN- The name of the column from where the combobox retrieves its displayed values If multiple columns are displayed in the combobox, all column names must be specified here, separated by a ',’ character. A displayed value is a value shown on the interface if an item is selected.MetaParamName.DISPLAY_COLUMN_SEPARATOR- If multiple column values are shown in the combobox component, this parameter specifies the column separator If no column separator is specified, values are shown in a consecutive order.MetaParamName.CRITERIA- This parameter specifies the filter criterion text that we would like to use to filter the DataDescriptor values in the query. If no filter criterion is specified, all data values in the DataDescriptor are added to the combobox as a value set.MetaParamName.AUTO_FETCH- Sets if the combobox should automatically get value set items from the database If not specified, or provided astrue, the query is performed automatically. Iffalseis set, the query is not performed, data retrieval must be implemented from code by calling the methodComboboxItem.fetchData().MetaParamName.PLACEHOLDER- Placeholder text to be used in the radio button component. This text is displayed if no other text is entered into the input field.MetaParamName.SIZE- The input field size is set from the value specified here. (Available values: SMALL, MEDIUM, LARGE)MetaParamName.STATE- The input field state is set from these values. (Available values: DEFAULT, ERROR, WARNING, SUCCESS, INFO)MetaParamName.DEFAULT_VALUE- The value specified here is set as the input field’s default value. The value must be specified based on the field’s data type, in this case it must be a text value.MetaParamName.READ_ONLY- Iftrueis set, the field is created as a read-only field. Otherwise, the field is created as writable and the user is free to change its contents.MetaParamName.ENABLED- Iffalseis specified, the field is created as disabled. Otherwise, the field is created as enabled.MetaParamName.HELP- If this parameter is specified, an icon is displayed next to the input field and the text specified here appears as a help text if the user moves the mouse over itMetaParamName.HELP_ICON- If an icon name is specified in the parameter, also listed in the enumIcon, the default help icon is changed to the icon.MetaParamName.DESCRIPTION- The text specified here will appear below the field, in a smaller, italic font.MetaParamName.TAB_INDEX- The value specified here determines the order of the input focus (when the user presses the Tab key). The smaller the value is, the sooner the field gets focus. The greater the value is, the later the field gets focus. If the parameter is not specified, the field’s tab index receives the value of the field’s position in a sequence as specified in the data source. If that is also not specified, the focus order is based on which data value was entered earlier into the DataDescriptor.
- Parameters:
column- DataDescriptor column used to create the fieldlanguage- The language code used to create the field. If not specified or set tonull, the field is created using the default language of the framework. The default language of the framework is set via the JBStrap parameterJBStrapParamType.DEFAULT_LANGUAGE.- Throws:
NullPointerException- Thrown if the parameter’s specified column is set tonullIllegalArgumentException- Thrown if the parameters DATA_VALUE or DISPLAY_VALUE are specified, but DATADESCRIPTOR is not specified or there are no columns in the DataDescriptor identified as DATADESCRIPTOR by the names specified in the parameters DATA_VALUE or DISPLAY_VALUE.- See Also:
-
-
Method Details
-
fetchData
Gets value set data from the database, fulfilling the specified filter criterion.- Parameters:
criteria- The filter criterion used to query data from the database- Returns:
- Radio button component
-
addElement
Adds an item to the value set.- Parameters:
dataValue- The component takes this value if the user selects the itemdisplayValue- The value denoting an item on the interface- Returns:
- Radio button component
- Throws:
IllegalArgumentException- Thrown if the specified data value or displayed value isnull
-
addElements
Adds multiple items to the value set.- Parameters:
data- A map of values to be added to the value set The map key is a data value and the map value is the displayed value. A data value is the component’s value if the user selects an item. The displayed value is a value shown on the interface.- Returns:
- Radio button component
- Throws:
IllegalArgumentException- Thrown if the data value or displayed value of any specified item isnull
-
removeElement
Removes an item from the value set if the data value is specified.- Parameters:
dataValue- The data value we want to remove from the value set If you specify a value that is not included in the value set, the method does nothing.- Returns:
- Radio button component
-
clear
Clears the component’s value set and removes all value set items.- Returns:
- Radio button component
-
setDataDescriptor
Sets the DataDescriptor for the value set.- Specified by:
setDataDescriptorin interfaceBasedOnDataDescriptor<RadioButtonItem>- Parameters:
dataDescriptor- The DataDescriptor instance from where the component retrieves its value set- Returns:
- Radio button component
- See Also:
-
getDataDescriptor
Gets the DataDescriptor for the component value set.- Specified by:
getDataDescriptorin interfaceBasedOnDataDescriptor<RadioButtonItem>- Returns:
- The DataDescriptor instance from where the component gets its value set.
nullif no DataDescriptor is set.
-
setDataColumn
Sets the name of the DataDescriptor that contains the value set’s data values. A data value is a value taken by the component if the item is selected.- Parameters:
columnName- The name of the DataDescriptor that contains the value set’s values- Returns:
- Radio button component
- Throws:
IllegalArgumentException- Thrown if there is no DataDescriptor set for the component or the specified column is not included in the data source
-
getDataColumnName
Gets the name of the DataDescriptor column that contains the data values of the value set.- Returns:
- The name of the DataDescriptor column containing the value set’s data values or
nullif not set
-
setDisplayColumn
Sets the name of the DataDescriptor column containing the displayed values of the value set. The displayed value is the value to be displayed on the interface.- Parameters:
columnName- The name of the DataDescriptor column containing the display values- Returns:
- Radio button component
- Throws:
IllegalArgumentException- Thrown if there is not DataDescriptor set for the component or the specified DataDescriptor column is not included in the DataDescriptor
-
setDisplayColumns
Sets the DataDescriptors containing the value set’s displayed values. The displayed value is the value to be displayed on the interface.- Parameters:
columnNames- An enumeration of DataDescriptor columns containing the display values- Returns:
- Radio button component
- Throws:
IllegalArgumentException- Thrown if there is no DataDescriptor set for the component or one of the specified DataDescriptor columns is not included in the DataDescriptor
-
getDisplayColumnName
Gets the DataDescriptor column name containing the displayed value. If multiple values are set, the method returns the name of the first column.- Returns:
- The name of the DataDescriptor containing displayed values or
nullif not set
-
getDisplayColumnNames
Gets the names of all DataDescriptor columns that contain the specified value.- Returns:
- A list of all DataDescriptor columns containing the specified display name If no column is specified that contains the column with the displayed value, the return value is an empty list.
-
setDisplayColumnSeparator
Sets a text separating the displayed columns. By default, this text is not set and the columns are displayed in a consecutive order.- Parameters:
separator- The separator text specified in case of multiple values for the same item- Returns:
- Radio button component
-
getDisplayColumnSeparator
Gets the separator text for the displayed values.- Returns:
- The text separating display values or
nullif it is not specified
-
setValue
Sets the current value of the component.- Overrides:
setValuein classFormItem<Object,RadioButtonItem> - Parameters:
value- The current value of the component- Returns:
- Radio button component
-
afterDraw
public void afterDraw()Description copied from class:ComponentThe operations to be executed after the drawing of the componentBy default, this is an empty method. It has to be overwritten on a component or page if additional operations have to be executed after the drawing process. One such operation is data retrieval, which shouldn't run in constructors so that the user could see results of an operation or navigation process.
- Overrides:
afterDrawin classFormItem<Object,RadioButtonItem>
-
onShow
public void onShow()Description copied from class:ComponentThe operations to be executed after the component is displayed on the clientBy default, this is an empty method. It has to be overwritten on a component or page, if additional operations have to be executed after the component is displayed. This method is nearly identical to the afterDraw() method, they differ in when they are executed. This method runs after the component is displayed on the client. Meaning that it is executed even if the component isn't redrawn, but only set to be visible after being hidden.
- Overrides:
onShowin classFormItem<Object,RadioButtonItem>
-
getValue
Gets the current value of the component.- Overrides:
getValuein classFormItem<Object,RadioButtonItem> - Returns:
- The current value of the component
-
getDisplayValue
Gets the displayed value for the component’s current value.- Specified by:
getDisplayValuein interfaceDifferentDataDisplayValue- Returns:
- The displayed value for the component’s current value or
nullif the component’s current value isnull
-
getOriginalDisplayValue
Gets the displayed value for the component’s original value.- Specified by:
getOriginalDisplayValuein interfaceDifferentDataDisplayValue- Returns:
- The displayed value for the component’s original value or
nullif the component’s original value isnull
-
drawEditor
Description copied from class:FormItemDraws the editor component.
You do not need to use this method during development, but all components extending the form item must implement it. Use the method to generate the input field’s HTML code. This code is then inserted into the corresponding DOM code when drawing the form item.
- Specified by:
drawEditorin classFormItem<Object,RadioButtonItem> - Parameters:
writer- The HTML string writer class instance; write here the HTML code for the input field
-
setSort
Sets if the value set is displayed to the user in a sorted fashion. By default, the value set is not displayed sorted, but based on which item was added earlier.- Parameters:
sort- Iftrueis set, the value set is displayed in a sorted fashion Otherwise, items are displayed in the order of being added to the component.- Returns:
- Radio button component
-
setSort
Sets if the value set is displayed to the user in a sorted fashion. By default, the value set is not displayed sorted, but based on which item was added earlier.- Parameters:
sort- Iftrueis set, the value set is displayed in a sorted fashion Otherwise, items are displayed in the order of being added to the component.collator- Collator instance describing sorting- Returns:
- Radio button component
-
setCollator
Sets the collator instance sorting the value set.- Parameters:
collator- Collator instance for sorting- Returns:
- Combobox component
- See Also:
-
setDefaultValue
Sets the component’s default value.- Specified by:
setDefaultValuein classFormItem<Object,RadioButtonItem> - Parameters:
defaultValue- The default value for the component- Returns:
- Radio button component
-
getCriteria
Gets the filter criterion used to query the component’s value set data from the database.- Specified by:
getCriteriain interfaceFilterable<RadioButtonItem>- Returns:
- Filter criterion used by the component to query the value set data from the database or
nullif no filter criterion is set
-
fetchData
Gets the value set data from the database.- Specified by:
fetchDatain interfaceFetchable<RadioButtonItem>- Specified by:
fetchDatain interfaceFilterable<RadioButtonItem>- Returns:
- Radio button component
- Throws:
UnsupportedOperationException- Thrown if there is no DataDescriptor defined for the component, but the method has been called
-
setFilterCriteria
Sets the filter criterion used to query the value set.- Specified by:
setFilterCriteriain interfaceFilterable<RadioButtonItem>- Parameters:
criteria- The filter criterion used for the query Ifnullis set,the query is performed without setting a filter and all items of the DataDescriptor are retrieved to the value set- Returns:
- Radio button component
-
setInline
Sets the value set to be displayed in a single line. By default, the value set items are displayed below each other.- Parameters:
inline- Iftrueis set, value set items are displayed within a single line Otherwise, value set items are displayed below each other.- Returns:
- Radio button component
-
isInline
public boolean isInline()Sets if the value set items are displayed in a single line.- Returns:
- If
truethe value set items are displayed in a single line. Otherwisefalse.
-
setAutoFetchData
Sets if the component should automatically query the data for the value set from the database. By default, the component queries the value set data automatically from the database.- Specified by:
setAutoFetchDatain interfaceFetchable<RadioButtonItem>- Specified by:
setAutoFetchDatain interfaceFilterable<RadioButtonItem>- Parameters:
autoFetch- If set totrue, the query is performed automatically. Otherwise, the value set query must be implemented by calling the methodfetchData().- Returns:
- Radio button component
-
isAutoFetchData
public boolean isAutoFetchData()Sets if value set data is automatically queried.- Specified by:
isAutoFetchDatain interfaceFetchable<RadioButtonItem>- Specified by:
isAutoFetchDatain interfaceFilterable<RadioButtonItem>- Returns:
- If
trueis set, the data for the value set is automatically queried, otherwise not.
-
setReadOnly
Sets the component to read-only. If the component is set to read-only, the user is not allowed to modify the component value. By default, the component can be freely modified.- Overrides:
setReadOnlyin classFormItem<Object,RadioButtonItem> - Parameters:
readOnly- Iftrueis set, the component is in read-only mode. Otherwise it can be modified.- Returns:
- Radio button component
-
setCustomFetch
Sets a custom query. When calling the fetchData method, the specifiedFetchEventimplementation is called, then callback methods are run on records returned by theonFetchmethod.- Parameters:
fetchEvent- Custom query implementation
-
fetch
public List<Record> fetch(int startRow, int endRow, Criteria criteria, List<Order> orders, Client client) throws FindException, DataAccessException Description copied from interface:FetchableThis method implements actual data retrieval. TheFetchable.fetchData()function runs callback methods on the returned records.- Specified by:
fetchin interfaceFetchable<RadioButtonItem>- Parameters:
startRow- The first row of the query that appears in the returned listendRow- The last row of the query that appears in the returned listcriteria- The criteria used during the query Ifnull, no criteria will be used, every record is queried.orders- The orderings that will be applied to the query results. Ifnull, the data will not be ordered.client- The client that started the query. Ifnull, the query will happen without checking for access rights.- Returns:
- The list of records that meet the specified filter criteria.
- Throws:
FindException- Occurs if an error was encountered during the queryDataAccessException- Occurs if the user in the specified client has no access to read the data
-