public class CascadingValueProvider extends FieldValueProvider implements HasCascadingParent
The parent prompt field itself must have a FieldValueProvider so that the possible default values can be filtered with a "WHERE" condition in the query.
For example, a PromptField with a FieldValueProvider pointing to a database field representing countries could be set as a parent for a CascadingValueProvider pointing to a database field representing cities. When the default values are fetched, the value for the country is placed in the "WHERE" condition, thereby only providing the cities in the given country.
MAX_RECORDS
Constructor and Description |
---|
CascadingValueProvider(PromptField parent,
CascadingSource parentSource,
DatabaseField values,
DatabaseField descriptions,
int sortType)
Initializes a CascadingValueProvider with the given parent, value field and (optionally) description field, as well as the desired sort type.
|
Modifier and Type | Method and Description |
---|---|
PromptField |
getParent()
Returns the set parent prompt field
|
CascadingSource |
getParentSource()
Returns the parent source which provides the reference name for the parent prompt when referencing
it in the generated SQL query.
|
java.lang.String |
getSQL()
Returns the query which is to be used for fetching the values and optionally descriptions dynamically.
|
void |
setParent(PromptField parent)
Sets the parent prompt field which is to be used for filtering the default values.
|
void |
setParentSource(CascadingSource parentSource)
Sets the parent source for this cascading prompt that will provide the reference name of the parent
to use in the generated SQL query.
|
getDatasource, getDescriptions, getFieldRefName, getSQL, getSortType, getValues, setDatasource, setDescriptions, setSortType, setValues
getDefaultValues
getDefaultValues
isDOMParser, parseDOM, parseElement, parseEndElement, parseText
public CascadingValueProvider(PromptField parent, CascadingSource parentSource, DatabaseField values, DatabaseField descriptions, int sortType)
parent
- Parent prompt field, may not be nullparentSource
- Provider of the SQL reference name for the parentvalues
- Default values' value fielddescriptions
- Default values' descriptions fieldsortType
- Desired sort typejava.lang.IllegalArgumentException
- if the parent prompt field is null or does not have a FieldValueProvider, or if the values field is null or if the sort type is invalidSortField.ORIGINAL_ORDER
,
SortField.ASCENDING_ORDER
,
SortField.DESCENDING_ORDER
,
CascadingSource
,
FieldValueProvider
public PromptField getParent()
getParent
in interface HasCascadingParent
public void setParent(PromptField parent)
setParent
in interface HasCascadingParent
parent
- Parent prompt field, may not be null and must have a FieldValueProviderjava.lang.IllegalArgumentException
- if the parent prompt field is null or does not have a FieldValueProvider,public java.lang.String getSQL()
getSQL
in class FieldValueProvider
public void setParentSource(CascadingSource parentSource)
parentSource
- parent source which provides the reference name of the parent to use in the query, may not be nulljava.lang.IllegalArgumentException
- if the parent source given is nullpublic CascadingSource getParentSource()
Copyright © 1999-2020 by i-net software GmbH