Html Area

(part of package 'Servoy Extra Components') Extends designtime/SolutionModel: JSWebComponent Extends runtime: RuntimeWebComponent

This is a reference page; many components have detailed usage guides here.

Properties

dataProviderID

Type: dataprovider


displaysTags

Type: boolean


editable

Type: protected Default Value: true


enabled

Type: enabled Default Value: true


placeholderText

Type: tagstring


readOnly

Type: readOnly


responsiveHeight

Min height of the html editor, set only in responsive forms.

Type: int Default Value: 300


scrollbars

Type: scrollbars


styleClass

Type: styleclass


tabSeq

Type: tabseq


text

Type: tagstring


toolTipText

Type: tagstring


visible

Type: visible


Events

onActionMethodID

Parameters:

event JSEvent


onDataChangeMethodID

Parameters:

oldValue ${dataproviderType} newValue ${dataproviderType} event JSEvent

Returns: boolean


onFocusGainedMethodID

Parameters:

event JSEvent


onFocusLostMethodID

Parameters:

event JSEvent


onRightClickMethodID

Parameters:

event JSEvent


API

getAsPlainText

Gets the plain text for the formatted Html Area.

@example

var my_text = myElement.getAsPlainText();

@return the plain text

Returns: string


getScrollX

Returns the x scroll location of specified element - only for an element where height of element is less than the height of element content. NOTE: getScrollX() can be used with getScrollY() to set the scroll location of an element using the setScroll function.

For Example:

//returns the X and Y scroll coordinates
var x = forms.company.elements.myarea.getScrollX();
var y = forms.company.elements.myarea.getScrollY(); 
//sets the new scroll location
forms.company.elements.myarea.setScroll(x+10,y+10);

@example

var x = myElement.getScrollX();

@return The x scroll location in pixels.

Returns: int


getScrollY

Returns the y scroll location of specified element - only for an element where height of element is less than the height of element content. NOTE: getScrollY() can be used with getScrollX() to set the scroll location of an element using the setScroll function.

For Example:

//returns the X and Y scroll coordinates
var x = forms.company.elements.myarea.getScrollX();
var y = forms.company.elements.myarea.getScrollY();
//sets the new scroll location
forms.company.elements.myarea.setScroll(x+10,y+10);

@example

var y = myElement.getScrollY();

@return The y scroll location in pixels.

Returns: int


getSelectedText

Returns the currently selected text in the specified Html Area.

@example

var my_text = myElement.getSelectedText();

@return {String} The selected text in the Html Area.

Returns: string


replaceSelectedText

Replaces the selected text; if no text has been selected, the replaced value will be inserted at the last cursor position.

@example

myElement.replaceSelectedText('John');

@param s The replacement text. @return The new content after replace.

Parameters:

s string

Returns: string


requestFocus

Set the focus to this Html Area.

@example

myElement.requestFocus();

@param mustExecuteOnFocusGainedMethod (optional) if false will not execute the onFocusGained method; the default value is true

Parameters:

mustExecuteOnFocusGainedMethod boolean (optional)


selectAll

Selects all the contents of the Html Area.

@example

 myElement.selectAll();

setScroll

Sets the scroll location of an element. It takes as input the X (horizontal) and Y (vertical) coordinates - starting from the TOP LEFT side of the screen - only for an element where the height of the element is greater than the height of element content NOTE: getScrollX() can be used with getScrollY() to return the current scroll location of an element; then use the X and Y coordinates with the setScroll function to set a new scroll location.

For Example:

//returns the X and Y coordinates
var x = forms.company.elements.myarea.getScrollX();
var y = forms.company.elements.myarea.getScrollY();
//sets the new location
forms.company.elements.myarea.setScroll(x+10,y+10);

@example

myElement.setScroll(200,200);

@param x the X coordinate of the htmlarea scroll location in pixels @param y the Y coordinate of the htmlarea scroll location in pixels

Parameters:

x int y int


Last updated