Dialog JavaScript functions

To use the following JavaScript functions, first write code for the functions that implements your business logic. Once the code is written you can use these JavaScript functions in your dialog. Your JavaScript file is specified in the dialog's 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.

You can use the following JavaScript functions in your dialog, they are implemented by WebSphere Commerce by default. These 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.
remove(key) Removes the specified key from the object model.
put(key, value) Stores the value for the specified key in the object model.
addURLParameter(pname, value) Adds an additional URL parameter to finish command.
removeURLParameter(pname) Removes the URL parameter, previously added using the addURLParameter() function.
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.
Note:
You must call setContentFrameLoaded(true) at the end of the panel's onLoad() function. If this is not called , users will be stuck on the current content panel.