Basic Customization > User Interface Customization > Customizing HTML Clients Using the Windchill JSP Framework > Attribute Panels > Solutions > Solution - Create a Simple Panel Using JSP Tags > Converting a Tag-based Attribute Panel to a MVC Attribute Panel
  
Converting a Tag-based Attribute Panel to a MVC Attribute Panel
In prior releases all attribute panels, known as “property panels,” were created and displayed using the tag-based approach described in the preceding section. Also, in prior releases, it was possible to create attribute tables, which were very similar in construction except that a describeAttributesTable tag was used instead of a describePropertyPanel tag and a renderTable tag was used instead of a renderPropertyPanel tag.
Such panels and attribute tables can fairly easy be converted to MVC attribute panels, as outlined below. Note that if you convert a panel or table to a MVC panel, you should be sure to remove any *typedservices.properties.xconf file entries related to the panel or table in addition to removing the related JSP files.
If the panel is for a custom object type that is Typed and it corresponds to one of the screen types for which an OOTB builder class is available (see section Solution – Create an Advanced Attribute Panel with a Visualization Component Using the Primary Attributes Layout, Solution – Create an Advanced Attribute Panel Without a Visualization Component Using the Primary Attributes Layout, and Solution – Create an Advanced Attribute Panel Using the Create, Edit, or More Attributes Screen Type Layout), you should simply define a layout for that screen type in the Type and Attribute Management utility. Add each attribute included in your describePropertyPanel/ describeAttributesTable tag to the layout. Most of the configuration attributes available for the tags can be defined in the Type and Attribute Management utility.
To display your panel, use one of the techniques described in How to Include an Attribute Panel in a JSP Page. You do not need to write a Java builder class unless you need to use a different view JSP or datum object than that defined by the OOTB builder. Note: if your custom object type does not implement Typed, you can modify it to implement TypeManaged so that it will be displayed in the Type and Attribute Management utility and layouts can be defined for it.
If your custom object type is Typed or TypeManaged and your panel is for one of the screen types available in the Type and Attribute Management utility for which no OOTB builder exists, you should create a layout in the Type and Attribute Management utility for that screen type. Add each attribute included in your describePropertyPanel/ describeAttributeTable tag to the layout and configure its display in the Type and Attribute Management utility based on the attributes you had included in your describeProperty tag. You will also need to create a Java builder class to create an AttributePanelConfig from the layout (see Solution – Create an Advanced Attribute Panel Using Any Layout Defined in the Type and Attribute Management Utility). In your Java builder class, you should include a buildComponentData() method that creates the panel datum object by calling the same method invoked by your getModelTag(). To render the panel, use one of the techniques described in How to Include an Attribute Panel in a JSP Page.
If you choose not to make your object type TypeManaged or the panel is not for one of the available screen types, create a Java builder class for your panel as described in Solution – Create a Simple or Advanced Attribute Panel Using a Configuration Created in a Java Builder Class, following the techniques for a simple attribute panel. Note that:
The AttributePanelConfig created by your builder’s buildComponentConfig() or buildAttributesComponentConfig() method corresponds to the config created by your describePropertyPanel/ describeAttributesTable tag. Translate any attributes on your tag to the equivalent properties on the AttributePanelConfig. See How to Modify the Panel Context Object for how to modify the panel context object, which corresponds to the “oid” attribute of the describePropertyPanel tag.
The AttributeConfigs created by your builder correspond to the configs created by your describeProperty tag. Translate any attributes on your describeProperty tag to the equivalent properties on the AttributeConfig.
The buildComponentData() method of the builder corresponds to the getModel tag. You can call the same method to acquire the panel datum object in your buildComponentData() method as you did from your getModel() tag.
The tag <mvc:simpleAttributePanel> corresponds to the renderPropertyPanel/renderTable tag. This tag is called by the view JSP <Windchill>/codebase/WEB-INF/jsp/components/simpleAttributePanel.jsp. Typically, you should specify that JSP view by calling the setView() method on the AttributePanelConfig in your builder. Note that the default component id used for AttributePanelConfigs is attributePanel. If you specified a compId attribute on your tag you may need to create a custom JSP view page for your panel and set the view to that JSP. In your custom JSP, you should set the component id by including a compIdattribute on the <mvc:simpleAttributePanel> tag.