Show TOC

Background documentationSynchronizing with the Property Editor Locate this document in the navigation structure

 

One of the key features of the wizard toolkit is that you can synchronize wizard controls with properties of the object to be created. The wizard can automatically save the information entered into a control by the administrator to the corresponding property in the object.

When creating the user interface for a pane in the pane's setupPane() method, you create wizard controls and synchronize them to a property of the object to be created.

For example, a portal component defines a property called Email Address, and a template object based on this component exists in the portal. In the wizard for the component, you can create a pane that includes a wizard component for this property, as follows:

  1. Get the ID of the template by using an IBasicObjectCreationService helper object.

    Use the standard PortalRuntime.getRuntimeResources().getService() method for creating this helper object.

    Syntax Syntax

    1. IBasicObjectCreationService _basicObjService =
          (IBasicObjectCreationService) PortalRuntime.getRuntimeResources()
              .getService(IBasicObjectCreationService.KEY);
      
      String targetId = _basicObjService.getTargetIdParam(context);
      
    End of the code.
  2. Create the appropriate control for the Email Address property by using an IWizardComponentFactory object. The IWizardComponentFactory object queries the template to determine the appropriate control.

    Use the standard PortalRuntime.getRuntimeResources().getService() method for creating this factory object.

    Syntax Syntax

    1. IWizardComponentFactory wizardCompFactory =
          (IWizardComponentFactory)PortalRuntime.getRuntimeResources()
              .getService(IWizardComponentFactory.KEY);
      
      AbstractInputComponent emailAddress =
          wizardCompFactory.getControlForAttribute(
              targetId, "Email Address", context.getRequest());
      
    End of the code.
  3. Associate the control to the Email Address property of the object to be created.

    Syntax Syntax

    1. _basicObjService.setComponentAsAttribute(
          emailAddress,"Email Address",true,context);
    End of the code.

You can then add the component to the pane by calling the pane's addComponent() method.