Descendant of ITPElement that represent a sub node in the tree. The element may be associated with an answer, consisting of two components: an internal answer and a screen answer. ITPPageElement supports the validation of an answer, which may either be valid, invalid (may not be submitted), or unacceptable (may not be on the screen). The element may be hidden. The element may be associated with a Help text and a feedback text. The element may have its own representation of the empty (null) value.
constructor |
|
ITPPageElement |
Simple initialization of local variables. |
public methods |
|
getAnswer() |
Returns the current (internal) answer. |
setAnswer(pAnswer) |
Attempts to set the answer pAnswer. Returns the validation result. If this is valid, applies the answer. |
isValid() |
Returns the 'worst' validation result of the internal answers of the sub tree defined by the current object. |
show() |
Shows the element screenelements.container of the current object. |
hide() |
Hides the element screenelements.container of the current object. |
getHelptext() |
Returns the current Help text. |
setHelptext(pHelptext) |
Sets the current Help text to pHelptext. |
getFeedback() |
Returns the current feedback text. |
setFeedback(pFeedback) |
Set the current feedback text to pFeedback. |
scrollIntoView |
Scroll the current element into view. |
overrides |
|
initialize(pCallback, pSuppressImmediateCallback) |
Sets the default answer, the Help text and the feedback text. |
initScreenElements() |
Finds the element with the id "[ID]_container", where [ID] is the object identifier of the object and stores this as result.container. Finds the elements within this container with the id "[ID]_help" and "[ID]_feedback" and stores them as result.helpimage and result.feedbackimage, respectively. Adds the spans result.helpspan and result.feedbackspan with the proper JQuery icon classes associated, making sure all Hep and feedback indications are initially hidden. They may be shown during later steps in the initialization process. |
synchronize() |
Sends the current internal value of the element as part of a "valuechange" message. |
other methods |
|
scrollIntoView |
Make sure the element is part of the visible part of the page. |
prepareForSubmission(pCallback) |
Will be called before a form is submitted, in order to allow nodes in the tree to prepare for submission e.g., used by editable (rich) text block questions. This method is intended to be called between parents and children in the tree only. Children will have to report back through the readyForSubmission method of their parent. |
readyForSubmission(pElement, pValid) |
Method to be called from child to parent, once a child has finished preparing for submission, passing themselves as pElement and the current validation status as pValid. |
getInternalAnswer |
Returns the internal answer. |
setInternalAnswer(pAnswer) |
Validates pAnswer and sets the internal answer to pAnswer if it is not unacceptable. Makes sure that the null value of the class is never deemed unacceptable. Synchronizes if the internal answer is changed. |
applyInternalAnswer() |
Makes sure the internal answer is applied to the screen. |
getScreenAnswer() |
Returns the answer that is currently displayed on the screen. To be overridden by descendant classes. |
setScreenAnswer(pAnswer) |
Makes sure the answer on the screen is set to pAnswer. To be overridden by descendant classes. |
applyScreenAnswer() |
Makes sure the screen answer is set as the internal answer. Unless it is unacceptable, in which case the internal answer is applied to the screen answer. |
validate(pAnswer) |
Simply returns valid. To be overridden by descendant classes. |
getNullValue() |
Simply returns "". To be overridden by descendant classes. |