WebRADDocumentationExplore WebRAD ↗
WEBRAD / TECHNICAL REFERENCE

Combo Box

Single selection with static items or an API response.

WebComboBoxStandardVisual3 events

Quick start

Add ComboBox1 in the Designer. Use the example in a page method.

ComboBox1 · event
ComboBox1.items = [
  { value: 'sp', label: 'São Paulo' },
  { value: 'rj', label: 'Rio de Janeiro' },
];
ComboBox1.value = 'sp';
ComboBox1.onChange = (sender) => { Message(sender.value); };
// To use an API, configure the source in the Inspector.
  • Items in code use value, label, and optional disabled; a string list uses its text as the value.
  • For remote data, configure API Client, operation, list, and fields in the source editor.
  • Read value or selectedIndex in OnChange.

More examples

Items with keys, labels, and disabled states
Items with keys, labels, and disabled states
ComboBox1.items = [
  { value: '', label: 'Select', disabled: true },
  { value: '42', label: 'Ana Silva' },
];
ComboBox1.value = '42';
console.log(ComboBox1.selectedIndex, ComboBox1.value);
// For text-only options, items also accepts strings:
ComboBox1.items = ['Small', 'Medium', 'Large'];

Inspector properties

Component options and defaults. Fields without runtime access are configured in the Inspector.

Property / sourceType and optionsDefaultRuntime access
nameName · Identitystring—name
xLeft · Size & positionnumber0x
yTop · Size & positionnumber0y
widthWidth · Size & positionnumber160width
heightHeight · Size & positionnumber36height
itemWidthResponsive width · Responsive sizeFit content grows the item to its widest rendered child and preserves child intrinsic widths; minimum and maximum width remain limits.enumfixed stretch fit-content"fixed"Inspector / configuration
itemHeightResponsive height · Responsive sizeFit content grows the item to its lowest rendered child and preserves child intrinsic heights; minimum and maximum height remain limits.enumfixed stretch fit-content"fixed"Inspector / configuration
itemMinWidthMinimum width · Responsive sizenumber0Inspector / configuration
itemMaxWidthMaximum width · Responsive sizenumbernullInspector / configuration
itemMinHeightMinimum height · Responsive sizenumber0Inspector / configuration
itemMaxHeightMaximum height · Responsive sizenumbernullInspector / configuration
itemGrowGrow · Responsive sizenumber0Inspector / configuration
itemShrinkShrink · Responsive sizeAllows fixed and stretch flow items to yield space. Fit-content keeps its intrinsic size so its children are not compressed.booleantrueInspector / configuration
itemAlignSelfItem alignment · Responsive sizeCross-axis alignment for this item in a row or column. Auto inherits the parent alignment; responsive cross-axis stretch retains its sizing behavior.enumauto start center end stretch"auto"Inspector / configuration
itemHorizontalAnchorHorizontal anchor · Anchors & offsetsenumstart center end stretch"start"Inspector / configuration
itemVerticalAnchorVertical anchor · Anchors & offsetsenumstart center end stretch"start"Inspector / configuration
itemLeftLeft inset · Anchors & offsetsnumber0Inspector / configuration
itemRightRight inset · Anchors & offsetsnumber0Inspector / configuration
itemTopTop inset · Anchors & offsetsnumber0Inspector / configuration
itemBottomBottom inset · Anchors & offsetsnumber0Inspector / configuration
marginMargin · SpacingOuter spacing on all four sides, in pixels. Row and column layouts include this spacing between components.number0margin
marginTopMargin top · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginTop
marginRightMargin right · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginRight
marginBottomMargin bottom · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginBottom
marginLeftMargin left · SpacingOuter spacing on this side, in pixels. Overrides the shared Margin value.number0Derived from saved propertiesmarginLeft
visibleVisible · Behaviorbooleantruevisible
collapseWhenHiddenCollapse when hidden · BehaviorRemoves the component from the layout while it is not visible.booleantruecollapseWhenHidden
enabledEnabled · Behaviorbooleantrueenabled
tabIndexTabIndex · Behaviornumber0tabIndex
itemsItems · Datastring-listEditor: combo-box-items[]itemsConditional availability in the Inspector
valuesValues · Datastring-listEditor: combo-box-values[]valuesConditional availability in the Inspector
comboBoxConfigAPI Client binding · DataSelect the API Client response list, display field, and key field.combo-box-configEditor: combo-box-configuratornullcomboBoxConfig
selectedIndexSelected Index · DataFor API-bound options, use Value to select the key after the list loads.number-1selectedIndexConditional availability in the Inspector
valueValue · Datastring""value
currentRowBindingsCurrent row · DataBind writable visual values to fields of this repeated row.current-row-bindingsEditor: current-row-bindings[]currentRowBindings

API in code

MemberSignatureAccess
valuevalue: string;Read and write
selectedIndexselectedIndex: number;Read and write
valuesget values(): readonly string[];Read and write
itemsget items(): readonly WebSelectItem[];Read and write
comboBoxConfigcomboBoxConfig: WebComboBoxConfiguration | null;Read and write
onChangeset onChange(handler: WebComponentEventHandler<this> | null);Read and write

bindApiClient

method
bindApiClient(apiClient: WebApiClient | null): void;
Example
ComboBox1.bindApiClient
ComboBox1.bindApiClient(ApiClient1);

dispose

method
override dispose(): void;
Example
ComboBox1.dispose
// Call only when disposing of an instance whose lifecycle you control.
ComboBox1.dispose();
Inherited members (26)
MemberSignatureAccess
currentRowBindingscurrentRowBindings: readonly WebCurrentRowBinding[];Read and write
elementreadonly element: TElement;Read-only
idreadonly id: string;Read-only
namereadonly name: string;Read-only
visiblevisible: boolean;Read and write
collapseWhenHiddencollapseWhenHidden: boolean;Read and write
enabledenabled: boolean;Read and write
xx: number;Read and write
yy: number;Read and write
widthwidth: number;Read and write
heightheight: number;Read and write
marginOuter spacing on all four sides, in pixels.margin: number;Read and write
marginTopmarginTop: number;Read and write
marginRightmarginRight: number;Read and write
marginBottommarginBottom: number;Read and write
marginLeftmarginLeft: number;Read and write
alignSelfalignSelf: RuntimeLayoutAlignSelf;Read and write
tabIndextabIndex: number;Read and write
backgroundColorbackgroundColor: string;Read and write
colorcolor: string;Read and write
borderColorborderColor: string;Read and write

focus

method
focus(options?: FocusOptions): void;

show

method
show(): void;

hide

method
hide(): void;

bindEvent

method
bindEvent(eventName: string, handler: WebComponentEventHandler<this> | null): () => void;

emit

method
emit(eventName: string, detail?: unknown): boolean;

Events

Link methods in Interaction. How to use events.

OnChange

Standard event (Event).

Signature and example
Interaction → OnChange
import type { WebComboBox } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async ComboBox1Change(
    sender: WebComboBox,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}

OnFocus

Standard event (Event).

Signature and example
Interaction → OnFocus
import type { WebComboBox } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async ComboBox1Focus(
    sender: WebComboBox,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}

OnBlur

Standard event (Event).

Signature and example
Interaction → OnBlur
import type { WebComboBox } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async ComboBox1Blur(
    sender: WebComboBox,
    event: Event,
  ): Promise<void> {
    console.log(sender.name, event.type);
  }
}
WebRAD · Atentor · Read in Markdown
Source code: 6a562bda75a0 (with local changes) · November 7, 2026

Search documentation

Type to search APIs, components, and events.