The base of all components. All Forms framework components must extend this class.
Modeling id of the component. Do not use the field directly, use getModelingId and setModelingId methods instead.
Arbitrary data which you can use for any purpose. This field is not used by the Forms framework itself.
A property used by the framework to store component state when saving document or todo. Do not use this property directly.
Adds one or more style names to this component. Multiple styles can be specified as a space-separated list of style names. The style name will be rendered as a HTML class name, which can be used in a CSS definition.
Label label = new Label("This text has style"); label.addStyleName("mystyle");
Each style name will occur in two versions: one as specified and one that is prefixed with the style name of the component. For example, if you have a Button component and give it "mystyle" style, the component will have both "mystyle" and "v-button-mystyle" styles. You could then style the component either with:
.mystyle {font-style: italic;}
or
.v-button-mystyle {font-style: italic;}
This method will trigger a RepaintRequestEvent.
Parameters:
Generates new unique id and adds a new stylesheet with that id. The style sheet can be removed by removeStyleSheet(String id) method. It is also automatically removed when the component is detached from the page.
Parameters:
Returns:
Adds a new stylesheet to the page or modifies existing stylesheet. The style sheet can be removed by removeStyleSheet(String id) method. It is removed when the component is detached from the page.
Parameters:
Returns:
Calls a method on the underlying Java UI component. You can use this method e.g. for calling methods of component-produced objects on the component itself. For example, the Tab itself has utility methods which delegates to the TabSheet itself. Default implementation will first try to find given method reflectively on the FormComponent-based Java class; if there is no method with given name and given parameter count (parameter types are not matched), the underlying Vaadin widget is searched. If there is no such method, this method fails with an exception.
Parameters:
Returns:
Calls a method on the underlying Java UI component.
DEPRECATED. Use call(String method, Object... args)
Tells whether the 'excludeConstraintViolation' predicate evaluates the constraint violation as the one which should not be displayed on this component. When this predicate is not set then this method returns false.
Parameters:
Returns:
Turns on polling and executes the closure exactly once approximately after intervalMs. Returns unique id that can be used to stop the closure.
The closure is run only while the component is attached to the screen. It stops when component is detached.
Polling causes the browser to send request to server at regular interval. This allows ui to update visible information after each regular request. Note that frequent polling causes higher server load.
Turns on polling and executes the closure approximately every intervalMs. Returns unique id that can be used to stop the closure.
The closure is run only while the component is attached to the screen. It stops when component is detached.
Polling causes the browser to send request to server at regular interval. This allows ui to update visible information after each regular request. Note that frequent polling causes higher server load.
Returns the current component caption. By default the component has no caption.
Returns:
Returns the current Alignment of this component, with respect to its parent layout.
Parameters:
Returns:
Gets the handler which is notified when a context click event occurs.
Returns:
Gets the component error message. Return value contains only custom component error message set by setErrorMessage
method, it does NOT contain data constraint error messages nor validation error messages.
Returns:
null
Returns all data error messages assigned to this component by data validation. Returned list does NOT contain validation error messages nor custom error message.
Data validation is typically performed via validate
validation function, its results are distributed to components using clearConstraintErrorMessages
function.
Returns all data error messages assigned by data validation to this component and to its child components. Returned list does NOT contain validation error messages nor custom error message.
Data validation is typically performed via validate
validation function, its results are distributed to components using clearConstraintErrorMessages
function.
Gets the components description, used in tooltips and can be displayed directly in certain other components such as forms. The description can be used to briefly describe the state of the component to the user.
Returns:
String
Gets the predicate which is used by this component to specify which constraint violation should not be displayed on this component.
Parameters:
Returns the expand ratio of this component, with respect to its parent VerticalLayout or HorizontalLayout.
Warning: this method will fail if the component is not placed directly in the VerticalLayout or HorizontalLayout.
Returns:
Returns the component height, in the form of [number][units], such as 100%, 10em, 25px.
Returns:
Gets the icon resource of the component.
See #setIcon(Resource) for a detailed description of the icon.
Returns:
Gets the predicate which is used by this component to specify which constraint violation should be displayed on this component.
Returns:
Gets the modeling ID of this component. Note: if the component is rendered multiple times, the rendered id is different. Each copy gets unique suffix.
Returns:
Gets all user-defined CSS style names of a component. If the component has multiple style names defined, the return string is a space-separated list of style names. Built-in style names defined in Vaadin or GWT are not returned.
The style names are returned only in the basic form in which they were added; each user-defined style name shows as two CSS style class names in the rendered HTML: one as it was given and one prefixed with the component-specific style name. Only the former is returned.
Returns:
Gets html id of this component as rendered on the page.
Returns:
null
). Only components with value can have validator, other components return an empty list. Returned list does NOT contain data error messages nor custom error message. Returns the component width, in the form of [number][units], such as 100%, 10em, 25px.
Returns:
Tells whether the 'includeConstraintViolation' predicate evaluates the constraint violation as the one which should be displayed on this component. When this predicate is not set then this method returns false.
Parameters:
Returns:
Tests whether the component is enabled or not. A user can not interact with disabled components. Disabled components are rendered in a style that indicates the status, usually in gray color. Children of a disabled component are also disabled. Components are enabled by default.
As a security feature, all updates for disabled components are blocked on the server-side.
Note that this method only returns the status of the component and does not take parents into account. Even though this method returns true the component can be disabled to the user if a parent is disabled.
Returns:
true
if the component and its parent are enabled, false
otherwise. Tests whether the component is in the read-only mode. The user can not change the value of a read-only component. As only ComponentWithValue components normally have a value that can be input or changed by the user, this is mostly relevant only to field components, though not restricted to them. Notice that the read-only mode only affects whether the user can change the value of the component; it is possible to, for example, scroll a read-only table.
Returns:
Returns true if the component is visible. All components are by default visible.
Returns:
Removes one or more style names from component. Multiple styles can be specified as a space-separated list of style names.
The parameter must be a valid CSS style name. Only user-defined style names added with addStyleName() or setStyleName() can be removed; built-in style names defined in Vaadin or GWT can not be removed.
Parameters:
Removes stylesheet identified by id from the page.
Parameters:
Sets callback on "beforeunload" browser event. It is fired when:
Sets the component's caption. The caption itself is rendered by the parent layout.
Parameters:
Set alignment for this component in its parent layout. Use predefined alignments from Alignment enum.
Parameters:
Sets the context menu items to this component.
Parameters:
Sets custom error message to this component. If the error message is not null, the component is marked with a red asterisk. Custom component error message is shown first, above data constraint error messages and validation error messages.
Parameters:
null
Sets the component's description. See #getDescription() for more information on what the description is. This method will trigger a RepaintRequestEvent.
The description is displayed as HTML in tooltips or directly in certain components so care should be taken to avoid creating the possibility for HTML injection and possibly XSS vulnerabilities.
Parameters:
Enables or disables the component. The user can not interact with disabled components, which are shown with a style that indicates the status, usually shaded in light gray color. Components are enabled by default.
Button enabled = new Button("Enabled"); enabled.setEnabled(true); // The default layout.addComponent(enabled); Button disabled = new Button("Disabled"); disabled.setEnabled(false); layout.addComponent(disabled);
This method will trigger a RepaintRequestEvent for the component and, if it is a ComponentContainer, for all its children recursively.
Parameters:
Sets a predicate shich allows to specify which constraint violation should not be displayed on this component.
Parameters:
This method is used to control how excess space in layout is distributed among components in the parent layout. Excess space may exist if layout is sized and contained non relatively sized components don't consume all available space.
Example how to distribute 1:3 (33%) for component1 and 2:3 (67%) for component2 :
layout.setExpandRatio(component1, 1); layout.setExpandRatio(component2, 2);
If no ratios have been set, the excess space is distributed evenly among all components.
Note, that width or height (depending on orientation) needs to be defined for this method to have any effect.
Warning: this method will fail if the component is not placed directly in the VerticalLayout or HorizontalLayout.
Parameters:
Sets the component height, in the form of [number][units], such as 100%, 10em, 25px. Use null to direct the component to wrap its contents tightly.
Parameters:
Sets the icon of the component.
An icon is an explanatory graphical label accompanying a user interface component, usually shown above, left of, or inside the component. Icon is closely related to caption (see setCaption()) and is usually displayed horizontally before or after it, depending on the component and the containing layout.
The image is loaded by the browser from a resource, typically a ThemeResource.
The icon of a component is, by default, managed and displayed by the layout component or component container in which the component is placed. For example, the VerticalLayout component shows the icons left-aligned above the contained components, while the FormLayout component shows the icons on the left side of the vertically laid components, with the icons and their associated components left-aligned in their own columns.
An icon will be rendered inside an HTML element that has the v-icon CSS style class. The containing layout may enclose an icon and a caption inside elements related to the caption, such as v-caption .
Parameters:
Sets a predicate which allows to specify which constraint violation should be displayed on this component.
Parameters:
Sets the modeling ID of this component. Note: if the component is rendered multiple times, the rendered id might not exactly match configured id. Each html component copy gets unique suffix.
Parameters:
Sets the read-only mode of the component to the specified mode. The user can not change the value of a read-only component. As only ComponentWithValue components normally have a value that can be input or changed by the user, this is mostly relevant only to field components, though not restricted to them. Notice that the read-only mode only affects whether the user can change the value of the component; it is possible to, for example, scroll a read-only table.
Parameters:
Sets one or more user-defined style names of the component, replacing any previous user-defined styles. Multiple styles can be specified as a space-separated list of style names. The style names must be valid CSS class names and should not conflict with any built-in style names in Vaadin or GWT.
Label label = new Label("This text has a lot of style"); label.setStyleName("myonestyle myotherstyle");
Each style name will occur in two versions: one as specified and one that is prefixed with the style name of the component. For example, if you have a Button component and give it "mystyle" style, the component will have both "mystyle" and "v-button-mystyle" styles. You could then style the component either with:
.myonestyle {background: blue;}
or
.v-button-myonestyle {background: blue;}
It is normally a good practice to use addStyleName() rather than this setter, as different software abstraction layers can then add their own styles without accidentally removing those defined in other layers.
This method will trigger a RepaintRequestEvent.
Parameters:
Changes the component visibility. Invisible component's HTML elements are not present in the browser's DOM tree.
Parameters:
Sets the component width, in the form of [number][units], such as 100%, 10em, 25px. Use null to direct the component to wrap its contents tightly.
Parameters:
Opens context menu on this component.
Parameters:
Shows the value; does not allow the value to be edited. Accepts Object and calls toString() on the object. If the value is null, nothing (empty string) is displayed. isValid() always returns true for this component. Does not support validators and is always valid.
Creates a label which initially shows given value.
Parameters:
Creates a label with a given value and content mode.
Parameters:
Checks whether captions are rendered as HTML
The default is false, i.e. to render that caption as plain text.
Returns:
Sets whether the caption is rendered as HTML or plain text.
When a caption is rendered as HTML, it is up to the developer to ensure that no harmful HTML can be used. If set to plain text, the caption is rendered in the browser as plain text.
The default is plain text.
Parameters:
Sets the content mode of the caption. Content mode defines how the label's content is rendered - as html or as text and whether new line is rendered as is or as tag.
Parameters:
The user of this interface binds a component to a value which the component displays or edits.
It provides values either by holding them directly, wrapping them in a closure or a reference, or by other means.
Returns the value of the binding.
Returns:
If the Binding value represents a writable reference to a record and its property, the function returns the RecordAndProperty object with the record and property. In other cases, for example, for a simple value or a closure, the return value is null
. This method is used, for example, to infer validators with ComponentWithValue.inferValidator().
Returns:
Sets the Binding to this value. Note that this operation may not be supported and fail.
Parameters:
A group of components. This component is valid if all child groups and child ComponentWithValues are valid.
Adds component to this component group. Does nothing if the component is already a child of this component group.
Parameters:
Adds all components to this component group.
Parameters:
Returns the i-th child of this group. Fails if the index is out-of-range.
Parameters:
Returns:
Returns the child components as a list.
Returns:
Returns:
Returns:
Removes given component from this group. Does nothing if the component is not a child of this component group.
Parameters:
Removes all given components from this group.
Parameters:
Set alignment for all given contained component in this layout. Use predefined alignments from Alignment enum.
Parameters:
Enable layout margins. Affects all four sides of the layout. This will tell the client-side implementation to leave extra space around the layout. The client-side implementation decides the actual amount, and it can vary between themes.
Does nothing for TabSheet.
Parameters:
Enable spacing between child components within this layout.
NOTE: This will only affect the space between components, not the space around all the components in the layout (i.e. do not confuse this with the cellspacing attribute of a HTML Table). Use #setMargin(boolean) to add space around the layout.
See the reference manual for more information about CSS rules for defining the amount of spacing to use.
TabSheet has no spacing support, therefore this method does nothing for tab sheet.
Parameters:
Creates a vertical layout initially containing given components.
Parameters:
Sets both margin and spacing to true.
Returns:
Creates a horizontal layout containing given components.
Parameters:
Creates a form layout initially containing given components.
Parameters:
Shows boolean values only. Always convertible.
Creates a checkbox with given label and simple value holder.
Parameters:
Creates a checkbox with given label and given property.
Parameters:
Creates a checkbox with given label, referencing given variable/field.
Parameters:
Sets the ReferenceValue being displayed by this component. By default a simple value with the initial value of null is displayed. The component is automatically refreshed. If the reference is null, previous reference is cleared and field is empty.
Parameters:
A component showing a value. The value is not yet editable - please use InputComponentWithValue for that. This component is primarily extended by components which only show some data, for example the Label component.
Every component with value is bound to a data object. Gets the currently displayed Binding object.
Returns:
Polls the current Binding for its data. Shorthand for getBinding().get()
Returns:
Sets the ReferenceValue being displayed by this component. By default a simple value with the initial value of null is displayed. The component is automatically refreshed. If the reference is null, previous reference is cleared and field is empty.
Parameters:
Shows String values only. Always convertible.
Creates a text field with given label and simple value holder.
Parameters:
Creates a text field with given label and given binding.
Parameters:
Creates a text field with given label, referencing given variable/field.
Parameters:
Shows Decimal values only. If the value typed by the user is not convertible to Decimal, isValid() returns false and the field shows error message.
Creates a decimal field with given label and simple value holder.
Parameters:
Creates a decimal field with given label and given property.
Parameters:
Creates a decimal field with given label, referencing given variable/field.
Parameters:
Returns:
getValue
method, this returns whatever is in field including invalid or unparseable values. Sets the number format for the decimal field, for example df.setNumberFormat("#,##0.00;\(#,##0.00\)"). See https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html for further information on the formatting string. By default the default number format of user's locale is used.
Parameters:
Sets the number formats for this decimal field. By default a default number format for user's locale is selected. The field will accept user string if any of the formats is able to convert it to number. If multiple formats match the number, first one is used.
When formatting numbers, first format is used.
Please see https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html for information on the formatting string.
Parameters:
Sets the ReferenceValue being displayed by this component. By default a simple value with the initial value of null is displayed. The component is automatically refreshed.
Parameters:
Shows Date values only. If the value typed by the user is not convertible to Date, isValid() returns false.
Creates a date field with given label and simple value holder.
Parameters:
Creates a date field with given label and given property.
Parameters:
Creates a date field with given label, referencing given variable/field.
Parameters:
Returns:
getValue
method, this returns whatever is in field including invalid or unparseable values. Sets the ReferenceValue being displayed by this component. By default a simple value with the initial value of null is displayed. The component is automatically refreshed. If the reference is null, previous reference is cleared and field is empty.
Parameters:
Sets the formats accepted by this date field. The date field resolution (or precision - second, minute, hour, day, month, year) is updated automatically. The list may contain a special String constant "date" or "dateTime" - this constant is automatically replaced by application messages named "app.dateFormat" or "app.dateTimeFormat" respectively, via the LspsAppConnector.getApplicationMessage().
For formatting string specification please follow http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
Parameters:
Creates a frame which shows given URL.
Parameters:
Returns the URL set via the #setUrl(String) method. Does not return the current frame URL, which may have been changed for example as a result of redirects and/or user clicking on links.
Returns:
Posts message to target frame.
Parameters:
Posts message to target frame.
Parameters:
Adds a column containing just a single button. Utility method which ultimately calls addColumn().
Parameters:
Returns:
Adds a sortable column to this Grid. The column is by default filtrable and has no renderer.
Parameters:
Returns:
Adds a sortable column to this Grid. The column is by default filtrable and has no renderer.
Parameters:
Returns:
Adds a column to this Grid. You can call this before or after the data source has been set. The column is by default filtrable and has no header.
Parameters:
Returns:
Adds a column to this Grid. You can call this before or after the data source has been set. The column is by default filtrable and has no header.
Parameters:
Returns:
Adds a column containing just a single link. Utility method which ultimately calls addColumn().
Parameters:
Returns:
Returns the current list of columns in the current order.
Returns:
Returns the list of the components currently rendered in the grid.
The components in the grid are transient: The grid detaches and forgets its components, and creates and attaches new ones as the user scrolls. The method returns the components currently attached to the page, that is, the displayed rows plus a few rows above and a few rows below. The components that are not loaded or have been detached are not returned. Therefore, do not store the returned components for later. The returned components are not ordered.
Returns:
Returns the current Grid data source.
Returns:
Gets the number of frozen columns in this grid. 0 means that no data columns will be frozen, but the built-in selection checkbox column will still be frozen if it's in use. -1 means that not even the selection column is frozen.
NOTE: this count includes hidden columns in the count.
Returns:
Returns the current row-height. Please see setHeightByRows() for more information.
Returns:
Returns list of currently selected row objects or an empty list. The rows were selected either by user clicking on the grid rows, or by calling select() programatically. Grid in single select mode returns a list with one element. Initially, there is no row selected.
Returns:
Gets the current value change listener
Returns:
Returns whether column reordering is allowed or not - that is, whether the user can drag a column to the new location or not.
Returns:
Requests that the column widths should be recalculated.
In most cases Grid will know when column widths need to be recalculated but this method can be used to force recalculation in situations when grid does not recalculate automatically.
Note: if the user manually resized any of the columns, the method does nothing. It wont modify users configuration.
Marks an item as selected. Unselects all other items. The row object must have been provided by the DataSource. Calling select(null) clears the selection. Fails if the grid is not selectable.
Parameters:
Changes grid selection. Previous selection is cleared and new set of rows is selected. Exact behavior depends on selection mode:
rowObjects
argument is non-empty, only one row is selected.rowObjects
argument is non-empty, all objects in it are selected.All row objects must have been provided by the DataSource.
Sets a new column order for the grid. All columns which are not ordered here will remain in the order they were before as the last columns of grid.
Parameters:
Sets a new column order for the grid. All columns which are not ordered here will remain in the order they were before as the last columns of grid.
Parameters:
Sets callback for columns reorder event.
Parameters:
Sets whether column reordering is allowed or not - that is, whether the user can drag a column to the new location or not. By default this value is set to true.
Parameters:
Sets a column resize listener to this grid. Replaces any previously set column resize listener. Setting null will remove any previously set column resize listener.
Parameters:
Sets a new data source to this Grid. The grid automatically refreshes itself.
Parameters:
Returns:
Sets common tooltip on all grid columns. The closure obtains row object and generates tooltip string. If it returns null
, nothing is shown. Uses "Preformatted" content mode.
Note: Column tooltip (description) set directly on column takes precedence over row tooltip set here.
Parameters:
Sets common tooltip on all grid columns. The closure obtains row object and generates tooltip string. If it returns null
, nothing is shown.
Note: Column tooltip (description) set directly on column takes precedence over row tooltip set here.
Parameters:
Sets the buffered flag for the editor row. If the editor is buffered the changes are not propagated to the model directly but are buffered first and are propagated to the modle only after the user finishes editing by pressing a save button. If user finishes editing by pressing a cancel button the edited changes are lost.
By default the editor is buffered.
Sets the enabled state of the value editor. If the editor is enabled the editor is displayed on row double click.
Parameters:
Sets callback for grid filter event.
Parameters:
Setting false here will hide the filter component for all columns. Equivalent of calling GridColumn.setFiltrable for every column.
Parameters:
Sets the number of frozen columns in this grid. Setting the count to 0 means that no data columns will be frozen, but the built-in selection checkbox column will still be frozen if it's in use. Setting the count to -1 will also disable the selection column.
The default value is 0.
Parameters:
Throws:
Sets the Grid row-height. Setting this to a non-zero value will make the Grid show exactly given number of rows, with the header and a possible scrollbar. In this mode the Grid will ignore its current component height as set by setHeight()/getHeight().
Setting row-height to zero will cause the Grid to again respect the component height.
Defaults to zero. You can use fraction numbers.
As opposed to AbstractTable.setPageLength(), it is not possible to configure Grid's server-client fetch page size.
Parameters:
Sets the listener for row item click events.
Parameters:
Sets the style generator that is used for generating styles for rows. The generator obtains a row objects and returns css class that will be added to that row div.
Parameters:
null
to remove a previously set generator Sets the select all checkbox visibility when in multiselect (MULTI) selection mode. The setting is ignored if the grid is in SINGLE or NONE selection mode.
WARNING: checking select all checkbox causes all items in the datasource to be loaded into memory. Do not use this unless you are sure the datasource is small.
Parameters:
Sets callback for grid sort event.
Parameters:
Do not create directly - instead, use the Grid.addColumn functions.
The owner grid, not null.
Provides values to show in this column's cells.
Renders every cell in this Grid column - generates HTML code and updates the code according to the row-extracted data. The HTML code generator is implemented in Java - for details please see Vaadin documentation on Grid Renderers.
If null, the objects provided by the value provider are converted to string (using the toString() function) and displayed as strings. In case of the built-in Button or Link Renderers, the string value obtained from the value provider will be shown as a Button's/Link's caption.
Enables editing support in this column.
If false, the column will not be sortable.
Modeling id of the component. Do not use the field directly, use getModelingId and setModelingId methods instead.
Arbitrary data which you can use for any purpose. This field is not used by the Forms framework itself.
Returns the current column's child alignment, with respect to the column itself. Defaults to left alignment.
Returns:
If the column contains a component renderer, returns the component generated from rowObject. Otherwise returns null.
Returns:
Returns the column's expand ratio.
Returns:
Gets the current filter configuration for this column.
Returns:
Returns the caption of the header. By default the header caption is an empty string.
Returns:
Throws:
Returns the current column's header content alignment. Defaults to left alignment.
Returns:
Returns the style name of this column's header.
Returns:
Gets the caption of the hiding toggle for this column.
Returns:
Throws:
Returns the maximum width for this column.
Returns:
Return the minimum width for this column.
Returns:
Gets the modeling ID of this component.
Returns:
Gets html id of this component as rendered on the page or null if there is no direct representation.
Returns:
Returns the width (in pixels). By default a column is 100px wide.
Returns:
Throws:
Checks whether the Grid should show the filtering component for this column.
Returns:
Returns whether this column can be hidden by the user. Default is false.
Note: the column can be programmatically hidden using #setHidden(boolean) regardless of the returned value.
Returns:
true
if the user can hide the column, false
if not Returns whether this column is hidden. Default is false.
Returns:
true
if the column is currently hidden, false
otherwise Returns whether this column can be resized by the user. Default is true.
Note: the column can be programmatically resized using #setWidth(double) and #setWidthUndefined() regardless of the returned value.
Returns:
Returns true if the grid is sorted in ascending order and false if it is sorted in descending order. Can return anything for unsorted columns.
Returns:
Returns whether the grid is sorted by the specified column
Returns:
Sets the specified column's child component alignment inside of the column. In order for this to work, the div element produced by renderer must wrap its contents, otherwise the child will just fill the column and there will be no space for the alignment flag to move the child.
Ignores the vertical aspect of the alignment - only the horizontal aspect is applied.
Parameters:
Sets the tooltip on the grid column. Column tooltip takes precedence over row tooltip (description) set on grid. If both are set, only column tooltip is shown. The closure obtains row object and generates tooltip string. If it returns null
, the row tooltip common for all columns is show instead.
Uses "Preformatted" content mode.
Parameters:
Sets the tooltip on the grid column. Column tooltip takes precedence over row tooltip (description) set on grid. If both are set, only column tooltip is shown. The closure obtains row object and generates tooltip string. If it returns null
, the row tooltip common for all columns is show instead.
Parameters:
Sets the ratio with which the column expands.
By default, all columns expand equally (treated as if all of them had an expand ratio of 1). Once at least one column gets a defined expand ratio, the implicit expand ratio is removed, and only the defined expand ratios are taken into account.
If a column has a defined width (#setWidth(double)), it overrides this method's effects.
Example: A grid with three columns, with expand ratios 0, 1 and 2, respectively. The column with a ratio of 0 is exactly as wide as its contents requires. The column with a ratio of 1 is as wide as it needs, plus a third of any excess space, because we have 3 parts total, and this column reserves only one of those. The column with a ratio of 2, is as wide as it needs to be, plus two thirds of the excess width.
Parameters:
Throws:
Sets the new filter configuration to the grid.
Parameters:
Setting false here will hide the filter component for this column.
Parameters:
Sets the caption of the header. This caption is also used as the hiding toggle caption, unless it is explicitly set via #setHidingToggleCaption(String).
Parameters:
Returns:
Throws:
Sets the specified column's header content alignment.
Ignores the vertical aspect of the alignment - only the horizontal aspect is applied.
Parameters:
Sets the tooltip on the grid column header. Uses "Preformatted" content mode.
Parameters:
Sets the tooltip on the grid column header.
Parameters:
Sets the style name to this column's header.
Parameters:
Sets whether this column can be hidden by the user. Hidable columns can be hidden and shown via the sidebar menu.
Parameters:
true
iff the column may be hidable by the user via UI interactionReturns:
Hides or shows the column. By default columns are visible before explicitly hiding them.
Parameters:
true
to hide the column, false
to showReturns:
Sets the caption of the hiding toggle for this column. Shown in the toggle for this column in the grid's sidebar when the column is hidable.
The default value is null
, and in that case the column's header caption is used.
NOTE: setting this to empty string might cause the hiding toggle to not render correctly.
Parameters:
Returns:
Throws:
Sets the maximum width for this column.
This defines the maximum allowed pixel width of the column when it is set to expand.
Parameters:
Throws:
Sets the minimum width for this column.
This defines the minimum guaranteed pixel width of the column when it is set to expand.
Parameters:
Throws:
Sets the modeling ID of this component.
Parameters:
Sets whether this column can be resized by the user.
Parameters:
Sets whether the specified column is used for grid sort or not. The column will be in ascending order.
Parameters:
Sets whether the specified column is used for grid sort or not and whether it should be ascending or descending.
Parameters:
Sets the width (in pixels).
This overrides any configuration set by any of #setExpandRatio(int), #setMinimumWidth(double) or #setMaximumWidth(double).
Provide null to set the column width to undefined. An undefined width means the grid is free to resize the column based on the cell contents and available space in the grid.
Parameters:
Returns:
Throws:
Utility methods for your UI - you can e.g. Call ui() to obtain instance of this class. You can control the UI with this class.
Asks the browser to detect the geoposition location. When the location is detected (or the detection is rejected by the user or any other error happens), the callback is invoked.
Parameters:
Handles the submit navigation logic.
Parameters:
Navigates to given target.
Parameters:
Navigates to given document.
Parameters:
Navigates to given document.
Parameters:
Redirects the browser to http:// link.
Parameters:
Saves the form. The result of this action is either a saved Todo (human::Todo) or a saved Document (human::SavedDocument).
Returns:
Submits a form (document/todo) and navigates further.
Parameters:
Renders a simple link, with the cell value set at its caption.
Called when the button is clicked. Receives the business data for given row as input. Closure result is ignored.
Creates a new link renderer with the click listener.
Parameters:
Sets the click listener which is called when the link is clicked. The listener receives the business data for given row as input. The closure result is ignored.
Parameters:
Renders a simple single button, with the cell value set at its caption.
Called when the button is clicked. Receives the business data for given row as input. Closure result is ignored.
Creates a new button renderer with click listener.
Parameters:
Sets the click listener which is called when the button is clicked. The listener receives the business data for given row as input. The closure result is ignored.
Parameters:
Combo box form component
Creates a combobox with the given label and a simple value holder.
Parameters:
Creates a combobox with the given binding.
Parameters:
Creates a combobox that references the given variable/field and has the given caption.
Parameters:
Gets the hint text - a textual prompt that is displayed when the field would otherwise be empty, to prompt the user for input.
Returns:
Gets the page length (the number of options shown in the suggestion popup). Zero disables paging and shows all items. Default value is 10.
Parameters:
Sets the hint text - a textual prompt that is displayed when the field would otherwise be empty, to prompt the user for input. For example "A value in USD, omitting the dollar sign". The hint text is initially null.
Parameters:
Sets the page length (the number of options shown in the suggestion popup). Setting this to zero disables paging and shows all items. Default value is 10.
Parameters:
A reference binding with the reference to the value for the component.
reference to the value
Creates a binding which reads and writes the value for the component into given reference.
Parameters:
Returns:
Binding with the value for the component. It is mutable.
The value provided, may be null. Mutated by call to set(Object).
Creates the object binding and sets the value to the given value.
Parameters:
Returns:
Returns:
A default superclass for all forms.
To define an API for your form, just add methods to your form's object.
To add support for listeners, just introduce a method which takes a closure, and call the closure as needed.
To insert the reusable form programatically into layout components, just create the form via the new keyword, then call getWidget() to obtain the FormComponent, and finally insert the FormComponent itself into the layout.
Modeling id of the component. Do not use the field directly, use getModelingId and setModelingId methods instead.
Called exactly once, to create the widget contents.
Returns:
Gets the modeling ID of this component.
Returns:
Gets html id of this component as rendered on the page or null if there is no direct representation.
Returns:
Sets the modeling ID of this component.
Parameters:
A component which may contain invalid value.
Does not have support for adding validators, as this interface is also implemented by layout components which have no support for validators. You can only attach validators to subclasses of ComponentWithValue.
Checks if this component is valid - that is:
A component will not call Value.set() if the value is not valid. This causes bindings to be not updated and binding-based validations to work on old values.
Not all Validatables allow validators to be attached. For example component groups do not allow custom validators -they only validates its child components.
Only validators attached to component using addValidator
method influence the result. Error message set by FormComponent.setErrorMessage method does not influence the result. Data error messages distributed using by showConstraintViolations
visible from FormComponent.getDataErrorMessages dont influence the result either.
Returns:
true
if the component and all its child are valid, i.e. all validators attached to this component and to its descendants succeeded. Allow or disallow empty selection by the user. By default the null selection is allowed.
Parameters:
Sets a constant list of options to be shown in this select component. Choosing an item from options will write SelectItem.value to the underlying Value. By default the select has zero options.
Parameters:
Sets a constant list of options to be shown in this select component. The caption is computed by calling toString on the object. By default the select has zero options.
Parameters:
Sets a constant list of options to be shown in this select component. Choosing an item from the map will write the map's key to the underlying Value. By default the select has zero options.
Parameters:
Sets the available options for this selector to display. The DataSource provides business objects listed in the selector; choosing an item from options will write it to the underlying Value. By default the selector has zero options.
Parameters:
Creates a single-select-list with given label and simple value holder.
Parameters:
Creates a single-select-list with given label and given binding.
Parameters:
Creates a single-select-list with given label, referencing given variable/field.
Parameters:
Returns the number of rows to show in the list. If the number of rows is set 0, the actual number of displayed rows is determined implicitly by the adapter.
Returns:
Sets the number of rows in the editor. If the number of rows is set 0, the actual number of displayed rows is determined implicitly by the adapter.
Parameters:
Creates a new widget and adds it to the dashboard.
Parameters:
Returns the child components as a list. The list contains widgets content and toolbar components as well. If interested in widgets use #getWidgets() instead.
Returns:
Gets the modeling ID of this component.
Returns:
Gets html id of this component as rendered on the page or null if there is no direct representation.
Returns:
Returns all widgets currently added to this dashboard.
Returns:
Removes the widget from the dashboard. The widget must no longer be used.
Parameters:
Sets the listener handling the DashboardUpdateEvents.
Parameters:
Tooltip for maximize widget button.
Parameters:
Tooltip for minimize widget button.
Parameters:
Sets the modeling ID of this component.
Parameters:
The component, displayed by the widget.
Arbitrary data which you can use for any purpose. This field is not used by the Forms framework itself.
Gets the modeling ID of this component.
Returns:
Gets html id of this component as rendered on the page or null if there is no direct representation.
Returns:
Returns:
Sets the modeling ID of this component.
Parameters:
A popup window. By default the popup is not visible, you need to call setVisible(true), show() or showModal() to show it on screen. By default the popup is not modal, it is resizable, draggable and closable.
You can model a Grid- or Table-based popup, which reveals more data as the popup is resized. To achieve this, simply call the setSizeFull() method on the Popup's content. This will however make the popup to be initially zero-sized; to remedy this, simply call popup's setWidth("50%"); setHeight("50%") before it is shown. This will make the popup to take 50% of browser window's width and height and will center the popup in the browser window.
The Popup descends from a FormComponent, yet it is an error to add the popup to any ComponentGroup: the Popup is not part of the UI component tree, but rather it floats over the components and "starts" its own component hierarchy.
Creates a popup with given component as its contents. The popup is initially invisible.
Parameters:
Returns:
Shortcut for setVisible(false)
Returns:
Returns the closable status of the popup. If a popup is closable, it typically shows an X in the upper right corner. Clicking on the X sends a close event to the server. Setting closable to false will remove the X from the popup and prevent the user from closing the popup.
By default the popup is closable.
Returns:
Indicates whether a window can be dragged or not. By default a window is draggable.
Returns:
Gets window modality. When a modal window is open, components outside that window cannot be accessed. Keyboard navigation is restricted by blocking the tab key at the top and bottom of the window by activating the tab stop function internally.
By default the popup is not modal.
Returns:
true if window is resizable by the end-user, otherwise false. Defaults to true.
Returns:
Sets the closable status for the popup. If a popup is closable it typically shows an X in the upper right corner. Clicking on the X sends a close event to the server. Setting closable to false will remove the X from the popup and prevent the user from closing the popup.
By default the popup is closable.
Parameters:
Indicates whether a window can be dragged or not. By default a window is draggable.
Parameters:
Sets window modality. When a modal window is open, components outside that window cannot be accessed. Keyboard navigation is restricted by blocking the tab key at the top and bottom of the window by activating the tab stop function internally.
By default the popup is not modal.
Parameters:
Sets the popup close listener which is notified on the popup close event.
Parameters:
true if window is resizable by the end-user, otherwise false. Defaults to true.
Parameters:
Shortcut for setVisible(true)
Returns:
Shortcut for setModal(true); setVisible(true)
Returns:
Adding components to the tab sheet will create tab for every individual component. You can then use the getTab() methods to return the Tab object which further controls the tab - you can set the tab's caption etc.
Helper method for quickly creating a tab with given caption. If the tab sheet already contains contents, existing tab caption is updated.
Parameters:
Returns:
Returns selected tab. Returns null if the tab sheet has no tabs.
Returns:
Returns a tab for given child component. Fails if there is no such child component.
Parameters:
Returns:
Returns a tab for given child component. Fails if there is no such child component.
Parameters:
Returns:
Gets the listener invoked when the current tab is changed
Parameters:
Selects given tab. The tab must belong to this TabSheet. Cannot be null - if the TabSheet has tabs, one must be selected at all times.
Parameters:
Selects tab by its position in tab sheet. Indexing starts at 0. Such tab must exist, the method fails if the argument is either negative or too big.
Parameters:
Sets the listener invoked when the current tab is changed.
Parameters:
Modeling id of the component. Do not use the field directly, use getModelingId and setModelingId methods instead.
Arbitrary data which you can use for any purpose. This field is not used by the Forms framework itself.
Returns the caption of this tab.
Returns:
Returns the content component of this tab. Never null.
Returns:
Gets the tab error message.
Returns:
null
Gets the description for the tab. The description can be used to briefly describe the state of the tab to the user, and is typically shown as a tooltip when hovering over the tab.
Returns:
Gets the modeling ID of this component.
Returns:
Gets the user-defined CSS style name of the tab. Built-in style names defined in Vaadin or GWT are not returned.
Returns:
Gets html id of this component as rendered on the page or null if there is no direct representation.
Returns:
Returns the enabled status for the tab. A disabled tab is shown as such in the tab bar and cannot be selected.
Returns:
Returns the visible status for the tab. An invisible tab is not shown in the tab bar and cannot be selected. By default the tab is visible.
Returns:
Sets the caption of this tab. The caption is shown in the TabSheet itself.
Parameters:
Sets custom error message to this tab. If the error message is not null, the tab is marked with a red exclamation mark. The error message is visible on mouse over.
Parameters:
null
Sets the description for the tab. The description can be used to briefly describe the state of the tab to the user, and is typically shown as a tooltip when hovering over the tab.
Parameters:
Sets the enabled status for the tab. A disabled tab is shown as such in the tab bar and cannot be selected.
Parameters:
Sets the icon for the tab.
Parameters:
Sets the modeling ID of this component.
Parameters:
Sets a style name for the tab. The style name will be rendered as a HTML class name, which can be used in a CSS definition.
Tab tab = tabsheet.addTab(tabContent, "Tab text"); tab.setStyleName("mystyle");
The used style name will be prefixed with " v-tabsheet-tabitemcell-". For example, if you give a tab the style "mystyle", the tab will get a " v-tabsheet-tabitemcell-mystyle" style. You could then style the component with:
.v-tabsheet-tabitemcell-mystyle {font-style: italic;}
This method will trigger a RepaintRequestEvent on the TabSheet to which the Tab belongs.
Parameters:
Sets the visible status for the tab. An invisible tab is not shown in the tab bar and cannot be selected, selection is changed automatically when there is an attempt to select an invisible tab.
Parameters:
Creates a multi select list with given label and simple value holder.
Parameters:
Creates a multi select list with given label and given property.
Parameters:
Creates a multi select list with given label, referencing given variable/field.
Parameters:
Returns the number of rows to show in the list. If the number of rows is set 0, the actual number of displayed rows is determined implicitly by the adapter.
Returns:
Sets the ReferenceValue being displayed by this component. By default a simple value with the initial value of null is displayed. The component is automatically refreshed. If the reference is null, previous reference is cleared and field is empty.
Parameters:
Sets the number of rows in the editor. If the number of rows is set 0, the actual number of displayed rows is determined implicitly by the adapter.
Parameters:
Adds a component to the grid, at given column and row, occupying one cell. Fails if the cell is already occupied by some other component. The grid is automatically enlarged, to accomodate the new component.
Parameters:
Adds a component to the grid, at given column and row. Fails if the cells to be taken are already occupied by some other component. The grid is automatically enlarged, to accomodate the new component.
Parameters:
Returns the current column expand ratio. See setColumnExpandRatio() for details.
Parameters:
Returns:
Gets the Component at given index.
Parameters:
Returns:
Returns the current row expand ratio. See setRowExpandRatio() for details.
Parameters:
Returns:
Sets the expand ratio of given column. Defaults to null.
The expand ratio defines how excess space is distributed among columns. Excess space means space that is left over from components that are not sized relatively. By default, the excess space is distributed evenly.
Note that the component width of the GridLayout must be defined (fixed or relative, as opposed to undefined) for this method to have any effect.
Parameters:
Sets the expand ratio of given row. Defaults to null.
Expand ratio defines how excess space is distributed among rows. Excess space means the space left over from components that are not sized relatively. By default, the excess space is distributed evenly.
Note, that height of this GridLayout needs to be defined (fixed or relative, as opposed to undefined height) for this method to have any effect.
Note that checking for relative height for the child components is done on the server so you cannot set a child component to have undefined height on the server and set it to 100%
in CSS. You must set it to 100%
on the server.
Parameters:
Returns the current table data source.
Returns:
Returns:
Sets a new column order for the table. All columns which are not ordered here will remain in the order they were before as the last columns of table.
Parameters:
Sets a new column order for the table. All columns which are not ordered here will remain in the order they were before as the last columns of table.
Parameters:
Sets a new data source to this table. The table automatically refreshes itself.
Parameters:
Returns:
Sets the style generator that is used for generating styles for rows. The generator obtains a row objects and returns style name. The CSS class name that will be added to the row is v-table-row-[style name].
Parameters:
null
to remove a previously set generator Defines a table column.
To model a column with the "Delete" or "Edit" action link just use the IdentityValueProvider - this way, the link will gain access to the entire Record and can delete it easily.
Filled when the column is assigned to a table. The column may be assigned to at most one table.
Extracts column values from rows. Not null.
If null or true, allows sorting by this column. Expects the value provider to return Comparable types.
Takes row as a parameter and returns value to be used when sorting by column. If it is null, sort will use value provider.
If null or true, allows filtering for this column. The filter is auto-generated based on the value type. The auto-generated filter can be configured by the filter configuration provided by the filterConfig attribute.
Configuration for the auto-generated column filter. If this attribute contains instance of OptionsFilterConfig the filter component is rendered as a combo box or in case of multi-select mode as a multi select list.
Takes row as a parameter and returns value to be used when by column filter. If it is null, filter will use value provider.
Creates a component for given row-extracted data. For every table cell a fresh component will be created. This approach is very flexible, but also quite heavyweight, both on the server and on the browser. If possible, use Grid and Renderers - they are way more lightweight.
If the closure is itself null, the value will simply be rendered as a String. If the closure returns null, nothing will be rendered in that particular cell.
Modeling id of the component. Do not use the field directly, use getModelingId and setModelingId methods instead.
Arbitrary data which you can use for any purpose. This field is not used by the Forms framework itself.
Returns the current column's child alignment, with respect to the column itself. Defaults to left alignment.
Returns:
Returns form component rendered in this column in row generated from rowItem. May return null if the row is scrolled out of view or if the column does not have component configured.
Returns:
Returns the current expand ratio.
Returns:
Returns the column header for this column. The column must be assigned to a table.
Returns:
Returns the current column's header alignment. Defaults to left alignment.
Returns:
Gets the modeling ID of this component.
Returns:
Gets html id of this component as rendered on the page or null if there is no direct representation.
Returns:
Returns the column width in pixels.
Returns:
Returns whether the specified column is collapsed or not.
Returns:
Checks if the given column is collapsible. Note that even if this method returns true
, the column can only be actually collapsed (via UI or with setColumnCollapsed()) if isColumnCollapsingAllowed() is also true.
Returns:
Returns true if the table is sorted in ascending order and false if it is sorted in descending order. Can return anything for unsorted columns.
Returns:
Returns whether the table is sorted by the specified column
Returns:
Sets the specified column's child component alignment inside of the column. In order for this to work, set the child's width to wrap contents (using FormComponent.setWidthWrap() for example), otherwise the child will just fill the column and there will be no space for the alignment flag to move the child.
Ignores the vertical aspect of the alignment - only the horizontal aspect is applied.
Parameters:
Sets whether the specified column is collapsed or not. Fails if column collapsing is not allowed. By default the column is not collapsed.
Parameters:
Sets whether the given column is collapsible. Note that collapsible columns can only be actually collapsed (via UI or with setColumnCollapsed()) if isColumnCollapsingAllowed() is true. By default all columns are collapsible.
Parameters:
Sets the column expand ratio for given column.
Expand ratios can be defined to customize the way how excess space is divided among columns. CustomTable can have excess space if it has its width defined and there is horizontally more space than columns consume naturally. Excess space is the space that is not used by columns with explicit width (see setColumnWidth(Decimal)) or with natural width (no width nor expand ratio).
By default (without expand ratios) the excess space is divided proportionally to columns natural widths.
Only expand ratios of visible columns are used in final calculations.
Column can either have a fixed width or expand ratio. The latter one set is used.
A column with expand ratio is considered to be minimum width by default (if no excess space exists). The minimum width is defined by terminal implementation.
If terminal implementation supports re-sizable columns the column becomes fixed width column if users resizes the column.
Parameters:
Sets the column header for this column. The column must be assigned to a table.
Parameters:
Sets the specified column's header alignment.
Ignores the vertical aspect of the alignment - only the horizontal aspect is applied.
Parameters:
Sets a style name which should be applied to the header content of this column.
Parameters:
Sets the modeling ID of this component.
Parameters:
Sets whether the specified column is used for table sort or not. The column will be in ascending order.
Parameters:
Sets whether the specified column is used for table sort or not and whether it should be ascending or descending.
Parameters:
Sets columns width (in pixels). Theme may not necessary respect very small or very big values. Setting width to -1 or null (default) means that theme will make decision of width.
Column can either have a fixed width or expand ratio. The latter one set is used. See setExpandRatio().
Parameters:
Creates a multi-select checkbox list with given label and simple value holder.
Parameters:
Creates a multi-select checkbox list with given label and given property.
Parameters:
Creates a multi-select checkbox list with given label, referencing given variable/field.
Parameters:
Returns the current orientation.
Returns:
Sets the ReferenceBinding being displayed by this component. By default an ObjectBinding with the initial value of null is displayed. The component is automatically refreshed.
Parameters:
Sets the checkbox list orientation. Default orientation is vertical.
Parameters:
Creates a single-select radiobutton list with given label and simple value holder.
Parameters:
Creates a single-select radiobutton list with given label and given property.
Parameters:
Creates a single-select radiobutton list with given label, referencing given variable/field.
Parameters:
Returns the current orientation.
Returns:
Sets the ReferenceValue being displayed by this component. By default a simple value with the initial value of null is displayed. The component is automatically refreshed. If the reference is null, previous reference is cleared and field is empty.
Parameters:
Sets the radiobutton list orientation. Default orientation is vertical.
Parameters:
Shows String values only. Always convertible.
Creates a text area with given label and simple value holder.
Parameters:
Creates a text area with given label and given binding.
Parameters:
Creates a text area with given label, referencing given variable/field.
Parameters:
Returns the maximum allowed number of rows that the textarea in expandable mode will grow to. Default is null that means that there is no limit for growing.
Returns:
Returns the minimum allowed number of rows that the textarea in expandable mode will shrink to.Default is null that means that the limit is 1.
Note: the value is ignored if the textarea is not in expandable mode
Returns:
Returns the number of rows to shown in the text area when it is in non expandable mode.
Returns:
Should last row always be an empty row?
Returns:
Returns:
Should last row always be an empty row? The value is ignored if the textarea is not in expandable mode. The empty row is added only while scroll bars are not visible, e.g. while text area is exanading. There is no additional empty row if text area already reached max rows size.
Parameters:
Switch between expandable and normal mode. Textarea in expandable mode grows/shrinks with content within #getMaxRows() and #getMinRows() boundaries.
Parameters:
Sets the maximum allowed number of rows that the textarea in expandable mode will grow to. Default is null that means that there is no limit for growing.
Note: the value is ignored if the textarea is not in expandable mode
Parameters:
Sets the minimum allowed number of rows that the textarea in expandable mode will shrink to.
Parameters:
Sets the number of rows in the text area. If the number of rows is 0, the default number determined by the component is used.
Note: the value is ignored if the textarea is in expandable mode
Parameters:
Shows String values only. Always convertible.
Gets the hint text - a textual prompt that is displayed when the field would otherwise be empty, to prompt the user for input.
Returns:
Returns the maximum number of characters in the field. null is considered unlimited. Terminal may however have some technical limits.
Returns:
Returns:
getValue
method, this returns whatever is in field including invalid values. Returns:
Use getUserText() method to acquire text as written by user.
Sets the ReferenceValue being displayed by this component. By default a simple value with the initial value of null is displayed. The component is automatically refreshed. If the reference is null, previous reference is cleared and field is empty.
Parameters:
Sets the hint text - a textual prompt that is displayed when the field would otherwise be empty, to prompt the user for input. For example "A value in USD, omitting the dollar sign". The hint text is initially null.
Parameters:
Sets the maximum number of characters in the field. Value -1 is considered unlimited. Terminal may however have some technical limits.
Parameters:
A custom field where there is a single primary field holding the value, and a couple of other components decorating around the component. Think a date field with a date picker button, a decimal field with a label showing the currency, etc. This class automatically delegates all relevant ComponentWithValue's methods to the primary field, you just need to implement the getDelegate() method which returns the primary field itself.
Returns the primary field where all data-related calls are delegated to. This method may be called multiple times - it must not create new fields with every call; instead, it must return a single instance. It is recommended to create all UI components in the constructor, store them in private fields and return them here.
Returns:
A ComponentWithValue whose UI content can be constructed by the user, enabling the creation of e.g. form fields by composing Vaadin components. Customization of both the visual presentation and the logic of the field is possible.
It is recommended to create all UI components in the constructor, store them in private fields and return them here.
Subclasses must implement the getContent() method.
It is recommended to override the valueChanged() method to detect the new value and update the inner components accordingly. To set a new value, simply call setValue() on yourself.
An editable (and focusable) version of ComponentWithValue. All data-modifying fields inherit from this class.
Registers given validator to run on the component value; the validator must return a non-null error message when the value is invalid.
Parameters:
Gets the currently installed value change listener
Returns:
Gets the currently installed valid value change listener
Returns:
Infers the validator from the binding provided by the Value. Fails if Value.getBinding() returns null.
Parameters:
Returns the immediate mode of the component.
Certain operations such as adding a value change listener will set the component into immediate mode if #setImmediate(boolean) has not been explicitly called with false.
Returns:
Checks if the component is visually marked as required to have a value.
Returns:
Sets the component's immediate mode to the specified status.
Parameters:
Sets the value change listener for this component. Only one value change listener may be attached to a component - previous value change listener is automatically unregistered. The component implicitly becomes immediate, unless it was explicitly marked as non-immediate, by calling setImmediate(false).
Parameters:
Sets the valid value change listener for this component. Valid value listener is value was changed and new value is valid (passes all the validators).
Only one value change listener may be attached to a component - previous value change listener is automatically unregistered. The component implicitly becomes immediate, unless it was explicitly marked as non-immediate, by calling setImmediate(false).
Parameters:
If set to true, this component will be visually marked as required but no additional validator is appended to the field.
Parameters:
The Repeater is basically a horizontal or vertical layout.
Prevents multiple initialization when the component is first time rendered. See #refresh method for details
Creates a repeater which lays out components for every row object vertically or horizontally. Do not forget to set the data source (which will produce row objects for the Repeater), via the #setDataSource() function.
Parameters:
Gets the expand ratio which set to the container this repeater generates.
Returns:
Gets the modeling ID of this component. This modeling id is set to layout container component upon its creation. Note: if the rendered itself apppears on page multiple times, the rendered id is different. Each copy gets unique suffix.
Returns:
Gets html id of this component as rendered on the page.
Returns:
Sets the expand ratio to the container generated by this repeater.
Parameters:
Sets the modeling ID of this component. This modeling id is set to layout container component upon its creation. Note: if the rendered itself apppears on page multiple times, the rendered id might not exactly match configured id. Each html component copy gets unique suffix.
Parameters:
Renders given string as a HTML.
Panel - a simple single component container. Able to scroll its children component.
All components marked by this interface may have child components.
Returns the child components as a list.
Returns:
This kind of component may have at most one child.
If there is no content set to this container by the call to #setContent() and this component instance is attached to the screen for the first time, this method is called once to produce the container contents.
This method is particularly helpful when modeling a form which extends a container component: the PDS will override this method, which will now produce the component designed by the user.
Called exactly once, to create the widget contents.
Returns:
Returns the current content component.
Returns:
Sets the content component of this container. By default the container has no content.
Parameters:
Allows its child to collapse, rendering itself as a thin bar. Upon clicking, the bar is expanded back (uncollapsed) to show the child.
Returns the collapsed state of the component. When the component is collapsed, its content is not shown - instead, only a thin bar with the caption is shown. By default the component is not collapsed.
Returns:
Sets the collapsed state of the component. When the component is collapsed, its content is not shown - instead, only a thin bar with the caption is shown. By default the component is not collapsed.
Parameters:
Creates a new Image with a caption. Initially, no image is shown - call setSource() to actually show an image.
Parameters:
Sets the image resource. The dimensions are assumed if possible.
Parameters:
Allows the user to upload a file.
Invoked when a file has been uploaded. In case of success, the File will not be null. If the upload failed, the file will be null and the second parameter will be a non null error message.
Returns the currently accepted mime types. Please see http://www.w3schools.com/tags/att_input_accept.asp for details.
Returns:
Returns:
Returns the immediate mode of the component.
Certain operations such as adding a value change listener will set the component into immediate mode if #setImmediate(Boolean) has not been explicitly called with false.
Returns:
Indicates whether this component was marked as required.
Returns:
Updates the input accept attribute. This determines which files are visible in Open file dialog by default. Most common mime types are "text/plain" for text files and "application/octet-stream" for binary files or unknown files. Note: this influences the default file selection, but user still can change the Open file dialog filter and submit different kind of file. Server side validation needs to be implemented by modeler.
A list of most common mime-types: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types
Parameters:
audio/*,video/*,image/*
. Pass null to remove the attribute. In addition to the actual file chooser, upload components have button that starts actual upload progress. This method is used to set text in that button.
The button caption must not be null.
In case the Upload is used in immediate mode using #setImmediate(boolean), the file choose (html input with type "file") is hidden and only the button with this text is shown.
Note the string given is localized by this method and set to the button. HTML formatting is not stripped. Be sure to properly validate your value (including localized version) to your needs.
Parameters:
Sets how token field looks like: combo box or text field.
Convenience method, does the same thing as calling setImmediate(true) and setImmediate(false).
Sets the component's immediate mode to the specified status. Setting upload component immediate initiates the upload as soon as a file is selected, instead of the common pattern of file selection field and upload button.
Parameters:
Sets the required flag to the upload component.
Parameters:
Sets the listener which is notified when a file has been uploaded. In case of success, the parameter File will not be null. If the upload failed, the file will be null and the second parameter will be a non null error message.
Parameters:
Renders an image. The cell value is expected to be a ThemeResource or an ExternalResource. If the cell value is non of the mentioned resource types then it needs to be converted first to one of the mentioned types. The conversion can be done by providing an ImageValueConverter to the 'converter' field.
Called when the button is clicked. Receives the business data for given row as input. Closure result is ignored.
The converter which converts the cell value to an image resource.
Returns:
Sets the click listener which is called when the button is clicked. The listener receives the business data for given row as input. The closure result is ignored.
Parameters:
Sets the converter which converts the cell value to an image resource.
Parameters:
Creates a single-select-list with given label and simple value holder.
Parameters:
Creates a single-select-list with given label and given binding.
Parameters:
Creates a single-select-list with given label, referencing given variable/field.
Parameters:
Sets a closure which is used by the tree to decide whether to expand a tree item. The closure receives item's data and the item's depth, and returns true if the item should be expanded or false otherwise. Root items have the depth of 0, their children have the depth of 1, etc.
Parameters:
Sets the available options for this Tree to display. The DataSource provides business objects listed in the tree; choosing an item from options will write it to the underlying Value. By default the tree has zero options.
Parameters:
a closure handling the map click
Adds a marker to the map.
Parameters:
Returns:
Returns:
Returns:
Removes the marker from the map.
Parameters:
Positions the location specified by the coordinates to the map center.
Parameters:
Positions the location specified by [latitude, longitude] to the map center.
Parameters:
Sets the listener handling map clicks.
Parameters:
Sets the listener handling clicks on map markers.
Parameters:
Sets the map zoom level.
Parameters:
business data
the marker business data
This event indicates that a marker has been dragged. The marker's coordinates is updated to the new location. Its co
The marker which has been dragged. Consulting it's location will return the updated value.
Returns the current table data source.
Returns:
Sets a new data source to this table. The table automatically refreshes itself.
Parameters:
Returns:
Sets a closure which is used by the tree table to decide whether to expand a tree item. The closure receives item's data and the item's depth, and returns true if the item should be expanded or false otherwise. Root items have the depth of 0, their children have the depth of 1, etc.
Parameters:
Table is more heavyweight than the Grid, but also more flexible. Instead of a limited Renderer, you can place a full-blown FormComponent into the cells.
Adds a column to this table. You can call this before or after the data source has been set.
Parameters:
Returns:
Adds a column to this table. You can call this before or after the data source has been set.
Parameters:
Returns:
Returns the number of components currently rendered by this table.
Returns:
Returns a list of all components rendered in this table. The order of the returned components is unspecified.
1.) If the datasource contains more rows/pages then is currently visible on page, not yet loaded rows are ignored. 2.) Rows hidden under scroll bar, but still loaded are count as 'rendered'.
Example: if the table contains two columns with modelled component in them, has page size 10 and shows 3 pages, the method will return 2*3*10 = 60 components.
Returns:
Returns the current page length. Please see setPageLength() for more information.
Returns:
Returns the currently selected row object. The row was selected either by user clicking on the grid row, or by calling select() programatically. Initially, there is no object selected.
Returns:
Checks if column collapsing is allowed.
Returns:
Sets whether column reordering is allowed or not - that is, whether the user can drag a column to the new location or not. Defaults to true.
Returns:
Indicates whether the filtering on the table is enabled or not.
Returns:
Marks an item as selected. Unselects all other items. The row object must have been provided by the DataSource. Only single-selections are supported at the moment. Calling select(null) clears the selection. Fails if the table is not selectable.
Parameters:
Sets whether column collapsing is allowed or not. By default this value is set to true.
Parameters:
Sets whether column reordering is allowed or not - that is, whether the user can drag a column to the new location or not. By default this value is set to true.
Parameters:
Sets a column resize listener to this table. Replaces any previously set column resize listener. Setting null will remove any previously set column resize listener.
Parameters:
Enables/disables the filtering on this table. Disabling the filtering also clears any currently set filter.
Parameters:
Sets the table page length. This setting influences both the internal row batch fetching size, and the table height:
It is not possible to limit the table height (that is, wrap at most x rows, shrink horizontally when there is less data).
Use-cases:
Parameters:
Instructs the browser to return only geoposition with e.g. given accuracy or age.
The enableHighAccuracy attribute provides a hint that the application would like to receive the best possible results.
This may result in slower response times or increased power consumption. The user might also deny this capability,
or the device might not be able to provide more accurate results than if the flag wasn't specified.
The intended purpose of this attribute is to allow applications to inform the implementation that they
do not require high accuracy geolocation fixes and, therefore, the implementation can avoid using geolocation
providers that consume a significant amount of power (e.g. GPS). This is especially useful for applications running
on battery-powered devices, such as mobile phones.
If the PositionOptions parameter to getCurrentPosition or watchPosition is omitted, the default value used for the enableHighAccuracy attribute is false.
The same default value is used in ECMAScript when the enableHighAccuracy property is omitted.
The timeout attribute denotes the maximum length of time (expressed in milliseconds) that is allowed to pass from the call
to Forms.detectLocation() until the corresponding resultCallback is invoked. If the implementation is unable to
successfully acquire a new Geoposition before the given timeout elapses, and no other errors have occurred in this interval,
then the corresponding GeolocationEvent.failure must be set with a GeolocationError object whose code attribute is set to GeolocationError.Timeout.
Note that the time that is spent obtaining the user permission is not included in the period covered by the timeout attribute.
The timeout attribute only applies to the location acquisition operation.
If the PositionOptions parameter to Forms.detectLocation() is omitted,
the default value used for the timeout attribute is infinity. If a negative value is supplied, the timeout value is considered to be 0.
The same default value is used in ECMAScript when the timeout property is omitted.
The maximumAge attribute indicates that the application is willing to accept a cached position whose age is no greater than the specified time in milliseconds.
If maximumAge is set to 0, the implementation must immediately attempt to acquire a new position object. If an implementation does not have a cached
position available whose age is no greater than the specified maximumAge, then it must acquire a new position object.
If the PositionOptions parameter to Forms.detectLocation() is omitted, the default value used for
the maximumAge attribute is 0. If a negative value is supplied, the maximumAge value is considered to be 0.
The same default value is used in ECMAScript when the maximumAge property is omitted.
Contains details received from browsers HTML5 geolocation request. Note that on some devices selected fields may be null.
The geographic coordinate reference system used by the attributes is the World Geodetic System (2d) aka WGS84 aka EPSG:4326.
Use Forms.detectLocation() to obtain instance of this class.
The geographic position, not null.
The accuracy of the position information in meters. Not null.
The height of the position, specified in meters above the ellipsoid or null if device cannot provide the information.
The accuracy of the altitude informations in meters or null.
Denotes the direction of travel of the hosting device and is specified in degrees, where 0° <= heading < 360°, counting clockwise relative to the true north. Null if device don't support it or it is not moving.
The magnitude of the horizontal component of the hosting device's current velocity and is specified in meters per second. If the implementation cannot provide speed information, the value of this attribute must be null. Otherwise, the value of the speed attribute must be a non-negative real number.
The GeolocationEvent is fired by the Forms.detectLocation() method after the geographical position of the user has been acquired or when the request for location times out.
When a geolocation request succeeds, this value will contain a non-null position.
When a geolocation request fails, this field will contain the error cause.
Caption of the calendar item.
Start date of the calendar item. This attribute is mandatory.
End date of the calendar item. This attribute is mandatory.
If true, the calendar item should be rendered as all-day event.
A business data related to this calendar event.
Loads calendar items for the specified date range
Parameters:
Returns:
Creates a list based calendar item provider.
Parameters:
Creates a new calendar event provider which internally uses the provided closure to obtain calendar entries for a target range
Parameters:
Sets the calendar item provider to this calendar. The item provider is used to load the calendar items.
Parameters:
Sets the calendar mode.
Parameters:
Sets the create listener. The listener is notified when the calendar produces a create event which signals that a new calendar event should be created.
Parameters:
Sets the edit listener. The listener is notified when the calendar produces an edit event which signals that a exiting calendar event should be edited.
Parameters:
Sets the initial date of the calendar. The initial date is used to determine the date range displayed by the calendar.
Parameters:
Sets the reschedule listener. The listener is notified when the calendar produces a reschedule event which signals that an existing calendar event should be rescheduled.
Parameters:
Width in DIPs.
Height in DIPs.
A group of components which explicitly maintains ordering of the child components.
Adds a component into indexed position in this container.
Parameters:
Creates a text field with given label and simple value holder.
Parameters:
Creates a text field with given label and given binding.
Parameters:
Creates a text field with given label, referencing given variable/field.
Parameters:
A read-only binding with the value wrapped in a closure that is evaluated every time the get() method is called.
Called when get() is called. Never null.
Returns the value of the ClosureBinding.
Returns:
Returns null since the binding is not a record and property.
Returns:
Returns an error since the value of the ClosureBinding is read-only.
Returns:
The date format pattern. For the format pattern syntax see http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
Returns:
Sets the date format pattern. For the format pattern syntax see http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
Parameters:
The number format pattern. For the format pattern syntax see https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html.
Returns:
Sets the number format pattern. For the format pattern syntax see https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html.
Parameters:
Renderes given enumeration value as a string.
Allows to download a resource. It can be rendered as a Button or a Link depending on the style which is set.
Creates a new download componet with the given caption, resource and style.
Parameters:
Fired when the selected tab is changed in the TabSheet. This event is fired both by user (when the user clicks through the tabs) and programatically (for example when adding tab to an empty tab sheet).
True if the popup was closed via close button on the popup. False if the popup was closed programmatically or if the app navigated away.
A simple action link which is similar to a Button - that is, it has a click listener.
Called when the button is clicked. Only one click listener may be attached.
Creates an action link with given caption. Clicking on the link does nothing - change the #onClick closure to register the click listener.
Parameters:
Creates an action link with given caption and given click listener.
Parameters:
Checks whether captions are rendered as HTML
The default is false, i.e. to render that caption as plain text.
Returns:
Returns:
Sets whether the caption is rendered as HTML.
If set to true, the captions are rendered in the browser as HTML and the developer is responsible for ensuring no harmful HTML is used. If set to false, the caption is rendered in the browser as plain text.
The default is false, i.e. to render that caption as plain text.
Parameters:
Sets the listener for the click events.
Parameters:
A component which may receive keyboard focus.
Gets the tabulator index of the Focusable component.
Returns:
Sets the tabulator index of the Focusable component. The tab index property is used to specify the order in which the fields are focused when the user presses the Tab key. Components with a defined tab index are focused sequentially first, and then the components with no tab index.
After all focusable user interface components are done, the browser can begin again from the component with the smallest tab index, or it can take the focus out of the page, for example, to the location bar.
If the tab index is not set (is set to zero), the default tab order is used. The order is somewhat browser-dependent, but generally follows the HTML structure of the page.
A negative value means that the component is completely removed from the tabulation order and can not be reached by pressing the Tab key at all.
Parameters:
A simple button.
Called when the button is clicked. Only one click listener may be attached.
Creates a button with given caption. Clicking on the button does nothing - change the #onClick closure to register the click listener.
Parameters:
Creates a button with given caption and given click listener.
Parameters:
Checks whether captions are rendered as HTML
The default is false, i.e. to render that caption as plain text.
Returns:
Returns:
Sets whether the caption is rendered as HTML.
If set to true, the captions are rendered in the browser as HTML and the developer is responsible for ensuring no harmful HTML is used. If set to false, the caption is rendered in the browser as plain text.
The default is false, i.e. to render that caption as plain text.
Parameters:
Sets the listener for the click events.
Parameters:
Makes it possible to invoke a click on this button by pressing the given KeyCode and (optional) ModifierKeys. The shortcut is global (bound to the containing Window).
Parameters:
The Link component differs to ActionLink in that it does not have a click listener - instead, it can only navigate the user to a particular URL. However, it is able to open the link in a new window.
Checks whether captions are rendered as HTML
The default is false, i.e. to render that caption as plain text.
Returns:
Returns:
Sets whether the caption is rendered as HTML.
If set to true, the captions are rendered in the browser as HTML and the developer is responsible for ensuring no harmful HTML is used. If set to false, the caption is rendered in the browser as plain text.
The default is false, i.e. to render that caption as plain text.
Parameters:
Configures this link to perform given navigation upon clicking.
Parameters:
Sets whether the link should open in new tab/window or not. Overrides the openNewTab
property in navigation object. If the value is:
null
- (default) the behavior depends on the value of openNewTab
property of navigation objecttrue
- the link is opened in tab/window regardless of openNewTab
propertyfalse
- the link is opened in this tab regardless of openNewTab
propertyParameters:
Configures this link to navigate to given URL.
Parameters:
An item in the context menu.
Creates a token field with given label and simple value holder.
Parameters:
Creates a token field with given label and given property.
Parameters:
Creates a token field with given label, referencing given variable/field.
Parameters:
Returns:
true
if the field shows selected tokens among its suggestions, false
otherwise. Sets the ReferenceValue being displayed by this component. By default a simple value with the initial value of null is displayed. The component is automatically refreshed. If the reference is null, previous reference is cleared and field is empty.
Parameters:
Configures whether token field should show selected tokens from the user.
Parameters:
true
, token field will NOT show selected tokens among suggestions. If it is false
, selected token fields will be suggested. Sets a constant list of options to be shown in this select component. Choosing an item from options will write SelectItem.value to the underlying Value. By default the select has zero options.
Parameters:
Sets a constant list of options to be shown in this select component. The caption is computed by calling toString on the object. By default the select has zero options.
Parameters:
Sets a constant list of options to be shown in this select component. Choosing an item from the map will write the map's key to the underlying Value. By default the select has zero options.
Parameters:
Sets the available options for this selector to display. The DataSource provides business objects listed in the selector; choosing an item from options will write it to the underlying Value. By default the selector has zero options.
Parameters:
Creates a rich text area with given label and simple value holder.
Parameters:
Creates a rich text area with given label and given binding.
Parameters:
Creates a rich text area with given label, referencing given variable/field.
Parameters:
Returns:
getValue
method, this returns whatever is in field including invalid values. Filters generated from this config will be assigned this id.
A configuration of a filter providing a set of options.
Options to allow to filter by.
Allows to set the pre-selected options to filter by when filter is set from model.
Whether to allow to filter by multiple selected options.
Number of visible rows in drop down list. If it is 0 or null, the framework will determine number of rows automatically.
A configuration for the date filter.
Less than date.
More than date.
The format pattern as specified by the java.text.SimpleDateFormat. This value is optional.
A configuration for the regular expression filter.
The pattern (java.util.regex.Pattern).
A configuration for the substring filter.
The substring to filter by.
A configuration for the numeric filter.
Less than value.
Equal value.
More than value.
By default, pdf viewer remembers last opened page, zoom, scroll position and sidebar position for each opened pdf. When the same pdf is opened second time in the same browser, it is opened at last read page. This method is able to turn on/off this functionality.
Parameters:
false
, pdf will be opened on the first page with default settings regardless of where it was opened last time. Sets the pdf resource.
Parameters:
Invoked when a file has been uploaded. In case of success, the File will not be null. If the upload failed, the file will be null and the second parameter will be a non null error message.
Enables and disables dropzone. If the parameter is false
, dropzone wont accept any files.
Parameters:
true
it the dropzone should accept files, false
otherwise Maximum amount of files that have to be dropped into dropzone at once.
Parameters:
maxFiles
* dropzone will accept less then this amount of files Minimum amount of files that have to be dropped into dropzone at once.
Parameters:
minFiles
* dropzone will accept less then this amount of files Sets the listener which is notified when all dropped files have been uploaded. The parameter List\<File\>
contains list of all succesfully uploaded files. Failures are collected in the List\<String\>
parameter.
Parameters:
Creates a search combobox with given label and simple value holder.
Parameters:
Creates a search combobox with given label and given property.
Parameters:
Creates a search combobox with given label, referencing given variable/field.
Parameters:
Search combo-box does not refresh drop down content until user stopped typing for timeout
milliseconds.
Returns:
Gets the hint text - a textual prompt that is displayed when the field would otherwise be empty, to prompt the user for input.
Returns:
The minimal length the text typed into the combo box must have in order to be used for filtering. Text longer then minFilterLength is used as a filter for drop down options - only options containing typed substring are available.
Shorter text typed into the combo-box is ignored and all options are shown.
Returns:
Gets the page length (the number of options shown in the suggestion popup). Zero disables paging and shows all items. Default value is 10.
Parameters:
Returns:
Set the filter into either case sensitive or case insensitive mode.
Parameters:
Search combo-box does not refresh drop down content until user stopped typing for timeout
milliseconds.
Parameters:
Sets the hint text - a textual prompt that is displayed when the field would otherwise be empty, to prompt the user for input. For example "A value in USD, omitting the dollar sign". The hint text is initially null.
Parameters:
The minimal length the text typed into the combo box must have in order to be used for filtering. Text longer then minFilterLength is used as a filter for drop down options - only options containing typed substring are available.
Shorter text typed into the combo-box is ignored and all options are shown.
Parameters:
Sets the page length (the number of options shown in the suggestion popup). Setting this to zero disables paging and shows all items. Default value is 10.
Parameters:
Creates a combobox with given label and simple value holder.
Parameters:
Creates a combobox with given label and given property.
Parameters:
Creates a combobox with given label, referencing given variable/field.
Parameters:
Gets the hint text - a textual prompt that is displayed when the field would otherwise be empty, to prompt the user for input.
Returns:
Gets the page length (the number of options shown in the suggestion popup). Zero disables paging and shows all items. Default value is 10.
Parameters:
Sets the hint text - a textual prompt that is displayed when the field would otherwise be empty, to prompt the user for input. For example "A value in USD, omitting the dollar sign". The hint text is initially null.
Parameters:
Sets the page length (the number of options shown in the suggestion popup). Setting this to zero disables paging and shows all items. Default value is 10.
Parameters:
SplitPanel is a two component container that divides the available space into two areas. The split can be made either vertically where one component is above another or horizontally where they are side-by-side. The components are divided by a splitter bar which can be dragged to adjust their relative sizes.
Returns the current maximum position of the splitter, in #getMaxSplitPositionUnit() units.
Returns:
Returns the unit of the maximum position of the splitter
Returns:
Returns the current minimum position of the splitter, in #getMinSplitPositionUnit() units.
Returns:
Returns the unit of the minimum position of the splitter.
Returns:
Returns the current position of the splitter, in #getSplitPositionUnit() units.
Returns:
Is the SplitPanel handle locked (user not allowed to change split position by dragging).
Returns:
true
if locked, false
otherwise. Is the split position reversed. By default the split position is measured by the first region, but if split position is reversed the measuring is done by the second region instead.
Returns:
Sets the first component of this split panel. Depending on the direction the first component is shown at the top or to the left.
Parameters:
Lock the SplitPanels position, disabling the user from dragging the split handle.
Parameters:
true
if locked, false
otherwise. Sets the maximum split position to the given position and unit. If the split position is reversed, maximum and minimum are also reversed.
Parameters:
Sets the minimum split position to the given position and unit. If the split position is reversed, maximum and minimum are also reversed.
Parameters:
Sets the second component of this split panel. Depending on the direction the second component is shown at the bottom or to the right.
Parameters:
Moves the position of the splitter with given position and unit.
Parameters:
Moves the position of the splitter with given position and unit and sets reverse property of the component.
Parameters:
reverse Puts the component into reverse mode. If set to true the split splitter position is measured by the second region else it is measured by the first region.
Note: this affects also previously set minSplitPosition and maxSplitPosition properties.
Sets the listener for the split position changes. The listener is invoked for both user actions and programmatic actions.
Parameters:
HorizontalSplitPanel is a two component container that divides the available space into two areas. The components are side-by-side - first component is on the left and second component is on the right. They are divided by a splitter bar which can be dragged to adjust their relative sizes.
VerticalSplitPanel is a two component container that divides the available space into two areas. The components are above each other - first component is on the top and second component is on the bottom. They are divided by a splitter bar which can be dragged to adjust their relative sizes.
Accordion is vertical tab sheet.
An abstract record that represents a combo-box forms component.
Enables or disables whether the user can enter an undefined option.
The itemProvider
converts the user input from the text field to an option value. The returned object is set as the combo-box value and can be retrieved with the getValue
method. It is selected in the combo box but does not appear in the drop-down list with options. If the user unselects the value, the value dissappears from the combo.
The label for the new item is generated by the caption provider supplied via the setOptions(Collection<SelectItem> options*, ValueProvider caption) method. If not supplied, the result item's toString
method is used.
If the itemProvider
parameter is null
, the user can use only a defined option: the value written into the field is used to filter the options.
Convenience method that calls #setOptions(Collection<SelectItem> options*, ValueProvider caption).
Parameters:
SelectItem
objectsSets the options of the select component.
When the user selects an item from the options, the option value is written to the underlying Value.
The caption provider generates captions for those items that are not in the options
collection. Such items are created either with the setValue
method from the model or when the user enters a new option value to the select component (this is allowed when the new-item handler was previously defined with the setNewItemHandler
method).
Parameters:
Sets the options of the select component.
When the user selects an item from the options, the option value is written to the underlying Value.
The caption provider generates captions for those items that are not in the options
collection. Such items are created either with the setValue
method from the model or when the user enters a new option value to the select component (this is allowed when the new-item handler was previously defined with the setNewItemHandler
method).
Parameters:
New split position.
Unit in which split position is reported.
Returns true if originating split panel is in reverse mode. Reverse mode true means that the split splitter position is measured by the second region, false means it is measured by the first region.
A configuration for the boolean filter.
Default value set to filter field.
If <code>true</code>, user wont be able to set filter to indeterminate state (when both <code>true</code> and <code>false</code> value passes the filter). It is still possible to set the default filter value to indeterminate.
The checkbox filter field caption.
A component for selecting a numerical value within a range. User moves a slider on a scale by mouse instead of writing textual values.
Creates a slider with given label and simple value holder.
Parameters:
Creates a slider with given label and given property.
Parameters:
Creates a slider with given label, referencing given variable/field.
Parameters:
Returns:
Returns:
Returns:
Sets the ReferenceValue being displayed by this component. By default a simple value with the initial value of ????? is displayed. The component is automatically refreshed.
Parameters:
Creates a local date field with given label and simple value holder.
Parameters:
Creates a local date field with given label and given property.
Parameters:
Creates a local date field with given label, referencing given variable/field.
Parameters:
Returns:
getValue
method, this returns whatever is in field including invalid or unparseable values. Sets the ReferenceValue being displayed by this component. By default a simple value with the initial value of null is displayed. The component is automatically refreshed. If the reference is null, previous reference is cleared and field is empty.
Parameters:
Sets the formats accepted by this local date field. The list may contain a special String constant "date" - this constant is automatically replaced by the application message named "app.dateFormat", via the LspsAppConnector.getApplicationMessage().
For formatting string specification please follow http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
Parameters:
The date format pattern. For the format pattern syntax see http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
Returns:
Sets the date format pattern. For the format pattern syntax see https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
Only date symbols are allowed. If the format pattern contains time related symbols, e.g. 'a', 'H', 'm' etc, the formatting will cause runtime error.
Parameters:
Free font awesome 5 icons and styles https://fontawesome.com/icons?d=gallery&m=free.
Turn on and off fixed width icon style, useful when icons needs to be vertically aligned. By default, icon width is not fixed.
Adds and removes "fa-fx" css class to html.
Sets the file upload listener. The listener is notified when all files upload was finished.
Parameters:
Sets the file upload failure listener. The listener is notified when a file upload failed.
Parameters:
Sets the file upload listener. The listener is notified when a single file was uploaded.
Parameters:
Enumerates all possible causes of a geolocation retrieval failure.
An unknown error occurred.
The user declined access to their position.
The browser was unable to locate the user.
The browser was unable to locate the user in the time specified in the PositionOptions.timeout
The browser does not support geolocation retrieval.
Predefined notification types. Each notification type has its distinctive UI look, default screen position and behavior (for example, an Info notification fades away automatically while an Error notification is displayed until the user clicks the notification).
Information notification. See https://vaadin.com/blog/-/blogs/user-notifications-with-vaadin for examples.
By default, notification with this type disappears immediately (that is, it slowly fades in and immediately, with no delay, starts fading out) . The nofication is shown in the middle center part of the screen by default.
Warning notification. See https://vaadin.com/blog/-/blogs/user-notifications-with-vaadin for examples.
By default, notification with this type disappears after 1,5 second and is shown in the middle center part of the screen.
Error notification. See https://vaadin.com/blog/-/blogs/user-notifications-with-vaadin for examples.
By default, notification with this type requires user click to disappear and is shown in the middle center part of the screen.
Bottom-right small notification. See https://vaadin.com/blog/-/blogs/user-notifications-with-vaadin for examples.
By default, this notification disappears after 3 seconds and is shown in the bottom-right corner.
Content modes defining how the label's content should be rendered.
Content is only a plain text.
Content is a preformatted text. New lines are preserved.
Content is rendered as HTML.
Content modes defining how the component caption should be rendered.
Content is only a plain text.
Content is rendered as HTML.
Abstract record for charts
Sets the default plot options.
Parameters:
Sets the chart sub-title
Parameters:
Sets the chart title
Parameters:
shows the graph in the graph legend
drops the shadow to the graph line
Cartesian chart that can render CategoryDataSeries, DecimalDataSeries, ListDataSeries, TimeDataSeries as line, bar, bubble, scatter, and line area graphs.
Adds a data series to the Cartesian chart. Once added, the data series cannot be changed with the exception of the addItem(..) method.
Parameters:
Use the define Y axis in the chart.
Parameters:
Sets the series of the chart: the current series are removed. Once added, the data series cannot be changed with the exception of calling the addItem(..) method.
Parameters:
chart axis used by the cartesian and gauge charts
Note that ticks define the properties of the units on the axis, such as tick interval (not only the tick marks).
axis type defined as an AxisType literal:
The minimum value of the axis.
The maximum value of the axis.
The title of the axis.
A flag indicating whether to display the axis on the opposite side of the normal. This is typically used with dual or multiple axes.
A flag indicating whether to reverse the axis so that the highest number is closest to the origin.
Distance in pixels from the plot area to the axis line. This is typically used when two or more axes are displayed on the same side of the plot. Defaults to 0.
The position of the tick marks on the axis relative to the axis line. Default is 'outside'.
Hexadecimal color value in the form: #RRGGBB, where RR (red), GG (green) and BB (blue) are hexadecimal values between 00 and FF.
The style of the grid line.
The width in pixels of the grid line.
The configuration of the axis labels.
Pie chart with one or mulitiple pies; one pie for each PieSliceSeries.
Gauge chart with a Decimal value
Sets the end angle of the gauge in degrees. 0 is the top, 90 degrees on the right, etc.
Parameters:
A format string for the data label. See forms::ChartLabels for more details.
Parameters:
Defines a callback JavaScript function that formats the data label. See forms::ChartLabels for more details.
c.setFormatter( "'Value: ' + this.y + ' Series: ' + this.series.name ")
Parameters:
Sets the start angle of the gauge in degrees. 0 is at the top, 90 degrees on the right, etc.
Parameters:
Width of the graph line in pixels.
Data series with data arranged in categories; it can be plotted in the CartesianChart and its subtypes.
The categories represent the values of the x axis. The x axis value is the index of the item.
When defining the items for the series, you need to define at least the amount for the y axis, or the range values.
On the cartesian chart, the categories are on the x axis and have integer labels by default.
Creates a category data series.
Parameters:
Creates a new category data series.
Parameters:
Adds a data series item to the chart.
Parameters:
Adds a data series item to the data series.
Parameters:
Data series with data arranged defined by two numbers: the x and y values. Y value can be defined as a range of low and high.
If one of the numbers is time, consider using TimeDataSeries.
Creates a decimal-data-series item.
Parameters:
Creates a new decimal data series item.
Parameters:
Adds a data series item to the chart.
Parameters:
Adds a decimal-data-series item to the chart.
Parameters:
item of a CategoryDataSeries
Creates a category-data-series item with the y value.
Parameters:
Creates a category-data-series item with the name and the y value.
Parameters:
Creates a category-data-series item with the y value and payload.
Parameters:
Creates a category-data-series item with a name, and a range with low and high.
Parameters:
Creates a category-data-series item with the name, y value, and payload.
Parameters:
Creates a category-data-series item with the name, range with low and high, and payload.
Parameters:
item of a DecimalDataSeries
Creates a data series item with the x and y values.
Parameters:
Creates a data series item with the x values, and range with the high and low.
Parameters:
Creates a data series item with the x and y values, and payload.
Parameters:
Creates a data series item with the x values, payload, and range with the high and low.
Parameters:
abstract record for items of different data series
Depending on the type of data the item holds, not all properties must define a value.
name of the data series item
x coordinate of the data series item
y coordinate of the data series item
maximum of the range for y axis
minimum of the range for y axis
payload with data about the item
Unused property kept only for backward compatibility. Use itemColor property instead.
formating of the data label for the data series item
Set of related data items; they are plotted together with common options, for example, as one connected line graph.
data-series name
data items comprising the data series
properties for plotting of the data series
whether the data series holds range values
Zero-based index of the X-axis this series is connected; this is applicable when using dual or multiple X-axes.
Zero based index of the Y-axis this series is connected to when using dual or multiple Y-axes.
Adds a data-series item to the chart.
Parameters:
Checks if the data series contains only data-series items with range.
Parameters:
Returns:
Sets plot options for the data series.
Parameters:
Hexadecimal color value in the form: #RRGGBB, where RR (red), GG (green) and BB (blue) are hexadecimal values between 00 and FF.
Fill opacity as a decimal number from interval [0.0, 1.0].
Flag indicating whether the data series should be rendered as range series.
A plot band is a colored band stretching across the plot area marking an interval on the axis.
The text label for the plot band.
Hexadecimal color value in the form: #RRGGBB, where RR (red), GG (green) and BB (blue) are hexadecimal values between 00 and FF.
item of a TimeDataSeries
Creates a time data series item.
Parameters:
Creates a range time data series item.
Parameters:
Creates a time data series item.
Parameters:
Creates a range time data series item.
Parameters:
Data series with data arranged defined by a point in time and a number.
When using the Date type, make sure to set the x axis to the required type;
(`new Axis( 'type' -> AxisType.datetime)`).
Creates a new time data series item.
Parameters:
Creates a new time data series item.
Parameters:
Adds a data series item to the chart.
Parameters:
Adds a data series item to the chart.
Parameters:
pie slice of pie slice series
name of the pie slice
value of the pie slice
payload of the pie slice
color of the slice defined as #RRGGBB, where RR (red), GG (green) and BB (blue) are hexadecimal values between 00 and FF.
Creates a new instance of the pie slice.
Parameters:
Creates a new instance of the pie slice.
Parameters:
Creates a new instance of the pie slice.
Parameters:
Creates a new instance of the pie slice.
Parameters:
Polar chart that can render CategoryDataSeries, DecimalDataSeries, ListDataSeries, TimeDataSeries as line, bar, bubble, scatter, and line area graphs.
The diameter of the pie. If expressed as a percentage value then the size is relative to the plot area.
The size of the inner diameter of the pie. If expressed as a percentage value then the size is relative to the plot area.
The width of the border surrounding each slice.
center of the pie relative to the corner of the plotting area (0,0 is the upper left corner)
Start angle of the pie slices in degrees where 0 is top and 90 right. Should be smaller than end angle.
The end angle of the pie in degrees where 0 is top and 90 is right. Defaults to startAngle plus 360. Should be larger than start angle.
A flag indicating whether to show the data series in the graph legend.
Configurations of the labels rendered for the pie slices.
drops the shadow to the graph line
Size attribute in a pixel or percentage value.
a size as a pixel value or a percentage value
Creates a size attribute with the value in pixels.
Parameters:
Creates a relative size attribute with the value in percent.
Parameters:
Center coordinates in pixel or percentage values relative to the upper left.
Creates center coordinates with the defined position.
Parameters:
Creates relative center coordinates expressed in percentage.
Parameters:
Data series for the PieChart
name of the series
list of pie slices
plot options for the pie chart
Creates a new series for the pie chart.
Parameters:
Creates a new series for the pie chart.
Parameters:
Creates a new series for the pie chart.
Parameters:
Creates a new series for the pie chart.
Parameters:
A configuration record for labels.
enables or disabled the data labels
Callback JavaScript function to format the data label. If a format is defined, the format takes precedence and the formatter is ignored.
Available data are:
A format string for the data label. Available variables are the same as for formatter. Defaults to {y}.
Rotation of labels in degrees.
The distance of the data label from the pie's edge. Negative numbers put the data label on top of the pie slices. Connectors are only shown for data labels outside the pie.
Data series with data with one decimal value.
Adds a data series item to the chart.
Parameters:
Adds a list-data-series item to the chart.
Parameters:
item of a ListDataSeries
Creates a new list series item for the given value.
Parameters:
Creates a new list series item for the given value and payload.
Parameters:
red component: 0 - 255
green component: 0 - 255
blue component: 0 - 255
The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque).
Creates a new color expressed in the format #RRGGBB
Parameters:
Creates a new color expressed in RGB
Parameters:
Creates a new color expressed in RGBa
Parameters:
Click event on a point in a chart
name of the clicked series
key of the clicked point
value of the point or, for a range item, the lower value
high value if the clicked item has a range; otherwise null
payload of the clicked point
Plot options which causes a data series items to be printed as bubbles. The data series must contain range data series items where the 'low' value is interpreted as the item value and the 'high' value is used to calculate the bubble diameter.
Line style used for drawing line-based charts
Marker shape used for data points
position of the tick marks on the axis relative to the axis line
enumeration used by the Axis.type property
value on the axis are plotted as points in time (if an axis is set to another type, for example, by default,
and your axis plots Date objects, the dates are rendered as integers).
Comparable filter. Rejects nulls. Expects Decimal and Date only.
Filtered value must be "op" than the value present in this filter, in order for the filtered value to pass this filter.
Only supports comparable types: Date, Decimal, String, Enumeration and Boolean. Not null.
Compares the row-extracted value against this value.
Parameters:
Provides values from data rows. The sorting of the data rows will be performed upon the provided values.
True if rows with greatest values will be placed last (bottom-most).
Creates the sorting criteria.
Parameters:
Creates the sorting criteria.
Parameters:
Compares two row objects according to this sort specification.
Parameters:
Returns:
Returns a new set, containing all data rows from the old set but sorted.
Parameters:
Returns:
Returns a new set, containing all data rows from the old set but sorted.
Parameters:
Returns:
Similar to ValueFilter but accepts multiple values. Expects Date, Decimal, EnumerationImpl and Boolean only.
Creates a filter which only matches rows having row-extracted value equal to one of provided values. Think of this filter as a more generic version of ValueFilter. This filter accepts any row-extracted values: not only comparables, but also records, closures, anything.
Parameters:
Only works for String objects - throws exception for any other object type. Matches given string against given regular expression.
Compares the row-extracted value against given regexp. The value must be a String otherwise the filter fails at runtime.
Parameters:
Allows only one value. Expects Date, Decimal, EnumerationImpl and Boolean only.
The expected value, may be null.
Creates a filter which only matches rows having row-extracted value equal to this value. This filter accepts any row-extracted values: not only comparables, but also records, closures, anything.
Parameters:
Provides paged rows from a storage, for example from a database.
Returns the total number of lines, matching given filters.
Parameters:
Returns:
Retrieves data from the data source. The data is first filtered and sorted, then paged. An exception will be thrown if an unsupported Filter or Sort is passed.
Parameters:
Returns:
Checks if this filter is supported by this datasource.
Parameters:
Returns:
Checks if this sorting criteria is supported by this datasource.
Parameters:
Returns:
Checks that the value is a String which contains given substring. The filter only works for String objects - throws exception for any other object type.
All passed values must contain given string as its substring. Case-insensitive.
Creates a filter which only matches rows having row-extracted string value containing given string. This filter accepts any row-extracted values and converts them to String.
Parameters:
Filters Grid data row object. First, a value is obtained from the row (using the valueProvider), then it is checked if the value matches this filter. Only a small subset of filters is supported - the objective here is that these filters will be able to be run on the database, thus avoiding in-memory filtering.
In-memory filtering is expensive because it requires us to pull all rows from the database.
Provides the value from the data row. The filter further operates on the value and either rejects it, or accepts it.
Filter id assigned in <code>FilterConfig</code>. Used to identify all filters configured with the same <code>FilterConfig</code>.
Tests if this filter matches given object.
Parameters:
Used to provide a particular value from the data row, for example provides Person.name out of a Person.
A closure value provider - simply polls provided closure for data, in the get() method. When used in Grid, this provider forces the Grid to sort/filter in-memory, massively degrading performance for large data sets.
This closure is simply called by the get() method.
Runs the table row through given closure.
Parameters:
Closure has no property path, always returns null.
Returns:
Always provides given value. When used in Grid, this provider forces the Grid to sort/filter in-memory, massively degrading performance for large data sets.
Always provide given value.
Parameters:
Returns:
Returns:
Runs given PropertyPath over data row records and provides the result. When used in Grid, this provider is able to issue native SQL where/order, massively improving performance.
De-references given property path on a record and returns its value. Only accepts Record rows. See forms::PropertyPath for more information.
Parameters:
Returns:
Delegates calls to the underlying DS but always prepends given set of sort criteria, thus sorting primarily by this criteria. Do not instantiate directly - use the DataSource.withSort() method instead.
Delegates calls to given delegate, but always applies given set of sort criteria.
Parameters:
Simply delegates all calls to the delegate.
Simply delegates all calls to given datasource. Extend this class to implement more interesting implementations.
Parameters:
Delegates calls to the underlying DS but always applies given set of filter criteria, along with any other filters provided in getCount()/getData(). Do not instantiate directly - use the DataSource.withFilter() method instead.
Always applies this set of filter criteria, along with any other filters provided in getCount()/getData().
Delegates calls to given delegate, but always applies given set of filter.
Parameters:
A DataSource which provides all instances of given Record.
In-memory sorts and filters given collection.
Has very low performance when compared to TypeDataSource; when using Shared Records, please consider using other data sources which perform native in-DB data sorting and filtering.
Provides contents of this list, filtered and sorted as necessary.
In-memory sorts/filters out objects in this collection.
Parameters:
Simply provides the row itself as the row-extracted value. Useful in Combo-boxes or Tables, for example when modeling a column with the "Delete" or "Edit" action link - this way, the link will gain access to the entire Record and can delete it easily.
Creates an identity provider with the declared value type. If the value type is null then the type Object is used.
Parameters:
Retrieves child objects for given parent object. Initially, this method is called with the null parameter, to retrieve all possible root nodes; as the root nodes are expanded by the user, this method is gradually called for the node objects.
Parameters:
Returns:
Called to poll the list of children for given parent. See TreeDataSource.getChildren() for details. Not null.
Constantly provides given map as a simple two-level tree: map keys are simply returned as root objects, map values are returned as respective root children.
A special data source used to convert ui-based forms.