Returns true
if the interview is currently visible; false
if not.
Indicates whether or not a popup interview is currently displayed. A popup interview is displayed when the user clicks a script link dialog element that causes additional variables or dialogs to be asked.
Returns true
if a popup interview is currently visible; false
if not.
Attaches an assembly session.
Indicates whether or not a view (page) of the interview is available. This can be used to avoid calling SwitchView if the target view is unavailable.
The view to be displayed: Interview, AnswerSummary, DocumentPreview.
Detaches the current assembly session.
Returns a string (up to 70 characters in length) that represents the user's current location in the interview, including the input field that contains the focus. The bookmark from this method is used as the input to the GotoInterviewBookmark method to return the user to that same location in the interview.
If the current answer set changes between the time the bookmark is created and when it is used, the bookmark may no longer be valid. For example, if you create a bookmark to the 5th repetition of a repeated dialog, but later delete answers so there are only four repetitions, that bookmark will no longer be valid.
var interviewOptions = {
OnInit: function ()
{
HD$.RegisterHandler("PreHDSubmit",
function (eventArgs)
{
if (eventArgs.Context == "InterviewComplete")
{
var viewState = document.getElementById("__VIEWSTATE");
if (viewState)
fieldArray["__VIEWSTATE"] = viewState.value;
}
eventArgs.FieldArray["InterviewBookmark"] = HD$.GetInterviewBookmark();
}
);
}
};
The requested interview bookmark.
Returns the current answer set as JSON.
Indicates whether or not the specified interview UI element is visible.
The UI element to show or hide: Toolbar, AnswerSummary, DocumentPreview
Navigates the user to a specific dialog in the interview, and moves the focus to a designated field within that dialog. If the bookmark is invalid, or the location is no longer part of the interview, no navigation takes place.
If the current answer set changes between the time the bookmark is created and when it is passed into the bookmark parameter, the bookmark may no longer be valid. For example, if you create a bookmark to the 5th repetition of a repeated dialog, but later delete answers so there are only four repetitions, that bookmark will no longer be valid.
Calling GotoInterviewBookmark with an invalid bookmark string will not have any effect.
var interviewOptions = {
OnInit: function ()
{
HD$.RegisterHandler("OnHDStart",
function (eventArgs) { HD$.GotoInterviewBookmark('Job Information|1'); }
);
}
};
Invokes an interview command.
The command to invoke.
This function overlays the supplied answer JSON string over the answer set in the current interview.
Where there is an answer in the JSON string that matches an interview variable by name and variable type, the interview variable will be updated with the new answer value. Where there is not a matching answer in the JSON, any existing answers in the interview will be unchanged.
The supplied answer JSON must be in the correct format. For example:
[{\"n\":\"Employee Name\",\"t\":\"TX\",\"v\":\"John Smith\"},{\"n\":\"Employee Role\",\"t\":\"TX\",\"v\":\"Engineer\"},{\"n\":\"Holiday Days\",\"t\":\"NU\",\"v\":30},{\"n\":\"Employee Date of Birth\",\"t\":\"DA\",\"v\":\"15 05 1975\"},{\"n\":\"Employee Locations\",\"t\":\"TL\",\"v\":{\"v\":[\"Aberdeen\",\"Birmingham\"]}}]
You can get answer JSON from an interview using the GetJSONAnswers method.
Registers an event handler for an associated variable component. The handler function is called when a user changes the answer of the variable in the interview.
A JavaScript function that will be called any time the event for which it is registered occurs. It should accept a single parameter, eventArgs, the contents of which are described as follows:
Property | Description> |
---|---|
VariableName | The name of the variable which the interview event is linked to |
Value | The answer(s) held for the linked variable |
Registers an event handler for an Interview Event Dialog Element. The handler function is called when a user clicks the dialog element's button.
A string representing the name of the Interview Event Dialog Element to subscribe to.
A JavaScript function that will be called any time the event for which it is registered occurs. It should accept a single parameter, eventArgs, the contents of which are described as follows:
Property | Description> |
---|---|
VariableName | The name of the dialog element which the interview event is linked to |
Value | The answer(s) held for the linked variable |
Registers event handlers for various interview events. If necessary the event handler can later be unregistered using the UnregisterHandler method. RegisterHandler can be used to register for the following interview events:
The EventArgs object passed to your event handler does not have any properties.
The EventArgs object passed to your event handler has the following properties:
Property | Description |
---|---|
DialogName | The name of the dialog to which the user has navigated. |
The EventArgs object passed to your event handler has the following properties:
Property | Description |
---|---|
DialogName | This is the name of the dialog the user is attempting to leave. |
DialogTitle | This is the title of the dialog the user is attempting to leave. If not set in the template, it will be an empty string. |
TargetName | This is the name of the dialog to which the user is attempting to navigate. |
TargetTitle | This is the title of the dialog the user is attempting to navigate. If not set in the template, it will be an empty string. |
Cancel |
If you set this Boolean property to true, the user's attempt to navigate away from the dialog will be cancelled.
Caution: If you cancel the user’s navigation, it is strongly recommended that you supply a CancelMessage. If you do not, you should undertake some other means of communicating to the user why they are not being allowed to navigate away from the current dialog. |
CancelMessage | If navigation was cancelled and this property is a non-empty string, a message box is displayed to the user to indicate why navigation was cancelled. |
The EventArgs object when this event is called has the following properties:
Property | Description |
---|---|
Cancel | If you set this Boolean property to true, the user's attempt to finish the interview will be cancelled, leaving them at the current dialog. |
CancelMessage |
If navigation was cancelled and this property is a non-empty string, a message box is displayed to the user to indicate why navigation was cancelled.
Caution: If you cancel the user’s navigation, it is strongly recommended that you supply a CancelMessage. If you do not, you should undertake some other means of communicating to the user why they are not being allowed to navigate away from the current dialog. |
The EventArgs object when this event is called has the following properties:
Property | Description |
---|---|
Context |
A string indicating the context in which the event handler was called. It can be one of the following values:
|
The EventArgs object when this event is called has the following properties:
Property | Description |
---|---|
Answered | The number of answered questions, not counting answers to optional questions |
Total | The total number of questions in the interview (not counting optional questions) |
State |
A number indicating the state of the interview as a whole.
|
The EventArgs object passed to your event handler has the following properties:
Property | Description |
---|---|
Cancel | If you set this Boolean property to true, the session completion dialog will not be displayed. |
CancelMessage | If the dialog display was cancelled and this property is a non-empty string, a message box is displayed to the user with this string instead. |
There are no event args for this event
There are no event args for this event
A string representing the name of an interview event. You can specify any string, but only valid APIEvent strings are supported and will cause your event handler to be called.
A JavaScript function that will be called any time the event for which it is registered occurs. It should accept a single parameter, EventArgs, the contents of which vary depending on the event.
Save the interview answers. If you provide a callback function, it will be called when the save is complete. Note: the interview automatically saves answers as users navigate through the interview. You are never required to call this function. It is made available so that you can force an answer save if necessary.
Show or hide parts of the interview user interface.
The UI element to show or hide: Toolbar, AnswerSummary, DocumentPreview
Indicates whether the element should be shown or hidden.
Shows a modal message box.
The string of text you wish to display on the message box.
The string of text you wish to display in the message box's title bar.
The CSS class name of the icon to display in the title bar (by default, it is 'hd-alert').
Displays a Print button on the message box for printing its contents. (Default is false)
Switch between Interview, Answer Summary, and Document Preview views of the interview.
The view to be displayed: Interview, AnswerSummary, DocumentPreview.
Unregisters an event handler for an interview event that was previously registered using the RegisterHandler method.
A string representing the name of an interview event. You should specify the same string you used when registering the event handler.
The JavaScript function that was registered as an event handler, which you would like to unregister.
Indicates whether or not the interview is currently displayed.