Tohu - JQuery client extension points

Hooks in dynamicUI_main.js:

- preQuestionnaireLoad(<Root div ID>, <Knowledge Base>)
If defined this function is called before any work it done to load the initial questionnaire, but after the various configuration options have been set.

- postQuestionnaireLoad(<Root div ID>, <Knowledge Base>)
If defined this function is called after the initial questionnaire has finished loading.

- preRefreshScreen(<ResultSetObject>, <ID of the last question that was answered>)
If defined this function is called just before the screen is updated with the results of an AJAX query (of any type). The ResultSetObject parameter is a custom javascript object containing a list of all the facts that will be created, updated or deleted.

- postRefreshScreen(<ResultSetObject>, <ID of the last question that was answered>)
If defined this function is called just after the screen is updated with the results of an AJAX query (of any type). The ResultSetObject parameter is a custom javascript object containing a list of all the facts that were created, updated or deleted.

- preProcessDelete(<IDObject>)
If defined this function is called just before the fact identified by the IDObject is removed from the screen.

- postProcessDelete(<IDObject>)
If defined this function is called just after the fact identified by the IDObject is removed from the screen.

- preProcessCreate(<Fact Object>)
If defined this function is called just before the supplied fact is added to the screen.

- postProcessCreate(<Fact Object>)
If defined this function is called just after the supplied fact is added to the screen.

- preProcessUpdate(<Fact Object>)
If defined this function is called just before the supplied fact is updated on the screen.

- postProcessUpdate(<Fact Object>)
If defined this function is called just after the supplied fact is updated on the screen.

- preChangeEvent(<Question ID>, <New Value>)
If defined this function is called just before the specified answer to the specified question is sent to the rules server.

- postChangeEvent(<Question ID>, <New Value>)
If defined this function is called just after the screen is updated to reflect the specified answer to the specified question.

- onChangeEvent(<Question ID>, <New Value>)
If defined this function is called just before the specified answer to the specified question is sent to the rules server and if it returns True it replaces the default processing (Ajax call followed by screen refresh)

- preActionEvent(<Action ID>, <Action Type>, <Action>)
If defined this function is called just before the specified control action is executed.

- postActionEvent(<Action ID>, <Action Type>, <Action>)
If defined this function is called just after the specified control action is executed.

- onActionEvent(<Action ID>, <Action Type>, <Action>)
If defined this function is called just before the specified control action is executed and if it returns True it replaces the default processing (set active item, display error or submit completion action).

 

- onShowError(<Action ID>, <Action>)

If defined this function overides the default behaviour of displaying the traditional Browser Alert indicating validation errors.  E.g. one could replace this with displaying the validation error messages to their corresponding questions, using CSS styling.

 

- onCompleteQuestionaire(<url>, <Action>)

If defined this function overides the default behaviour of rendering content upon completion of the questionnaire on the same Browser window/tab. E.g.  A PDF might be generated at the end of the questionnaire summarising the answers.  One could get this to display on a different Browser window/tab.

 

 

Hooks in dynamicUI_interface.js:

- onGetQuestionnaireActions(<Questionnaire Object>, <Question has errors flag>)
If defined this method overrides the default Control generation (Next, Previous, Done). Must return an array of ActionObjects.

- onProcessValidation

If defined this method overrides the default error action assigned to the "Next" navigation point, when errors exist.  Must return an ActionObject

 

- onBatchExecutionInitialQuestionnaire

If defined this method overrides the XML "BatchExcecution" message sent to the Execution Server when loading the Questionnaire or refreshing a web page

 

- onBatchExecutionQuestionAnswer

If defined this method overrides the XML "BatchExcecution" message sent to the Execution Server when answering a question

 

- onBatchExecutionActiveItem

If defined this method overrides the XML "BatchExcecution" message sent to the Execution Server when navigating between Tohu "pages"

 

Hooks in dynamicUI_html.js:


- onGetObjectClass(<Fact Object>)
If defined this function overrides the default CSS classes assigned to all fact types. Must return a space separated set of classes for the specified fact


Hooks in dynamicUI_messages.js:

- ERROR_TYPES
Not actually a hook as such, this is an anonymous object which defines the error messages and can be updated by application specified code.