Basic Customization > User Interface Customization > Presenting Information in the UI > Attribute Customization > Windchill Attribute Customization Overview > Common Attribute Customization Procedures > Providing Alternate UI Behavior
  
Providing Alternate UI Behavior
You have a need to customize the rendering of a local attribute like Name that already has a data utility mapped to it, only for a specific case. Since the attribute id is already mapped to a data utility, adding another mapping using the same attribute id will not work as expected. See Data Utilities for additional information.
Solution Elements
Element
Description
Data Utility ID
A property defined in the Type and Attribute Management utility or component builder. See “Data Utility Id” in Configuration Points for more information.
Need property
A property defined in the Type and Attribute Management utility. See “Need” in Configuration Points for more information.
Target Object property
A property defined in the Type and Attribute Management utility. See “Target object” in Configuration Points for more information.
Intended Outcome
The data for an attribute can be fetched from attributes other than the default.
Solution
The combinations of the solution elements required to achieve the different kinds of behavior are listed below:
If you want to…..
Configuration
Use a custom data utility to render an attribute for the scope of a specific UI only and that attribute already has a data utility mapped to it and, the UI is one of the following:
an Attribute panel defined using the Type and Attribute Management utility or a builder class
an Table defined using the Type and Attribute Management utility or a builder class
Example:
To render Number using a custom data utility called MyNumberDataUtility
1. Define your custom data utility (MyNumberDataUtility)
2. In an xconf file, map the custom data utility to a custom attribute id(myNumber). For more information see Map the Data Utility to the Attribute ID.
3. Set the Data Utility Id property of that attribute to myNumber
Use an existing data utility to render an attribute in all the UIs in which the attribute is rendered
In an xconf file, map the custom data utility to a custom attribute id(myNumber)
In a specific UI only, render an attribute using an existing data utility; the existing DU might be already mapped to one or more attributes
To render myNumber using using a custom data utility called MyNumberDataUtility
1. Define your custom data utility (MyNumberDataUtility)
2. In an xconf file, map the custom data utility to a custom attribute id(myNumber)
3. Set the Data Utility Id property of that attribute to myNumber
Rendering the same attribute for multiple objects within the same table
The column ids must be unique, so you need to use Target Object and Data Utility Id properties to accomplish this. For example, a table could have 3 columns that all render the Name attribute, but from 3 different objects:
1. Add all the three attributes to the attribute panel or table definition
2. For the attributes that belong on objects that are not the backing object, set the value of the property Data Utility Id to “name” and the Target Object to the attribute that represents the object
Example:
To display the name attributes of the roleAObject and roleBObject the same way the name attribute of the backing object is displayed, for each of those attributes, set the properties as follows:
For roleAName
Data Utility Id = name
Target Object = roleAObject
For roleBName
Data Utility Id = name
Target Object = roleBObject
Specifying different renderers for the same attribute id for different object types
Example:
You need to render the render the state attribute of a Document differently than the state attribute of a Part.
Type-based lookup of data utilities is currently not supported by the infrastructure. If this type of behavior is needed, and if your UI displays objects of the same type, then use the Data Utility Id property to accomplish this. On a UI that displays objects of multiple types, like the Folders page, you may use a custom data utility and do the type-based checking within that custom data utility.