Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.
Attributes
-
label-edge :string
-
Specifies how the label is aligned with its value component.
If the value is 'inherit', it will inherit label-edge from its closest custom element ancestor element. If the ancestor doesn't have a label-width attribute, the default is "top".
- Default Value:
"inherit"
Supported Values:
Name Type Description "inherit"string Label will inherit label-edge from its closest custom element ancestor element. "start"string Label is inline with the start of its value component "top"string Label is on top of its value component Names
Item Name Property labelEdgeProperty change event labelEdgeChangedProperty change listener attribute (must be of type function) on-label-edge-changedExamples
Initialize the oj-label-value with the
label-edgeattribute specified:<oj-label-value label-edge="top"> <oj-input-text id="inputcontrol" required value="text" label-hint="input 1"></oj-input-text> </oj-label-value>Get or set the
labelEdgeproperty after initialization:// getter var edge = myLabelValue.labelEdge; // setter myLabelValue.labelEdge = 'start'; -
label-width :string
-
Specifies the label width.
This can be any legal CSS width or 'inherit', which will inherit label-width from its closest custom element ancestor element. If the value is "inherit" and ancestor doesn't have a label-width attribute, the default is "33%".
- Default Value:
"inherit"
Names
Item Name Property labelWidthProperty change event labelWidthChangedProperty change listener attribute (must be of type function) on-label-width-changedExamples
Initialize the oj-form-layout with the
label-widthattribute specified:<oj-form-layout label-width="50%"> <oj-input-text id="inputcontrol" required value="text" label-hint="input 1"></oj-input-text> <oj-text-area id="textareacontrol" value='text' rows="6" label-hint="textarea"></oj-text-area> </oj-form-layout>Get or set the
labelWidthproperty after initialization:// getter var width = myLabelValue.labelWidth; // setter myLabelValue.labelWidth = '60px';
Methods
-
getProperty(property) → {*}
-
Retrieves a value for a property or a single subproperty for complex properties.
Parameters:
Name Type Description propertystring The property name to get. Supports dot notation for subproperty access. Returns:
- Type
- *
Example
Get a single subproperty of a complex property:
var subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2'); -
refresh() → {void}
-
Refreshes the visual state of the component.
Returns:
- Type
- void
-
setProperties(properties) → {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesObject An object containing the property and value pairs to set. Returns:
- Type
- void
Example
Set a batch of properties:
myComponent.setProperties({"prop1": "value1", "prop2.subprop": "value2", "prop3": "value3"}); -
setProperty(property, value) → {void}
-
Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a [property]Changed event.
Parameters:
Name Type Description propertystring The property name to set. Supports dot notation for subproperty access. value* The new value to set the property to. Returns:
- Type
- void
Example
Set a single subproperty of a complex property:
myComponent.setProperty('complexProperty.subProperty1.subProperty2', "someValue");