Basic Customization > User Interface Customization > Customizing HTML Clients Using the Windchill JSP Framework > Defining Layouts in a Type Load File
  
Defining Layouts in a Type Load File
1. How many default layout exists on a type?
Every type has one and only one default layout which doesn’t associate with any Profile or Screen.
2. How can subtype inherit layouts?
Layouts are automatically inherited by the subtypes. That means, it’s unnecessary to redefine the same layout in the subtypes (that actually could cause unexpected result — see point 4). If subtypes share the same layout, you should consider to move up the layout on the type hierarchy tree.
3. Can inherited layouts be updated by subtypes?
Yes, by defining the layout with the <csvtypeContext>Parent-Type-Name</csvtypeContext> tag in the subtype, you are overriding the layout in the subtype. Overriding means that you can add new groups to the existing layout, or add new attributes (inherited or non-inherited) to the existing groups, or redefine group/group members’ properties, e.g. coordinates.
4. Can subtypes create their own layouts?
Yes, by leaving the <csvtypeContext/> tag empty or setting it to the subtype name, you are creating a layout within the subtype context. Please note that once a subtype creates its own layout, even defining the same inherited layout but within its own context, it no longer inherits any layout from its parent type, being dissected from all inherited layouts.
5. How to add new attributes to a layout on a subtype?
Whether inherited or not, attributes defined as group members have to exist on that type first. That means if you want to add a new(non-inherited) attribute on a layout on the subtype, you have to first create the attribute on the subtype.
6. How to create a dynamic group to load batch attributes?
By setting “isStatic” to false, you create a dynamic group which could have 0-1 group member. This group member must be an attribute of LWCAttributeSetAttribute class which may have a “mapping” property that points to a batch attribute, e.g. SCA|ALL_IBAS.
Load File Example
The following example adds a layout and its meta data to the wt.change2.WTChangeOrder2 type.
!-- beginning to define a new layout -->
csvBeginLayoutDefView handler="com.ptc.core.lwc.server.TypeDefinitionLoader.
beginProcessLayoutDefinition">
csvname>mini_info_page_layout/csvname> !-- name of the layout -->
csvisDefault>false/csvisDefault> !-- whether this is the default layout to use -->
csvtypeContext>/csvtypeContext> !-- By default, it's the current type.
It is a must have to indicate an inherited layout -->
csvdefaultGroup>groupA/csvdefaultGroup> !-- the default group of the layout,
has to be one of the groups defined below -->
csvprofiles>/csvprofiles> !-- a combination of typeContext, profiles, and screens
uniquely identifies a layout -->
csvscreens>Mini_Info_Page/csvscreens> !-- available screens must have been
defined in the BaseDefinitionLoader.xml -->
/csvBeginLayoutDefView>


!-- beginning of defining a group within the layout -->
csvBeginGroupDefView handler="com.ptc.core.lwc.server.TypeDefinitionLoader.
beginProcessGroupDefinition">
csvname>groupA/csvname> !-- name of the group, uniquely identify a
group within a layout -->
csvisStatic>true/csvisStatic> !-- in most cases, it's true -->
csvstyle>List/csvstyle> !-- available group styles must have been defined in the
BaseDefinitionLoader.xml -->
/csvBeginGroupDefView>


!-- defining properties of the group: 3 in total -->
csvPropertyValue handler="com.ptc.core.lwc.server.TypeDefinitionLoader.
processGroupPropertyValue">
csvname>displayName/csvname> !-- name of the property -->
csvvalue>groupA/csvvalue> !-- value -->
csvlocale_en_us>EN_US groupA/csvlocale_en_us> !--
the following are localized values -->
csvlocale_en_gb>EN_GB groupA/csvlocale_en_gb>
csvlocale_fr>FR groupA/csvlocale_fr>
csvlocale_de>DE groupA/csvlocale_de>
csvlocale_es>ES groupA/csvlocale_es>
csvlocale_ja>JA groupA/csvlocale_ja>
csvlocale_it>IT groupA/csvlocale_it>
csvlocale_ko>KO groupA/csvlocale_ko>
csvlocale_zh_cn>ZH_CN groupA/csvlocale_zh_cn>
csvlocale_zh_tw>ZH_TW groupA/csvlocale_zh_tw>
/csvPropertyValue>
csvPropertyValue handler="com.ptc.core.lwc.server.TypeDefinitionLoader.
processGroupPropertyValue">csvname>description/csvname>
csvvalue>groupA/csvvalue>
csvlocale_en_us>EN_US groupA/csvlocale_en_us>
csvlocale_en_gb>EN_GB groupA/csvlocale_en_gb>
csvlocale_fr>FR groupA/csvlocale_fr>
csvlocale_de>DE groupA/csvlocale_de>
csvlocale_es>ES groupA/csvlocale_es>
csvlocale_ja>JA groupA/csvlocale_ja>
csvlocale_it>IT groupA/csvlocale_it>
csvlocale_ko>KO groupA/csvlocale_ko>
csvlocale_zh_cn>ZH_CN groupA/csvlocale_zh_cn>
csvlocale_zh_tw>ZH_TW groupA/csvlocale_zh_tw>
/csvPropertyValue>
csvPropertyValue handler="com.ptc.core.lwc.server.TypeDefinitionLoader.
processGroupPropertyValue">
csvname>sort_order/csvname>
csvvalue>1/csvvalue>
/csvPropertyValue>


!-- beginning of defining a membership of the group: -->
csvBeginGroupMemberView handler="com.ptc.core.lwc.server.TypeDefinitionLoader
.beginProcessGroupMembership">
csvname>number/csvname>
/csvBeginGroupMemberView>


!-- beginning of defining properties (coordinates) of the membership -->
csvPropertyValue handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.process GroupMembershipPropertyValue">
csvname>col_coord/csvname>
csvvalue>1/csvvalue>
/csvPropertyValue>
csvPropertyValue handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.process GroupMembershipPropertyValue">
csvname>row_coord/csvname>
csvvalue>1/csvvalue>
/csvPropertyValue>
csvPropertyValue handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.process GroupMembershipPropertyValue">
csvname>col_span/csvname>
csvvalue>1/csvvalue>
/csvPropertyValue>
csvPropertyValue handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.process GroupMembershipPropertyValue">
csvname>row_span/csvname>
csvvalue>1/csvvalue>
/csvPropertyValue>


!-- ending of defining a membership of the group -->
csvEndGroupMemberView handler="com.ptc.core.lwc.server.
TypeDefinitionLoader. endProcessGroupMembership"/>
!-- more memberships can be defined here -->
!-- ending of defining a group within the layout -->
csvEndGroupDefView handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.end ProcessGroupDefinition"/>
!-- more groups can be defined here -->
!-- ending of defining a new layout -->
csvEndLayoutDefView handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.end ProcessLayoutDefinition"/>
!-- more layouts can be defined here -->
!-- ending of defining a type -->
csvEndTypeDefView handler="com.ptc.core.lwc.server.
TypeDefinitionLoader.end ProcessTypeDefinition"/>