Logo

Docs

  • HOME

RMP_TextInput

Text, Mail, Date and Number input widget

new RMP_TextInput(conf)

This constructor allows you to create an input widget that can be inserted dynamically in your web interface
Parameters:
Name Type Description
conf Object JSON structure which contains the configuration of the text, mail, date or number input
Example
var conf = {"id":"id_input","label":{"text":"Text input"},"variable":[{"name":"my_variable","value":"foo"}],"js-type":"RMP_TextInput"};
var id_input= new RMP_TextInput(conf);
id_widget.insertBefore(id_input);

Methods

getContainerIndex() → {String}

Returns:
the index of the container of the widget, it might be the index of the column if the widget is in an array or the index of the tab if it's in a tab panel
Type
String

getDate() → {String}

Returns:
Returns the date field of the date input widget
Type
String

getDefaultValue() → {String}

Returns the default value of the widget (use RMP_TextInput#setValue to set a default value)
Returns:
Type
String

getElement() → {object}

This function returns the html object of the widget
Returns:
Type
object

getLabel() → {String}

This function returns the label of a widget (if he has one)
Returns:
Type
String

getListOfMyVariables() → {object}

This function returns the list of variables of the widget
Returns:
Type
object
Example
   ["id8.label","id8.value"] for list or ["textvar"] for a text input
 

getMissingVariableMessage() → {String}

This function returns the message displayed if a mandatory widget's variable is missing
Returns:
Type
String

getName() → {String}

This function returns the id as string of the widget
Returns:
Type
String

getNumber() → {String}

Returns:
Returns the number field of the number input widget
Type
String

getParent() → {object}

Returns:
the parent widget of a widget
Type
object

getPatternWarning() → {String}

Returns the pattern warning of the widget
Returns:
Type
String

getText() → {String}

Returns:
the text field of the widget
Type
String

getTextType() → {String}

Returns the text type of the widget
Returns:
Type
String

getTooltip() → {String}

This function returns the tooltip text of the widget
Returns:
Type
String

getType() → {String}

This function returns the type of the widget(RMP_Image, RMP_Html, RMP_Scripter, RMP_StaticTextwidget, RMP_Button, RMP_TextInput, RMP_ListBox, RMP_MultiSelectionCheckBox, RMP_RadioButton, RMP_Array, RMP_FileUpload... )
Returns:
Type
String

getValidationVariableMessage() → {String}

This function returns the message displayed if a validation rule is not met
Returns:
Type
String

getValue() → {String}

This function returns the value of the widget's variable. It does not work for list's widgets (check box list, radio button list and list) where you should use widgetID.getSelectedValue.
Returns:
Type
String

getVariableValue(varName) → {String}

This function returns the value of a given variable of the widget
Parameters:
Name Type Description
varName String
Returns:
Type
String

insertAbove(widget)

This function allows you to insert above widgetID, the new widget created thanks to new RMP_xxx() function
Parameters:
Name Type Description
widget object the inserted widget

insertAfter(widget)

This function allows you to insert on the left of widgetID, the new widget created thanks to new RMP_xxx() function
Parameters:
Name Type Description
widget object the inserted widget

insertBefore(widget)

This function allows you to insert on the right of widgetID, the new widget created thanks to new RMP_xxx() function
Parameters:
Name Type Description
widget object the inserted widget

insertBelow(widget)

This function allows you to insert below widgetID, the new widget created thanks to new RMP_xxx() function
Parameters:
Name Type Description
widget object the inserted widget

isActive() → {boolean}

This function returns true if the widget is active and false otherwise
Returns:
Type
boolean

isEmptyVariable(variable) → {boolean}

This function returns true if the the widget's variable is empty and false otherwise
Parameters:
Name Type Description
variable String
Returns:
Type
boolean

isEnabled() → {boolean}

This function returns true if a widget is active and false otherwise
Returns:
Type
boolean

isFollowKeyPressEnabled() → {boolean}

Returns:
Returns true if keypress field is enabled and false otherwise
Type
boolean

isIndexed() → {boolean}

This function returns true if the the widget's variable is an array and false otherwise
Returns:
Type
boolean

isIndexedVariable(name) → {boolean}

This function returns true if the the widget's variable is an array and false otherwise
Parameters:
Name Type Description
name String
Returns:
Type
boolean

isRequired() → {boolean}

This function returns true if the the widget's variable is required and false otherwise
Returns:
Type
boolean

isValid(checkRules) → {boolean}

This function returns true if the the widget's variable is valid and false otherwise
Parameters:
Name Type Description
checkRules boolean
Returns:
Type
boolean

isValidVariable(varName) → {boolean}

This function returns true if the the widget's variable is valid and false otherwise
Parameters:
Name Type Description
varName String
Returns:
Type
boolean

isVisible() → {boolean}

This function returns true if the widget is visible and false otherwise
Returns:
Type
boolean

moveAfter(widget)

This function allows you to move widgetID2 after (on the the right) widgetID1
Parameters:
Name Type Description
widget object the inserted widget

moveBefore(widget)

This function allows you to move widgetID2 before (on the left) widgetID1
Parameters:
Name Type Description
widget object the inserted widget

remove(widget)

This function allows you to remove widgetID. If removeVariable is set to true, it will also deleted content of variable attached to widget
Parameters:
Name Type Description
widget object the inserted widget

setActive(active)

This function allows to set the widget as active/inactive
Parameters:
Name Type Description
active boolean

setCustomDateHandler(customDateHandler)

Add a custom handler to compute the selected or entered date by the end user before setting the date input widget variable By default, the offset time is set to UTC 12:00 If a custom handler is configured then it affects all the input date widgets of the Web Interface
Parameters:
Name Type Description
customDateHandler RMP_TextInput~customDateHandler
Example
 RMP_TextInput.prototype.setCustomDateHandler(function(selectedDate){
    var computedDate = new Date(selectedDate.getTime());
    computedDate.setHours(12);
    computedDate.setMinutes(0);
    computedDate.setSeconds(0);
    return computedDate;
})
 

setDate(utcDate)

Sets the (text) date field of the date input widget
Parameters:
Name Type Description
utcDate String

setEnabled(e)

This function allows to set a widget as active/inactive
Parameters:
Name Type Description
e boolean

setFollowKeyPressEnabled(enabled)

Sets the keypress field
Parameters:
Name Type Description
enabled boolean

setLabel(text)

This function sets the label of a widget (except for html, image, array and static text widgets which don't have label field)
Parameters:
Name Type Description
text String

setMissingVariableMessage(msg)

This function sets the message displayed if a mandatory widget's variable is missing
Parameters:
Name Type Description
msg String

setNumber(n)

Sets the (text) number field of the number input widget
Parameters:
Name Type Description
n String

setPatternWarning(warning)

Sets the pattern warning of the widget
Parameters:
Name Type Description
warning String

setRequired(req)

This function sets the mandatory status of the widget's variable
Parameters:
Name Type Description
req boolean

setText(text)

Sets the text field of the widget
Parameters:
Name Type Description
text String

setTooltip(tooltip)

This function sets the tooltip text of the widget
Parameters:
Name Type Description
tooltip String

setValidationVariableMessage(msg)

This function sets the message displayed if a validation rule is not met
Parameters:
Name Type Description
msg String

setValue(value)

This function sets the value of the widget's variable. It does not work for list's widgets (check box list, radio button list and list) where you should use widgetID.setSelectedValue.
Parameters:
Name Type Description
value String

setVariableValue(varName, value)

This function sets the value of a given variable of the widget
Parameters:
Name Type Description
varName String
value String

setVisible(v)

This function allows to set the widget as visible/invisible
Parameters:
Name Type Description
v boolean

Type Definitions

customDateHandler(date) → {Object}

Update the default behaviour on computing the return date (including time) after the end user has just entering a date (without time) from the date input widget
Parameters:
Name Type Description
date Object selected or typed date
Returns:
computed datetime
Type
Object

Index

Widgets

  • RMP_Array

  • RMP_Button

  • RMP_Captcha

  • RMP_CheckBox

  • RMP_CustomWidget

  • RMP_FileUpload

  • RMP_GeoLocation

  • RMP_History

  • RMP_Html

  • RMP_HtmlPreview

  • RMP_Image

  • RMP_IncludedCollection

  • RMP_List

  • RMP_ListBox

  • RMP_ListenerComponent

  • RMP_MultiSelectionCheckBox

  • RMP_ProgressBar

  • RMP_RadioButton

  • RMP_Report

  • RMP_Scripter

  • RMP_Section

  • RMP_Spinner

  • RMP_StaticTextArea

  • RMP_TabPanel

  • RMP_TextInput

  • RMP_Tree

  • RMP_UrlInput

Static

  • JSON

  • RMP_RunMyApp

  • RMPApplication

  • RMPWidgets


© Akorbi Digital RMP. All Rights Reserved - Legal terms - Contact