public class DbRecordSettings extends AbstractTextChooserSettings<DbRecordSettings>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CHOOSER_LABEL_COLUMN |
static java.lang.String |
CHOOSER_VALUE_COLUMN |
static java.lang.String |
COLUMNS |
static java.lang.String |
DATA_SOURCE |
static int |
DEFAULT_MAX_ROWS |
static java.lang.String |
MAX_ROWS |
static java.lang.String |
ORDER_BY |
static java.lang.String |
TABLE |
APPEND, ARIA_ATTR_PREFIX, ARIA_ATTRIBUTES, AUTOFOCUS, CLEAR_BUTTON, CSS, DATA_ATTR_PREFIX, DATA_ATTRIBUTES, DISABLED, HIDE_CLEAR_BUTTON, HTML_ATTRIBUTES, ID, LANGUAGE_CHOOSER, MAX_LENGTH, NAME, PLACEHOLDER, PREPEND, READONLY, REQUIRED, TRIGGER_ACTION, TRIGGER_EVENT, VALUE
Constructor and Description |
---|
DbRecordSettings() |
Modifier and Type | Method and Description |
---|---|
DbRecordSettings |
chooserLabelColumn(java.lang.String columnName)
Column name used to display the value of this column in the visible field after selecting an item from the database.
|
DbRecordSettings |
chooserValueColumn(java.lang.String columnName)
Column name used to put the value of this column in the hidden field after selecting an item from the database.
|
DbRecordSettings |
columns(java.lang.String[] columnNames)
Specify the column names of the DB Table to display in the chooser window.
|
DbRecordSettings |
columns(java.lang.String columnName,
java.lang.String... columnNames)
Specify the column names of the DB Table to display in the chooser window.
|
DbRecordSettings |
dataSource(java.lang.String dataSource)
Set the DataSource.
|
protected java.lang.String |
getChooserName()
Chooser name used by the databroker when there is a click event in the chooser button.
|
protected java.lang.String |
getChooserOption(java.util.Map<java.lang.String,java.lang.String[]> customOptionMap)
Options used by the databroker when there is a click event in the chooser button.
|
java.lang.Object |
getFirstValue(java.lang.String whereValue)
This convenient method performs a query then it returns the value of the first column of the first row of the result set.
|
protected DbRecordSettings |
getThis()
Returns the exact type of the this reference.
It's a way to recover the type of the this object in a class hierarchy (cf. |
ControlType |
getType()
Returns the
ControlType related to the current ControlSettings implementation. |
DbRecordSettings |
maxRows(int maxRow)
Specify the maximum rows to display per result page in the chooser window.
|
DbRecordSettings |
orderBy(java.lang.String orderBy)
Specify the order to sort the result-set in ascending or descending order.
Example: new DBRecordSettings().orderBy("column1, column2 DESC"); |
void |
resolveOptions(TypeFieldEntry tfe)
Set options from the specified
TypeFieldEntry . |
DbRecordSettings |
table(java.lang.String table)
Set the DB table on which the query is made.
|
addAcChooserOption, addChooserOption, getAcChooserName, getAcChooserOption, getChooserIcon, getChooserTitle, getOption, popupHeight, popupWidth, superGetOption, useCurrentWorkspace, workspace, workspace
onChange
addOption, append, aria, aria, autofocus, clearOption, clone, css, dataAttribute, dataAttributes, disable, getOptionNames, htmlAttributes, htmlAttributes, id, isChannelReady, maxLength, merge, name, onFocusOut, placeholder, prepend, readonly, removeOption, require, showLanguageChooser, sortSet, toStringArray, toStringArray, toStringArray, toStringArray, toStringArray, trigger, value
public static final int DEFAULT_MAX_ROWS
public static final java.lang.String DATA_SOURCE
public static final java.lang.String TABLE
public static final java.lang.String COLUMNS
public static final java.lang.String MAX_ROWS
public static final java.lang.String ORDER_BY
public static final java.lang.String CHOOSER_VALUE_COLUMN
public static final java.lang.String CHOOSER_LABEL_COLUMN
public ControlType getType()
ControlSettings
ControlType
related to the current ControlSettings
implementation.ControlType
protected DbRecordSettings getThis()
BasicSettings
this
object in a class hierarchy (cf. getThis "trick").getThis
in class BasicSettings<DbRecordSettings>
public void resolveOptions(TypeFieldEntry tfe)
ControlSettings
TypeFieldEntry
.resolveOptions
in interface ControlSettings<DbRecordSettings>
resolveOptions
in class BasicSettings<DbRecordSettings>
tfe
- TypeFieldEntry
protected java.lang.String getChooserName()
AbstractTextChooserSettings
getChooserName
in class AbstractTextChooserSettings<DbRecordSettings>
protected java.lang.String getChooserOption(java.util.Map<java.lang.String,java.lang.String[]> customOptionMap)
AbstractTextChooserSettings
getChooserOption
in class AbstractTextChooserSettings<DbRecordSettings>
customOptionMap
- Extra chooser options forwarded by the option ChooserConstants.EXTRA_CHOOSER_OPTION
and appended to the query stringString
representing the options as query stringpublic DbRecordSettings dataSource(java.lang.String dataSource)
dataSource
- the name of the data source (eg. "jdbc/TestDB")public DbRecordSettings table(java.lang.String table)
table
- the table name to work with.public DbRecordSettings columns(java.lang.String columnName, java.lang.String... columnNames)
columnName
- The first column namecolumnNames
- The other column namescolumns(String[])
public DbRecordSettings columns(java.lang.String[] columnNames)
columnNames
- Array of column namestable(String)
public DbRecordSettings maxRows(int maxRow)
maxRow
- Number of maximum rowspublic DbRecordSettings orderBy(java.lang.String orderBy)
new DBRecordSettings().orderBy("column1, column2 DESC");
orderBy
- The orderpublic DbRecordSettings chooserValueColumn(java.lang.String columnName)
columnName
- Column namepublic DbRecordSettings chooserLabelColumn(java.lang.String columnName)
columnName
- Column namepublic java.lang.Object getFirstValue(java.lang.String whereValue) throws java.sql.SQLException
whereValue
- value in the column defined by the CHOOSER_VALUE_COLUMN
optionjava.sql.SQLException
- if an error occursCopyright © 2001-2022 Jalios SA. All Rights Reserved.