Develop > Presentation layer > Customize WebSphere Commerce Accelerator, Organization Administration Console, or Administration Console > Tools framework > Dialogs


Add a dialog

Each of these files are created or modified by creating a dialog:

Files created:

Files modified:

To add a dialog:


Procedure

  1. Create a dialog definition XML file that describes the flow among panels and data bean usage. Create the file, for example, named newDialog .xml, in the WC_INSTALL/xml/tools/ componentname, where componentname is the name of the component to which the dialog belongs.

    For more information, see Dialog definition.

  2. Register the dialog definition XML file in the appropriate resources.xml file.

    Multiple versions of this file exist, one for each component, in this directory:

    • WC_INSTALL/xml/tools/componentname/resources.xml

    • workspace_dir/wc/xml/tools/componentname/resources.xml

    Make an entry in resources.xml that is similar to this example:

    <XML name="sampleDialog"
    file="componentname/newDialog.xml"/>
    

    The name attribute becomes a key which will be used in a future step.

    Since the WebSphere Commerce configuration file references the resources.xml files, also update the WebSphere Commerce configuration file to register any new resources.xml files.


  3. Write panels using JSP files and JavaScript. These JSP files define the panels that display in the content frame into which users enters data. This table describes the required JavaScript functions:

    Function Name Description
    savePanelData() Stores HTML form data into model (parent frame). This function savePanelData() must be supplied in each content frame to save the current panel's data in the model.
    validateNotebookPanel() An optional function which validates data entered by user.

  4. Write custom commands to update the database and perform custom functionality. These commands update the database with the information entered, or perform some function when the user clicks OK. If the dialog is called using a viewCommand, write a custom viewCommand.

    See Example: Wizard, dialog or notebook controller command for more information.

  5. Register custom commands and JSP files in the database. Once required commands are created, register them in the database. Verify the URL field in the database matches the value of the finishURL attribute in the XML file. For details on how to register commands see Design patterns.


  6. Create a resource bundle adding text that appears as the title of the dialog. Locate these files in this directory:

    • WC_EAR/properties/com/ibm/commerce/tools/componentname/properties

    • workspace_dir/wc/properties/com/ibm/commerce/tools/ componentname/properties

    where componentname is the component to which you are adding the dialog.

    If national languages are supported, create the national language resource bundles with the appropriate language text. The national language file names must end with the locale supported. For example, for a French-language resource bundle, the file name should be filename_fr_FR.properties

  7. (Optional) Write context sensitive help files for your dialog and update a Tools User Interface Center help map XML file to include the help files. See Add context-sensitive help into the Tools User Interface Center for more information.

  8. Add the new dialog to a Tools User Interface Center menu system, for example, WebSphere Commerce Accelerator. Refer to Integrate tools into the Tools User Interface Center for more information.

  9. Complete these steps to launch and test the dialog:

    Stop and start WebSphere Commerce then test the new dialog. This is the URL of the newly created dialog:

    https:// host_name :8000/webapp/wcs/tools/servlet/DialogView?XMLFile= namespace.myTestDialog,

    where namespace is defined in resources.xml.


Related concepts

Dialogs

Tools User Interface Center


Related tasks

Add a search dialog

Related reference

Dialog navigation behavior

Dialog JavaScript functions


+

Search Tips   |   Advanced Search