Functions dedicated to widgets.
this function takes a DOM node defining a widget and instantiates / builds the appropriate widget class
This function is called on load and is in charge to build JS widgets according to DOM nodes found in the page
hiddenInputHandlers defines all methods specific to handle the hidden input created along the standard text input. An hiddenInput is necessary when displayed suggestions are different from actual values to submit. Imagine an autocompletion widget to choose among a list of CWusers. Suggestions would be the list of logins, but actual values would be the corresponding eids. To handle such cases, suggestions list should be a list of JS objects with two label and value properties.
inspects textarea with id areaId and replaces the current selected text with text. Cursor is then set at the end of the inserted text.