Wizard JavaScript functions

To use the following JavaScript functions, first write code for the functions that implement your business logic. Once the code is written use these JavaScript functions in your wizard. Your JavaScript file is specified in the wizard XML file.

Function Name Description
submitErrorHandler(errMessage, errorStatus) Called when an error is received from the controller command.
submitFinishHandler(finishMessage) Called upon successful completion by the controller command.
submitCancelHandler() Called when Cancel then OK to confirm the cancel action is clicked.
preSubmitHandler() Optionally, called after the validateAllPanels() function, but before the finish controller command.

Use the following JavaScript functions in your wizard, they are implemented in WebSphere Commerce by default. The following functions are defined in the parent frame, and are called using parent.functionName():

Function Name Description
get(key, defaultValue) Returns the value of the specified key from the object model. These keys are the parameters entered into the parent frame. The panel frame
uses this function to get the value of these parameters.
remove(key) Removes the specified key from the object model.
put(key, value) Stores the value for the specified key in the object model. These keys are the parameters entered into the panel frame. The panel frame
uses this function to put the value of these parameters into the parent frame. All JavaScript objects that are stored in the object model using this function are submitted automatically to the finish controller command and can be retrieved by their values from the requestProperties object.
setContentFrameLoaded(value) Sets the contentFrameLoaded variable to either true or false. If true, then the user is allowed to switch to a different content panel. If false, the user must wait until the panel has been loaded which sets the value to true.

Developers of content panels must call setContentFrameLoaded(true) at the end of the panel body's onLoad() function. If this is not called, users will remain on the current content panel.
getRequestProperties() Gets the Request Properties. All parameters sent back to the navigation frame (provided they are strings) are put into a request property JavaScript hashtable. These parameters can be accessed by calling this JavaScript function.
addURLParameter(pname, value) Adds an additional URL parameter to finish command.
removeURLParameter(pname) Removes the URL parameter, previously added using the addURLParameter() function.

Related concepts

Related tasks