Basic Customization > User Interface Customization > Customizing HTML Clients Using the Windchill JSP Framework > Attribute Panels > Solutions > Solution – Create an Advanced Attribute Panel Using Any Layout Defined in the Type and Attribute Management Utility > Procedure – Creating the Attribute Panel > Extending the AbstractComponentBuilder
  
Extending the AbstractComponentBuilder
Because you want a layout-based panel, your custom builder should implement com.ptc.mvc.components.TypedAttrLayOutFactoryAware, which will give you access to an instance of the TypedAttrLayOutFactory which you will need to obtain configs based on a layout.
The AbstractComponentBuilder does not provide any default behavior so you will need to write the following methods from scratch:
public void setTypedAttrLayOutFactory(TypedAttrLayOutFactory factory)
protected AttributePanelConfig buildComponentConfig(ComponentParams params)
public Object buildComponentData(ComponentConfig config, ComponentParams params)
setTypedAttrLayOutFactory()
The TypedAttrLayOutFactory is used to create panel configs based a given screen type. You should declare a global variable of that type and implement this method, as follows:
TypedAttrLayOutFactory tfactory;
public void setTypedAttrLayOutFactory(TypedAttrLayOutFactory factory) {
this.tfactory = factory;
}
The framework will call this method to provide you with an instance of the factory.
buildComponentConfig()
This method should create the AttributePanelConfig by calling the TypedAttrLayOutFactory and passing it the ScreenDefinitionName corresponding to the layout you want to use for your panel. For example:
AttributePanelConfig panelConfig =
tfactory.getAttributePanelConfig(getComponentConfigFactory(), params,
ScreenDefinitionName.CREATE);
The AttributePanelConfig that is returned will have nested GroupConfigs and AttributeConfigs as defined in the layout.
If desired, you can tweak the configs that are returned by the factory to modify any of the configuration properties listed in Customization Points. See Procedure – Creating the Attribute Panel for some examples.
Also see How to Modify the Panel View JSP and How to Modify the Panel Context Object
buildComponentData()
This method should return a single datum object for the panel. For view-only panels, this is typically a Persistable object instance. For wizards, this should usually be a TypeInstance, which will contain the constraints that have been defined for the attributes in addition to the attribute values.
To return a Persistable datum object, it is typically appropriate just to return the context object, as follows: Object datumObject = params.getContextObject();
Alternatively, you could query for the Persistable object.
To obtain a TypeInstance datum object for a create or edit wizard, you can call CreateAndEditModelGetter.getItemAttributes() as described in Obtaining a TypeInstance Datum Object. Alternatively, you could use TypeInstance APIs to obtain the TypeInstance.