public interface UIColorPicker extends UIAtomicWidget
The JavaScript type for this widget is String
with the hexadecimal HTML color format,
that is a #
followed by 6 hexadecimal digits from 0
to F
.
If the input is empty, the value will be an empty String
, that is, ""
.
If an afterValueChanged action
has been set on this widget,
the JavaScript type of the value will be the same.
Modifier and Type | Method and Description |
---|---|
JsFunctionCall |
getActionWhileValueChange() |
String |
getPanelContext() |
void |
setActionWhileValueChange(JsFunctionCall aFunctionToBeCalled)
Sets an action on the client-side that is triggered
when the value is edited in the input text (on each keyboard press),
or while the user changes the cursor position in the color picker panel.
|
void |
setPanelContext(String htmlElementId)
Sets an HTML element in the page that will be the context of display of the color picker panel.
|
getActionOnAfterValueChanged, isAjaxPrevalidationEnabled, isAjaxValueSynchEnabled, setActionOnAfterValueChanged, setAjaxPrevalidationEnabled, setAjaxValueSynchEnabled
isEditorDisabled, setEditorDisabled
JsFunctionCall getActionWhileValueChange()
void setActionWhileValueChange(JsFunctionCall aFunctionToBeCalled)
It is very useful to update the color of a third-party preview, event if
the color is not the final chosen color
(in addition to the UIAtomicWidget.setActionOnAfterValueChanged(JsFunctionCall)
).
When the action is triggered, the JavaScript function is called as follows:
<myFunction>(<val> [, <myArg>]);
, where <myFunction>
is the name of aFunctionToBeCalled
and <val>
is the value of the field; the type of the value is
String
with the hexadecimal HTML color format,
that is a #
followed by 6 hexadecimal digits from 0
to F
.
The second argument <myArg>
is optional and
is passed as a parameter, only if specified by aFunctionToBeCalled
.
aFunctionToBeCalled
- the JavaScript function to be called while the user changes the cursor position in the
color picker.UIAtomicWidget.setActionOnAfterValueChanged(JsFunctionCall)
String getPanelContext()
null
if no context has been set.setPanelContext(String)
void setPanelContext(String htmlElementId)
The color picker panel will be aligned with the context so that the top left corner of the color picker panel will stick to the bottom left corner of the context element.
If no context element is set, the color picker panel will be stuck to the widget itself.
htmlElementId
- the HTML id of the element to set as the context of the color picker panel