Form Controls

Each control has a different type and each control consists of 3 components:

  1. A C# class that defines the control and its properties as well as a CSHTML view path that is rendered. All controls inherit from the class FormControl and usually override a few methods
    1. C# class of a control
      using OneCore.Extensions;
      using System;
      
      namespace One.Core.UI.MVC.Forms.Controls
      {
          /// <summary>
          /// Input Control
          /// </summary>
          public class InputControl : FormControl
          {
              #region Private
      
              private string _field;
              private string _regexValidation;
              public const string INPUT_VIEW_PATH = "~/Views/Forms/Controls/InputControlView.cshtml";
      
              #endregion
              /// <summary>
              /// 
              /// </summary>
              /// <returns></returns>
              public override string GetRenderControlViewPath()
              {
                  return INPUT_VIEW_PATH;
              }
      
              #region Fields
      
              public string Field
              {
                  get { return _field; }
                  set
                  {
                      if (String.IsNullOrWhiteSpace(value))
                          throw new ArgumentException("InputControl-> Field is Empty", value);
                      _field = value;
      
                  }
              }
      
              public String Placeholder { get; set; }
              public string Error { get; set; }
              public string ErrorClass { get; set; }
              public string DefaultStaticValue { get; set; }
              public bool UrlEncode { get; set; }
              public int? MaxLength { get; set; }
              //If True, the control will become disabled if it has a value after the reflection
              public bool DisabledIfHasValue { get; set; }
              public bool MarkRed { get; set; } = false;
              public bool Sanitize { get; set; } = true;
              public string RegexValidation
              {
                  get { return _regexValidation; }
                  set
                  {
                      _regexValidation = value;
                  }
              }
              public string AjaxUpdateUrl { get; set; }
              #endregion
      
              #region Ctor
              /// <summary>
              /// 
              /// </summary>
              public InputControl()
              {
                  this.IsReadOnly = false;
                  this.Required = false;
                  this.FormControlType = ControlType.TextBox;
              }
      
              /// <summary>
              /// 
              /// </summary>
              /// <param name="field"></param>
              /// <param name="placeholder"></param>
              /// <param name="error"></param>
              /// <param name="required"></param>
              /// <param name="regexValidation"></param>
              public InputControl(string field, string placeholder, string error, bool required, string regexValidation)
              {
                  if (String.IsNullOrWhiteSpace(field))
                      throw new ArgumentException("InputControl->Field is Empty", field);
      
      
                  this.Placeholder = placeholder;
                  this.Error = error;
                  this.Required = required;
                  this.RegexValidation = regexValidation;
              }
              #endregion
      
              public override string GetUniqueKey()
              {
                  return Field.Replace('.', '_');
              }
      
              public string GetEmailValidation()
              {
                  // return this.IsEmail ? RegexValidation = "^([a-z0-9!#$%&\u0027*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\u0027*+/=?^_`{|}~-]+)*@@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\s*;?\\s*)+$" : null;
                  // /^ (([^<> ()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
                  //return this.IsEmail ? RegexValidation = "/^ (([^<> ()[\u005C]\\.,;:\u005Cs@\"]+(\u005C.[^<>()[\u005C]\\.,;:\u005Cs@\"]+)*)|(\".+\"))@((\u005C[[0-9]{1,3}\u005C.[0-9]{1,3}\u005C.[0-9]{1,3}\u005C.[0-9]{1,3}\u005C])|(([a-zA-Z\u005C-0-9]+\u005C.)+[a-zA-Z]{2,}))$/" : null;
                  return null;
              }
      
              public override void UpdateEntity(object source, object destination)
              {
                  var sourceValue = source.GetPropertyValue(Field);
                  destination.SetPropertyValue(Field, sourceValue);
              }
      
              public override bool HasValue
              {
                  get { return !string.IsNullOrEmpty(Model.GetPropertyValue(Field)?.ToString()); }
              }
              public bool IsEmail { get; set; }
              public bool IsOnlyUppercase { get; set; }
              public string TextMask { get; set; }
              public bool IsResourceCode { get; set; } = false;
              //Properties for Cascading
              public string SubscriptionField { get; set; }
      
              public string SubscriptionFieldSearchKey { get; set; }
      
              public string CascadingValue { get; set; }
          }
      }
  2. A CSHTML file that contains the HTML code
    1. CSHTML view of a control
      @using OneCore.Extensions
      @using One.Core.Extensions
      @using OneCore.WebHelper
      @using OneCore.Framework.Services.Resources
      @model One.Core.UI.MVC.Forms.Controls.InputControl
      @{
          var formName = ViewData["FormName"];
          var finalValue = string.Empty;
          var rawvalue = Model.Model != null ? OneCore.Extensions.ReflectionExtensions.GetPropertyValue(Model.Model, Model.Field) : null;
          if (rawvalue != null)
          {
              finalValue = rawvalue.ToString();
              if (!string.IsNullOrEmpty(finalValue) && Model.DisabledIfHasValue)
              {
                  Model.Disable = true;
              }
      
              if (Model.IsResourceCode)
              {
                  var englishValue = Languages.CurrentResourceManager.GetStaticResourceKey(finalValue, "", "en-US");
                  finalValue = Languages.Translate(finalValue, englishValue);
              }
      
          }
          else if (!string.IsNullOrEmpty(Model.DefaultStaticValue))
          {
              finalValue = Model.DefaultStaticValue;
          }
          var controlKey = Model.GenerateKey();
          var performsAjaxUpdate = !string.IsNullOrEmpty(Model.AjaxUpdateUrl);
          //finalValue = Model.Sanitize ? finalValue.Replace("\\", "\\\\")?.Sanitize() : finalValue.Replace("\\", "\\\\");
      }
      @*<input style="width: 100%" class="respo-input-line @(Model.MarkRed ? "uncertain-results" : "") @(Model.IsOnlyUppercase ? "text-uppercase" : "")" control-uid="@Model.ControlUId" id="input-@controlKey" data-bind="value: @Model.GetUniqueKey()" value="" @(Model.IsReadOnly ? " readonly='readonly' " : "") @(Model.Required ? " required " : "") @(Model.IsEmail ? " isemail " : "") @(!string.IsNullOrEmpty(Model.TextMask) ? "data-mask=" + Html.Raw(Model.TextMask) : "")>*@
      <input style="width: 100%"
             type="text"
             class="respo-input-line @(Model.MarkRed ? "uncertain-results" : "") @(Model.IsOnlyUppercase ? "text-uppercase" : "")"
             control-uid="@Model.ControlUId"
             id="input-@controlKey"
             data-bind='value: @Model.GetUniqueKey(), valueUpdate: "afterkeydown"'
             value=""
              @Html.Raw(Model.IsReadOnly ? " readonly='readonly' " : "") 
              @Html.Raw(Model.Required ? " required " : "") 
              @Html.Raw(Model.IsEmail ? " isemail " : "")
              @Html.Raw(Model.Required ? " title=''" : "")>
      
      <script>
          var text@(controlKey) = new TextBox({
              controlId: 'input-@controlKey',
              controlName: 'text@(controlKey)',
              isDisabled: @Model.Disable.ToJS(),
              field: @Model.GetUniqueKey().ToJS(),
              rawValue: @finalValue.ToJS(),
              encode: @Model.UrlEncode.ToJS(),
              regexValidation: @((Model.RegexValidation ?? "").ToJS()),
              fieldId: @Model.SubscriptionField.ToJS(),
              cascValue: @Model.CascadingValue.ToJS(),
              maxLength: @Model.MaxLength.ToJS(),
              isOnlyUpperCase: @Model.IsOnlyUppercase.ToJS(),
              SubscriptionFieldSearchKey: @Model.SubscriptionFieldSearchKey.ToJS(),
              performsAjaxUpdate: @performsAjaxUpdate.ToJS(),
              ajaxUpdateUrl: @Model.AjaxUpdateUrl.ToJS(),
               }).AddTo(@formName, @Model.Field.ToJS());
          @if (!string.IsNullOrEmpty(Model.TextMask))
          {
              @:$("#input-@controlKey").mask(@Model.TextMask.ToJS());
          }
      </script>
  3. A JavaScript file that contains client-side logic, for example methods to bind them with other controls or a usage of an external library, such as Kendo, for some more complicated controls
    1. JavaScript class of the control
      /// <reference path="baseControl.js" />
      
      class TextBox extends BaseControl {
          constructor(options) {
              super(options);
      
              this.FieldName = options.field;
              this.rawValue = options.rawValue;
              this.encode = options.encode;
              this.regexValidation = options.regexValidation;
              this.fieldId = options.fieldId;
              this.cascValue = options.cascValue;
              this.maxLength = options.maxLength;
              this.isOnlyUpperCase = options.isOnlyUpperCase;
              this.SubscriptionFieldSearchKey = options.SubscriptionFieldSearchKey;
              this.RegexValidator = null;
              this.IsRegexValidatorJsonObject = false;
              this.performsAjaxUpdate = options.performsAjaxUpdate;
              this.ajaxUpdateUrl = options.ajaxUpdateUrl;
      
              let validationModel = null;
              if (this.maxLength !== null && this.maxLength > 0) {
                  validationModel = {
                      maxLength: {
                          params: this.maxLength,
                          message: ClientLangManager.GetResource("OD0000029", "You cannot enter more than") + " " + this.maxLength + " " + ClientLangManager.GetResource("OD0000030", "characters in this field.")
                      }
                  }
              }
      
              if (this.regexValidation) {
                  if (validationModel == null)
                      validationModel = {};
                  try {
                      let params = new RegExp(this.regexValidation, 'gu');
                      validationModel.pattern = {
                          params: params,
                          message: ClientLangManager.GetResource("OD0006310", "Please enter a valid ") + this.GetLabelName()
                      };
                  }
                  catch (err) {
                      try {
                          let params = new RegExp(this.regexValidation, 'g');
                          validationModel.pattern = {
                              params: params,
                              message: ClientLangManager.GetResource("OD0006310", "Please enter a valid ") + this.GetLabelName()
                          };
                          console.log(`Error in form personalization for field ${this.FieldName} and regex ${this.regexValidation} no unicode flag is used because regex isn't valid. Please check through regex101, Javascript flavor, 'gu' regex flags for errors`);
                      }
                      catch {
                          console.log(err);
                          console.log(`Error in form personalization regex of control ${this.FieldName} ${this.regexValidation} is not valid. Please check through regex101 for errors`);
                          this.regexValidation = null;
                          options.regexValidation = null;
                      }
                  }
      
      
              }
      
              if (this.encode)
                  this.ApplyFieldOnModel(this.FieldName, unescape(this.rawValue), validationModel);
              else
                  this.ApplyFieldOnModel(this.FieldName, this.rawValue, validationModel);
      
              if (this.performsAjaxUpdate) {
                  const self = this;
                  this.ApplyChangeOnModel(this.FieldName, function () { self.PerformAjaxUpdate() });
              }
          }
      
          Disable() {
              this.GetControl().attr("disabled", "disabled");
          }
      
          Enable() {
              this.GetControl().removeAttr("disabled");
          }
      
          OnAfterApplyBinding() {
              if (this.regexValidation) {
                  try {
                      this.RegexValidator = new RegExp(this.regexValidation, 'gu');
                  }
                  catch (err) {
                      try {
                          this.RegexValidator = new RegExp(this.regexValidation, 'g');
                      }
                      catch (er) {
                          this.RegexValidator = null;
                      }
                  }
              }
              this.Initialize();
          }
      
          Initialize() {
              if (this.fieldId) {
                  this.Form.SubscribeToField(this.fieldId, this.OnParentChangeValue);
                  // do not know why this used. left just in case
                  this.Form.GetValueOfSubscribedField(this.fieldId);
              }
          }
      
          OnParentChangeValue(newValue) {
              if (this.cascValue) {
                  if (newValue === this.cascValue) {
                      this.Enable();
                  } else {
                      this.Disable();
                  }
              }
          }
      
          /**
          * Gets the value of the model object and unencodes if nessecary
          * @method GetValue
          * @memberOf BaseControl
          * @return string
          */
          GetValue() {
              let res = {};
              let value = this.Model[this.FieldName]();
      
              if (value == null)
                  return { [this.FieldName]: null };
              else if (typeof value !== 'string')
                  value = "";
      
              if (this.encode)
                  res[this.FieldName] = escape(value.trim());
              else if (this.isOnlyUpperCase)
                  res[this.FieldName] = value.trim().toUpperCase();
              else
                  res[this.FieldName] = value.trim();
              
              return res;
          }
      
          PerformAjaxUpdate() {
              if (this.ajaxUpdateUrl !== '') {
                  this.PerformAjaxCall(this.ajaxUpdateUrl, this.Form.GetFormData());
              }
          }
      }

The C# classes of all the available form controls exist at One.Core.UI.MVC/Forms/Controls directory.

The CSHTML views of all the available form controls exist at OneDealer.MVC/Views/Forms/Controls directory.

The JavaScript files of all the available form controls exist at OneDealer.MVC/Scripts/Forms/Controls directory,

A form control consists of the following basic elements:

NameDescriptionRequiredValue Type
TitleThe title of the control
  •  
string
ControlUIdA Unique Id for the control.
(Usually used in client side)

string
ResourceKeyThe resource key for the translation of the Title
string
ControlClasscss class for the control
string
ContainerClasscss class for the container of the control
string
VisibleIt it will be displayed or not
  •  
bool
IsSystemRequired

If the value of the control is required by the system.

(It can not be overwritten in the personlization)


bool
Required

if the value of the control is required.

(It can be overwritten in personalization)


bool
IsReadOnlyIf the control is in read only state
bool
Disableif the control is in disable state
bool
IsFullWidthif the width of the control is in full width
bool
OrderAn indicator regarding the order that will be displayed
int

Form Control Types

Control TypeDescriptionOD Fully Qualified Assembly Name
InputControlA textbox controlOne.Core.UI.MVC.Forms.Controls.InputControl, One.Core.UI.MVC
DropDownStaticA dropdown control with static valuesOne.Core.UI.MVC.Forms.Controls.DropDownStatic, One.Core.UI.MVC
CheckboxControlA checkbox controlOne.Core.UI.MVC.Forms.Controls.CheckboxControl, One.Core.UI.MVC
DatePickerControlA Date picker controlOne.Core.UI.MVC.Forms.Controls.DatePickerControl, One.Core.UI.MVC
DateTimePickerControlA Date and Time picker controlOne.Core.UI.MVC.Forms.Controls.DateTimePickerControl, One.Core.UI.MVC
DropDownModelSourceA drop down control with remote datasourceOne.Core.UI.MVC.Forms.Controls.DateTimePickerControl, One.Core.UI.MVC
NumericTextboxControlA textbox control for numeric inputOne.Core.UI.MVC.Forms.Controls.NumericTextboxControl, One.Core.UI.MVC
SwitchControlA switch controlOne.Core.UI.MVC.Forms.Controls.SwitchControl, One.Core.UI.MVC
FileUploadControlA control to upload filesOne.Core.UI.MVC.Forms.Controls.FileUploadControl, One.Core.UI.MVC
MapControlA control to display mapOne.Core.UI.MVC.Forms.Controls.MapControl, One.Core.UI.MVC
GridListSelectionA Grid List control, alternative to dropdown , if there are many records.
It has the same capabilities to a Grid List Page
One.Core.UI.MVC.Forms.Controls.IntInputControl, One.Core.UI.MVC
EmailControlA textbox control for email. It provides also email validation / verificationOne.Core.UI.MVC.Forms.Controls.EmailControl, One.Core.UI.MVC
LinkControlA control which displays linkOne.Core.UI.MVC.Forms.Controls.LinkControl, One.Core.UI.MVC
InfoControlA control which displays a read only textOne.Core.UI.MVC.Forms.Controls.InfoControl, One.Core.UI.MVC
PhoneControlA read only control with link to phone valueOne.Core.UI.MVC.Forms.Controls.PhoneControl, One.Core.UI.MVC
PhoneCountryControlA control with formatted phone values by countryOne.Core.UI.MVC.Forms.Controls.PhoneCountryControl, One.Core.UI.MVC
PictureControlA control to display pictureOne.Core.UI.MVC.Forms.Controls.PictureControl, One.Core.UI.MVC
TextareaControlA textare controlOne.Core.UI.MVC.Forms.Controls.TextareaControl, One.Core.UI.MVC
TimePickerControlA Time picker controlOne.Core.UI.MVC.Forms.Controls.TimePickerControl, One.Core.UI.MVC
GridControlA kendo grid controlOne.Core.UI.MVC.Forms.Controls.GridControl, One.Core.UI.MVC
Tabs
<Tab type="One.Core.UI.MVC.Pages.OneDealer.TabPage.OneDealerFormTab, One.Core.UI.MVC">
          <Title>Form Tab</Title>
          <TabIndex>10</TabIndex>
          <FormContainer>
            <Common>
              <PageDataProvider type="OneDealer.IncadeaDemo.BusinessLayer.Models.IncadeaModelDataPageBinderProvider, OneDealer.IncadeaDemo.BusinessLayer">
                <IncadeaDataProvider>
                  <!--<Url>/incadeaapi/get_aftersales_data/{request[vehicleCode]}</Url>-->
                  <Url>/ListDataItem?TestInt=1</Url>
                  <RequestType>GET</RequestType>
                </IncadeaDataProvider>
              </PageDataProvider>
            </Common>
            <FormName>VehicleForm</FormName>
            <Sections>
              <FormSection>
                <Title>General data</Title>
                <SectionID>GENERALDATA</SectionID>
                <Controls>
                  <FormControl type="One.Core.UI.MVC.Forms.Controls.InputControl, One.Core.UI.MVC">
                    <Title>String</Title>
                    <Field>TestString</Field>
                  </FormControl>
                  <FormControl type="One.Core.UI.MVC.Forms.Controls.InputControl, One.Core.UI.MVC">
                    <Title>Bool</Title>
                    <Field>TestBool</Field>
                  </FormControl>
                  <FormControl type="One.Core.UI.MVC.Forms.Controls.InputControl, One.Core.UI.MVC">
                    <Title>Char</Title>
                    <Field>TestChar</Field>
                  </FormControl>
                  <FormControl type="One.Core.UI.MVC.Forms.Controls.InputControl, One.Core.UI.MVC">
                    <Title>Int</Title>
                    <Field>TestInt</Field>
                  </FormControl>
                  <FormControl type="One.Core.UI.MVC.Forms.Controls.InputControl, One.Core.UI.MVC">
                    <Title>Long</Title>
                    <Field>TestLong</Field>
                  </FormControl>
                  <FormControl type="One.Core.UI.MVC.Forms.Controls.InputControl, One.Core.UI.MVC">
                    <Title>Float</Title>
                    <Field>TestFloat</Field>
                  </FormControl>
                  <FormControl type="One.Core.UI.MVC.Forms.Controls.InputControl, One.Core.UI.MVC">
                    <Title>Double</Title>
                    <Field>TestDouble</Field>
                  </FormControl>
                  <FormControl type="One.Core.UI.MVC.Forms.Controls.InputControl, One.Core.UI.MVC">
                    <Title>DateTime</Title>
                    <Field>TestDateTime</Field>
                  </FormControl>
                  <FormControl type="One.Core.UI.MVC.Forms.Controls.InputControl, One.Core.UI.MVC">
                    <Title>TimeSpan (Minutes)</Title>
                    <Field>TestTimeSpan.TotalMinutes</Field>
                  </FormControl>
                </Controls>
              </FormSection>
            </Sections>
          </FormContainer>
        </Tab>

Available controls

InputControl

NameDescriptionRequiredValue Type
FieldThe model property to bind
  •  
string
PlaceholderA placeholder text
string
ErrorA message in case of an error
string
ErrorClassA css class in case of an error
string
MaxLengthThe allowed max length
int
RegexValidationA Regular expression for client validation
string
IsOnlyUppercaseIf is allowed only Uppercase characters
bool
TextMaskAn expression for masking the input
string
Tabs
<FormControl type="One.Core.UI.MVC.Forms.Controls.InputControl, One.Core.UI.MVC">
    <Title>Branch</Title>
    <IsReadOnly>true</IsReadOnly>
    <Disable>false</Disable>
    <IsFullWidth>false</IsFullWidth>
    <Order>90</Order>
    <Required>false</Required>
    <Field>BranchInfo</Field>
	<ResourceKey>Branch</ResourceKey>
</FormControl>

DropDownStatic

NameDescriptionRequiredValue Type
FieldThe model property to bind
  •  
string
DataTextFieldThe model property to bind for text

DataValueFieldThe model property to bind for value

DropDownListItemsA list of items to show
  •  
ListItem

ListItem

NameDescription
TextThe text to display
ValueThe actual value
ResourceKeyThe key for the translation of the text
SelectedIf the item is selected
Disabledif the item is disabled
Tabs
<FormControl type="One.Core.UI.MVC.Forms.Controls.DropDownStatic, One.Core.UI.MVC">
          <Title>Drive Side</Title>
          <IsReadOnly>false</IsReadOnly>
          <Disable>false</Disable>
          <IsFullWidth>false</IsFullWidth>
          <Order>50</Order>
          <Required>false</Required>
          <DropDownListItems>
            <ListItem>
              <Text>L</Text>
              <Value>1</Value>
              <Selected>true</Selected>
            </ListItem>
            <ListItem>
              <Text>R</Text>
              <Value>2</Value>
              <Selected>false</Selected>
            </ListItem>
          </DropDownListItems>
          <DataTextField>Text</DataTextField>
          <DataValueField>Value</DataValueField>
          <Field>DriveSide</Field>
          <ResourceKey>OD0000313</ResourceKey>
</FormControl>

CheckboxControl

NameDescriptionRequiredValue Type
FieldThe model property to bind
  •  
string
PlaceholderA text as a placeholder
string
CheckedWhether is checked or not
bool
Tabs
<FormControl type="One.Core.UI.MVC.Forms.Controls.CheckboxControl, One.Core.UI.MVC">
    <Title>VIP</Title>
    <Order>30</Order>
    <Required>false</Required>
    <Field>IsVip</Field>
	<ResourceKey></ResourceKey>
</FormControl>


DatePickerControl , DateTimePickerControl & TimePickerControl

NameDescriptionRequiredValue Type
FieldThe model property to bind
  •  
string
FormatAn expression for formatting
string
DatePickerControl
<FormControl  type="One.Core.UI.MVC.Forms.Controls.DatePickerControl, One.Core.UI.MVC">
    <Title>First Registration Date</Title>
    <ResourceKey>OD0000285</ResourceKey>
    <Required>true</Required>
    <Order>60</Order>
    <Field>FirstRegistrationDate</Field>
	<Format>dd-MM-yyyy</Format>
</FormControl>
DateTimePickerControl
<FormControl  type="One.Core.UI.MVC.Forms.Controls.DateTimePickerControl, One.Core.UI.MVC">
    <Title>Scheduled Entry Date</Title>
    <ResourceKey>OD0003487</ResourceKey>
    <IsReadOnly>false</IsReadOnly>
    <Disable>false</Disable>
    <IsFullWidth>false</IsFullWidth>
    <Order>25</Order>
    <Required>false</Required>
    <Field>ScheduledEntryDate</Field>
	<Format>dd-MM-yyyy HH:mm</Format>
</FormControl>

DropDownModelSource

NameDescriptionRequiredValue Type
FieldThe model property to bind
  •  
string
ModelSourceTextThe model property to bind for the text
  •  
string
ModelSourceValueThe model property to bind for the value
  •  
string
DropDownDataRequestModelThe element for the remote datasource
  •  
XML Element

DropDownDataRequestModel

NameDescriptionRequiredValue Type
InterfaceThe model property to bind
  •  
string
MethodIf it will display arrows for increase/decrease
  •  
string
ConstructorArgumentsDeclare here the arguments that the method needs to be executed, in a comma seperated expression
  •  
string

Constructor Arguments for GetDropDownData

For the method GetDropDownData

  • if the ConstructorArguments is contained by only one item then the performed request is as a GET request, using that item as the url
    example: <ConstructorArguments>/ListDataPaged</ConstructorArguments>
  • if the ConstructorArguments is contained by more than one items then the performed request is as POST request and the first parameter is the URL and the others is one POST PARAMETER with value an array of strings
    example: <ConstructorArguments>/FetchVehiclesBy,VehicleModels,Families</ConstructorArguments>


DropDownModelSource
<FormControl type="One.Core.UI.MVC.Forms.Controls.DropDownModelSource, One.Core.UI.MVC">
    <Title>DropDownModelSource</Title>
    <Field>TestDropDownModelSource</Field>
    <ModelSourceText>TestString</ModelSourceText>
    <ModelSourceValue>TestInt</ModelSourceValue>
	<DropDownDataRequestModel>
        <Interface>OneDealer.IncadeaDemo.BusinessLayer.Interfaces.IIncadeaActionController, OneDealer.IncadeaDemo.BusinessLayer</Interface>
        <Method>GetDropDownData</Method>
    	<ConstructorArguments>/ListDataPaged</ConstructorArguments>
	</DropDownDataRequestModel>
</FormControl>

NumericTextboxControl

NameDescriptionRequiredValue Type
FieldThe model property to bind
  •  
string
ShowArrowsIf it will display arrows for increase/decrease
string
FormatAn expression for formatting
string
DecimalsNumber of decimals to show
int
MinMin Value
int
MaxMax Value
int
MaxLengthMax length
int
NumericTextboxControl
<FormControl type="One.Core.UI.MVC.Forms.Controls.NumericTextboxControl, One.Core.UI.MVC">
	<Title>Advance Payment</Title>
	<Order>2</Order>
	<Required>true</Required>
	<ResourceKey>OD0001400</ResourceKey>
	<Decimals>2</Decimals>
	<Format>#.00</Format>
	<Field>DownPayment</Field>
</FormControl>

SwitchControl

NameDescriptionRequiredValue Type
FieldThe model property to bind
  •  
string
IsIntControlIf the value is Integer (1/0)
bool
CheckedWhether is checked or not
bool
SwitchControl
<FormControl type="One.Core.UI.MVC.Forms.Controls.SwitchControl, One.Core.UI.MVC">
    <Title>Postal</Title>
    <IsReadOnly>false</IsReadOnly>
    <Disable>false</Disable>
    <WidthType>P25</WidthType>
    <IsFullWidth>false</IsFullWidth>
    <Order>3</Order>
    <Required>true</Required>
    <Field>DPF3</Field>
	<ResourceKey></ResourceKey>
</FormControl>

FileUploadControl

NameDescriptionRequiredValue Type
FieldThe model property to bind
  •  
string
ShowCurrentPreviewIf it will show a preview of the current file
bool
ShowUploadPreviewIf it will show a preview of the uploaded file
bool
FilePathThe file path to save the file
string
UploadMultipleFilesIf it is allowed to upload multiple files
bool
AllowedExtensionsallowed extensions to upload
Item

*Item is a xml array of string values

FileUploadControl
<FormControl type="One.Core.UI.MVC.Forms.Controls.FileUploadControl, One.Core.UI.MVC">
    <Title>Upload Logo</Title>
    <ResourceKey>OD0004756</ResourceKey>
    <IsReadOnly>false</IsReadOnly>
    <Disable>false</Disable>
    <IsFullWidth>true</IsFullWidth>
    <ShowCurrentPreview>true</ShowCurrentPreview>
    <Order>3</Order>
    <Required>false</Required>
    <UploadMultipleFiles>false</UploadMultipleFiles>
    <Field>LogoURL</Field>
    <FilePath>/Content/images/backgrounds/</FilePath>
    <AllowedExtensions>
        <Item>.jpg</Item>
        <Item>.jpeg</Item>
        <Item>.gif</Item>
    	<Item>.png</Item>
	</AllowedExtensions>
</FormControl>

MapControl

NameDescriptionRequiredValue Type
BlockThe block property field to bind

 

string
LatitudeFieldThe Latitude property field to bind
string
LongitudeFieldThe Longitude property field to bind
string
CountyFieldThe County property field to bind
string
CountryFieldThe Country property field to bind
string
CountryNameFieldThe CountryName property field to bind
string
StreetFieldThe Street property field to bind
string
StreetNoFieldThe Street No property field to bind
string
ZipCodeFieldThe Zip Code property field to bind
string
CityFieldThe City property field to bind
string
FullAddressFieldThe Full Address property field to bind
string
PlaceholderA text as placeholder
string
MapControl
<FormControl type="One.Core.UI.MVC.Forms.Controls.MapControl, One.Core.UI.MVC">
    <Title>Bill to</Title>
    <ResourceKey>COMM00004</ResourceKey>
    <IsReadOnly>true</IsReadOnly>
    <Disable>true</Disable>
    <IsFullWidth>false</IsFullWidth>
    <Order>1</Order>
    <Required>false</Required>
    <LatitudeField>BillToLatitude</LatitudeField>
    <LongitudeField>BillToLongitude</LongitudeField>
    <FullAddressField>BillToAddress</FullAddressField>
	<ZipCodeField>BillToZipCode</ZipCodeField>
</FormControl>

GridListSelectionSourceControl

NameDescriptionRequiredValue Type
FieldThe model property to bind
  •  
string
FieldReturnKeyThe property name of the model to return as a key
  •  

 

string
FieldReturnValueThe property name of the model to return as a value
  •  
string
GridTitle

The title of the grid list


string
GridCssClassIconThe fa icon of the grid list
string
GridListSelectionSourceModelThe definition for the remote datasource
  •  
XML Element

GridListSelectionSourceModel

NameDescriptionRequiredValue Type
TypeThe type of the data provider
  •  
OneDealer.IncadeaDemo.BusinessLayer.Models.IncadeaGridListSelectionSourceModel, OneDealer.IncadeaDemo.BusinessLayer
IncadeaDataProviderThe data provider as described in earlier sections
  •  

GridListSelection
<FormControl type="One.Core.UI.MVC.Forms.Controls.MapControl, One.Core.UI.MVC">
    <Title>Bill to</Title>
    <ResourceKey>COMM00004</ResourceKey>
    <IsReadOnly>true</IsReadOnly>
    <Disable>true</Disable>
    <IsFullWidth>false</IsFullWidth>
    <Order>1</Order>
    <Required>false</Required>
    <LatitudeField>BillToLatitude</LatitudeField>
    <LongitudeField>BillToLongitude</LongitudeField>
    <FullAddressField>BillToAddress</FullAddressField>
	<ZipCodeField>BillToZipCode</ZipCodeField>
</FormControl>

EmailControl

NameDescriptionRequiredValue Type
FieldThe model property to bind
  •  
string
IsListSetupif it has a predefined list of emails
bool
SetupKeyThe setup key that will display the list of the emails
string
DisableEmailValidation

If the email validation is active.

If it is active it will search in the setup key "EmailValidationActive"


bool
EmailControl
<FormControl type="One.Core.UI.MVC.Forms.Controls.EmailControl, One.Core.UI.MVC">
    <Title>Email</Title>
    <ControlUId>EmailUID</ControlUId>
    <IsReadOnly>false</IsReadOnly>
    <Disable>false</Disable>
    <IsFullWidth>false</IsFullWidth>
    <Order>5</Order>
    <Required>true</Required>
    <Field>EMail</Field>
    <IsEmail>true</IsEmail>
    <SetupKey>ODDefEmail</SetupKey>
	<ResourceKey>COMM00012</ResourceKey>
</FormControl>

LinkControl

NameDescriptionRequiredValue Type
FieldThe model property to bind
  •  
string
ElementTitleThe anchor text
string
ElementTitleResourceKeyThe key for the translation of the anchor text
string
Urlthe url to display
string
ParameterPropertyThe property field as a parameter to the url
string
OpenInIframeIf it will open in a iframe
bool
LinkControl
<FormControl type="One.Core.UI.MVC.Forms.Controls.LinkControl, One.Core.UI.MVC">
    <Title></Title>
    <ControlUId>DataPrivacyHistoryUIID</ControlUId>
    <ResourceKey></ResourceKey>
    <ElementTitle>Data Privacy History</ElementTitle>
    <ElementTitleResourceKey>OD0006331</ElementTitleResourceKey>
    <IsFullWidth>false</IsFullWidth>
    <Order>50</Order>
    <Field>DocEntry</Field>
    <Url>/BusinessPartner/BPCPDataPrivacyHistory?DocEntry=</Url>
	<ParameterProperty>DocEntry</ParameterProperty>
</FormControl>

InfoControl

Similar to InputControl but readonly

InfoControl
<FormControl type="One.Core.UI.MVC.Forms.Controls.InfoControl, One.Core.UI.MVC">
    <Title></Title>
    <ResourceKey></ResourceKey>
    <IsFullWidth>false</IsFullWidth>
    <Order>50</Order>
    <Field>DocEntry</Field>
</FormControl>

PhoneControl

Similar to InputControl , but readonly and with a link to tel:

PhoneControl
<FormControl type="One.Core.UI.MVC.Forms.Controls.PhoneControl, One.Core.UI.MVC">
    <Title>Phone</Title>
    <ResourceKey></ResourceKey>
    <IsFullWidth>false</IsFullWidth>
    <Order>50</Order>
    <Field>PhoneNumber</Field>
</FormControl>

PhoneCountryControl

NameDescriptionRequiredValue Type
FieldThe model property to bind
  •  
string
RegexValidationAn regular expression for validation
string
PhoneCountryControl
<FormControl type="One.Core.UI.MVC.Forms.Controls.PhoneCountryControl, One.Core.UI.MVC">
    <Title>Telephone 2</Title>
    <IsReadOnly>false</IsReadOnly>
    <Disable>false</Disable>
    <IsFullWidth>false</IsFullWidth>
    <Order>1</Order>
    <Required>false</Required>
    <Field>Tel2</Field>
	<ResourceKey>WorkPhone</ResourceKey>
</FormControl>

TextareaControl

NameDescriptionRequiredValue Type
FieldThe model property to bind
  •  
string
PlaceholderA text as a placeholder
string
IsNotHtmlControlIf it is a HTML Control (WYSIWYG Editor)
bool
ShowToolsShow editor tools
bool
TextareaControl
<FormControl type="One.Core.UI.MVC.Forms.Controls.TextareaControl, One.Core.UI.MVC">
    <Title>Notes</Title>
    <ResourceKey>OD0003154</ResourceKey>
    <IsReadOnly>false</IsReadOnly>
    <Disable>false</Disable>
    <IsFullWidth>true</IsFullWidth>
    <Order>60</Order>
    <Required>false</Required>
	<Field>Notes</Field>
</FormControl>
Write a comment…