|
DataContextAddSelectFieldTModel, TOption(String, String, String, String, String, String, String, String, String, String, String, String, String, Boolean, RecordRestriction, Boolean, String, Boolean, String, Boolean, String, String) Method
|
Generates template based select field based on reflected modeled table field attributes.
Namespace: GSF.Web.ModelAssembly: GSF.Web (in GSF.Web.dll) Version: 2.4.207-beta
Syntax public string AddSelectField<TModel, TOption>(
string fieldName,
string optionValueFieldName,
string optionLabelFieldName = null,
string optionSortFieldName = null,
string fieldLabel = null,
string fieldID = null,
string groupDataBinding = null,
string labelDataBinding = null,
string requiredDataBinding = null,
string customDataBinding = null,
string dependencyFieldName = null,
string optionDataBinding = null,
string toolTip = null,
bool initialFocus = false,
RecordRestriction restriction = null,
bool allowUnset = false,
string unsetCaption = "Select value...",
bool addEmptyRow = false,
string emptyRowValue = "",
bool showNoRecordOption = false,
string noRecordValue = "-1",
string noRecordText = "No records"
)
where TModel : class, new()
where TOption : class, new()
Public Function AddSelectField(Of TModel As {Class, New}, TOption As {Class, New}) (
fieldName As String,
optionValueFieldName As String,
Optional optionLabelFieldName As String = Nothing,
Optional optionSortFieldName As String = Nothing,
Optional fieldLabel As String = Nothing,
Optional fieldID As String = Nothing,
Optional groupDataBinding As String = Nothing,
Optional labelDataBinding As String = Nothing,
Optional requiredDataBinding As String = Nothing,
Optional customDataBinding As String = Nothing,
Optional dependencyFieldName As String = Nothing,
Optional optionDataBinding As String = Nothing,
Optional toolTip As String = Nothing,
Optional initialFocus As Boolean = false,
Optional restriction As RecordRestriction = Nothing,
Optional allowUnset As Boolean = false,
Optional unsetCaption As String = "Select value...",
Optional addEmptyRow As Boolean = false,
Optional emptyRowValue As String = "",
Optional showNoRecordOption As Boolean = false,
Optional noRecordValue As String = "-1",
Optional noRecordText As String = "No records"
) As String
public:
generic<typename TModel, typename TOption>
where TModel : ref class, gcnew()
where TOption : ref class, gcnew()
String^ AddSelectField(
String^ fieldName,
String^ optionValueFieldName,
String^ optionLabelFieldName = nullptr,
String^ optionSortFieldName = nullptr,
String^ fieldLabel = nullptr,
String^ fieldID = nullptr,
String^ groupDataBinding = nullptr,
String^ labelDataBinding = nullptr,
String^ requiredDataBinding = nullptr,
String^ customDataBinding = nullptr,
String^ dependencyFieldName = nullptr,
String^ optionDataBinding = nullptr,
String^ toolTip = nullptr,
bool initialFocus = false,
RecordRestriction^ restriction = nullptr,
bool allowUnset = false,
String^ unsetCaption = L"Select value...",
bool addEmptyRow = false,
String^ emptyRowValue = L"",
bool showNoRecordOption = false,
String^ noRecordValue = L"-1",
String^ noRecordText = L"No records"
)
member AddSelectField :
fieldName : string *
optionValueFieldName : string *
?optionLabelFieldName : string *
?optionSortFieldName : string *
?fieldLabel : string *
?fieldID : string *
?groupDataBinding : string *
?labelDataBinding : string *
?requiredDataBinding : string *
?customDataBinding : string *
?dependencyFieldName : string *
?optionDataBinding : string *
?toolTip : string *
?initialFocus : bool *
?restriction : RecordRestriction *
?allowUnset : bool *
?unsetCaption : string *
?addEmptyRow : bool *
?emptyRowValue : string *
?showNoRecordOption : bool *
?noRecordValue : string *
?noRecordText : string
(* Defaults:
let _optionLabelFieldName = defaultArg optionLabelFieldName null
let _optionSortFieldName = defaultArg optionSortFieldName null
let _fieldLabel = defaultArg fieldLabel null
let _fieldID = defaultArg fieldID null
let _groupDataBinding = defaultArg groupDataBinding null
let _labelDataBinding = defaultArg labelDataBinding null
let _requiredDataBinding = defaultArg requiredDataBinding null
let _customDataBinding = defaultArg customDataBinding null
let _dependencyFieldName = defaultArg dependencyFieldName null
let _optionDataBinding = defaultArg optionDataBinding null
let _toolTip = defaultArg toolTip null
let _initialFocus = defaultArg initialFocus false
let _restriction = defaultArg restriction null
let _allowUnset = defaultArg allowUnset false
let _unsetCaption = defaultArg unsetCaption "Select value..."
let _addEmptyRow = defaultArg addEmptyRow false
let _emptyRowValue = defaultArg emptyRowValue ""
let _showNoRecordOption = defaultArg showNoRecordOption false
let _noRecordValue = defaultArg noRecordValue "-1"
let _noRecordText = defaultArg noRecordText "No records"
*)
-> string when 'TModel : not struct, new() when 'TOption : not struct, new()
JavaScript does not support generic types or methods.
View SourceParameters
- fieldName String
- Field name for value of select field.
- optionValueFieldName String
- Field name for ID of option data.
- optionLabelFieldName String (Optional)
- Field name for label of option data, defaults to optionValueFieldName
- optionSortFieldName String (Optional)
- Field name for sort order of option data, defaults to optionLabelFieldName
- fieldLabel String (Optional)
- Label name for select field, pulls from LabelAttribute if defined, otherwise defaults to fieldName.
- fieldID String (Optional)
- ID to use for select field; defaults to select + fieldName.
- groupDataBinding String (Optional)
- Data-bind operations to apply to outer form-group div, if any.
- labelDataBinding String (Optional)
- Data-bind operations to apply to label, if any.
- requiredDataBinding String (Optional)
- Boolean data-bind operation to apply to required state, if any.
- customDataBinding String (Optional)
- Extra custom data-binding operations to apply to field, if any.
- dependencyFieldName String (Optional)
- Defines default "enabled" subordinate data-bindings based a single boolean field, e.g., a check-box.
- optionDataBinding String (Optional)
- Data-bind operations to apply to each option value, if any.
- toolTip String (Optional)
- Tool tip text to apply to field, if any.
- initialFocus Boolean (Optional)
- Use field for initial focus.
- restriction RecordRestriction (Optional)
- Record restriction to apply, if any.
- allowUnset Boolean (Optional)
- Flag that determines if select can have no selected value.
- unsetCaption String (Optional)
- Label to show when no value is selected; defaults to "Select value...".
- addEmptyRow Boolean (Optional)
- Flag that determines if an empty row should be added to options list.
- emptyRowValue String (Optional)
- Value to use for empty row; defaults to empty string.
- showNoRecordOption Boolean (Optional)
- Flag that determines if an option representing no records should be shown if select query returns no values.
- noRecordValue String (Optional)
- Value for no records option when select query returns no values; defaults to "-1".
- noRecordText String (Optional)
- Text for no records option when select query returns no values; defaults to "No records".
Type Parameters
- TModel
- Modeled table for select field.
- TOption
- Modeled table for option data.
Return Value
StringGenerated HTML for new text field based on modeled table field attributes.
See Also