Attributes
Definition and Usage
The Attributes component is a widget that displays name-value pairs. The value always appears below the name. You can display values of different data types. A set of attributes can be presented as a group using a group name.
The following are sample images showing the Attributes component:
The attributes for the selected part or document are displayed in the preview pane, which appears on the right side of the screen, as displayed in the following image.
You can configure the Attributes component in the following ways:
Define the attributes to show.
Set the layout and related display settings.
Define the title for an attribute group; this is only available for attribute groups with a vertical layout.
Add a link to one of the out-of-the-box tasks on an attribute using a decorator. Currently, only the first decorator found in the decorators list is supported.
To add a link to an attribute, in your configuration, add the decorator including the appId and thingName (PTC.Nav.LinkToAppDecoratorThing) to the attribute. For instance:
* 
Beginning ThingWorx Navigate 9.4.0, the decoratedType key is moved under the decoration key in the metadata section of the configuration.
metadata: {
Number: {
"label": "Number",
"type": "STRING",
"decoration": {
"decoratedType": "HTML",
"decorators": [{
"thingName": "PTC.Nav.LinkToAppDecoratorThing",
"parameters": {
"appId": "PTC.Nav.ViewDesignFiles"
}
}]
}
You can navigate to the following tasks using their respective App IDs listed below:
Task
App ID
PART TASKS COLLECTION
View Design Files
PTC.Nav.ViewDesignFiles
View Drawing
PTC.Nav.ViewDrawing
View & Measure in 3D
PTC.Nav.ViewAndMeasureIn3D
View Part Properties
PTC.Nav.ViewPartProperties
View Parts List
PTC.Nav.ViewPartList
View Part Structure
PTC.Nav.ViewPartStructure
DOCUMENT TASKS COLLECTION
View Document
PTC.Nav.ViewDocument
View Document Structure
PTC.Nav.ViewDocumentStructure
Attributes Generic is a generic predefined configuration available for the Attributes component.
Binding Properties 
Input
Property Name
Description
Property Type
Input
Used for identifying the data to be fetched from the backend system.
Sample JSON:
{
"version":"1.0.0",
"data":[
{
"adapter":{
"thingName":"PTC.WCAdapter",
"instanceName":"windchill"
},
"itemListsData":[
{
"objectType":"PTC.ChangeMgmt.ChangeRequest",
"items":[
{
"id":{
"value":"OR:wt.change2.WTChangeRequest2:439476"
}
}
]
}
]
}
]
}
JSON in CCO format
TailoringName
Uniquely identifies an instance of the Attributes component. This value is used internally for looking up tailoring information for that specific instance.
Only use this binding property when there is a dedicated tailoring page for your custom task.
String
SubComponentConfiguration
Bind the configuration to this property when this component is used as a subcomponent within another component or within a contained mashup.
Sample JSON:
{
"implementationThingName":"PTC.Nav.AttributesGenericBusinessLogicThing",
"configuration":{
"layout":{
"selectedKey":"horizontal",
"additionalData":{

},
"version":"1.0.0"
},
"attributes":{
"sets":[
{
"data":{
"selectedValues":{
"data":[
{
"itemListsData":[
{
"items":[
{
"id":"Role#Display",
"ordinal":0
},
{
"id":"Activity|Deadline",
"ordinal":5
},
{
"id":"Status#Display",
"ordinal":4
}
],
"objectType":"PTC.Workflow.WorkItem"
},
{
"items":[
{
"id":"Category#Display",
"ordinal":1
},
{
"id":"RequestPriority#Display",
"ordinal":3
}
],
"objectType":"PTC.ChangeMgmt.ChangeRequest"
}
],
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
}
}
]
}
}
}
]
}
}
}
JSON
Configuration Properties 
The following table and images show the JSON properties used to configure this component.
For more information on the structure of the configuration, see Component Configuration Structure.
For more information on sub-properties, see Sub-Properties and Container Keys.
Property Name
Description
Property Type
Default Value
Required or Optional
attributes
The list of attributes for which data needs to be fetched from the backend system.
For Windchill, these property names must match those defined by the Windchill REST Services EDM.
N/A
Required
isMultiLine
Determines whether content should be wrapped. Options: true, false.
This property is a sub-property to layout and is only relevant when layout is set to vertical. Its container key is isMultilineDefinition.
N/A
Required
layout
Determines how attributes are arranged in the user interface. The available options are:
vertical: Attributes are stacked one below the other.
horizontal: Attributes are arranged side by side.
The available sub-properties for layout depend on whether vertical or horizontal is selected. See the sample configurations for Attributes Generic for more detail.
N/A
Required
maxHeight
Maximum height for both attribute name and value in the user interface.
If content exceeds the maxHeight property value, the “show more/show less” link or button is available.
This property is only relevant for the following two cases:
When layout is set to horizontal. In this case it is a sub-property to layout.
When layout is set to vertical and isMultiLine is set to true. In this case it is a sub-property to isMultiLine.
Its container key is dimensionDefinition.
N/A
Required
maxWidth
Maximum width for attribute name and value in the user interface.
This property is only relevant for the following two cases:
When layout is set to horizontal. In this case it is a sub-property to layout.
When layout is set to vertical and isMultiLine is set to false. In this case it is a sub-property to isMultiLine.
Its container key is dimensionDefinition.
N/A
Required
messageWhenNoAttributes
Allows displaying a message when no attributes are available.
This value can be left empty. In this case, no message is displayed, and no special placeholder is preserved.
N/A
Optional
Sample Configuration 
For a sample configuration for the Attributes component, see the Attributes Generic configuration.
Customization Services 
In addition to configuration, each component supports extending its business logic to customize the component. The business logic of each component includes overridable services in a Thing Template that you can extend and override. The overridable services for this component are detailed in the following table.
For examples of returns and parameters for each service, see Examples of Input/Output for Customization Services.
Name
Description
GetConfigurations
Returns the available configurations for the component implementation.
Parameters: None
Returns: JSON
GetImplementationLabel
Returns either the localized name of the component or the token that can be used to obtain the localized name. This localized name is displayed in the Mashup Builder user interface.
Parameters: None
Returns: String
ProcessAttributesConfiguration
Processes the attributes configuration and splits attributes into out-of-the-box attributes and additional attributes.
Returns a JSON with key value pairs in the following form:
OOTBAttributes : OOTB Attributes configuration CCO JSON
additionalAttributes : Additional Attributes configuration CCO JSON
The attributes are split into out-of-the-box and additional based on their object type. Attributes that have object type ending with .Custom.Adapter or Custom.Implementation are treated as additional attributes. All other attributes are considered out-of-the-box attributes.
Parameters:
attributes (Required)– JSON with the list of out-of-the-box attributes and additional attributes.
configuration (Optional)– JSON with the final merged configuration obtained from the Tailoring Manager resource.
Returns: JSON in CCO format
GetAttributesValues
Returns a JSON with attributes and their values.
Parameters:
input (Required)– JSON in CCO format that includes the input ID for the data to be fetched from the backend system and the adapter information for the backend system.
configuration (Optional)– JSON with the final merged configuration obtained from the Tailoring Manager resource.
attributes (Required)– JSON with the list of out-of-the-box attributes and additional attributes.
Returns: JSON in CCO format
GetAdditionalAttributesValues
Returns a JSON with values for additional attributes. This service should be implemented by the component implementation.
Parameters:
input (Required)– JSON in CCO format that includes the input ID for the data to be fetched from the backend system and the adapter information for the backend system.
configuration (Optional)– JSON with the final merged configuration obtained from the Tailoring Manager resource.
attributes (Required)– JSON with the list of additional attributes.
OOTBAttributesValues (Optional)– JSON in CCO format with values of out-of-the-box attributes returned by GetAttributesValues. These values can be used to calculate values for additional attributes.
Returns: JSON in CCO format
GetAdditionalAttributes
Returns the list of additional attributes to be added to the list of available out-of-the-box attributes.
Parameters: None
Returns: JSON
UpdateAvailableAttributes
Updates one or more attributes from the attributes list and returns the final list.
Parameters:
attributes (Required)– JSON with the list of out-of-the-box attributes and additional attributes.
Returns: JSON
Implementation Definition 
For the implementation definition for the Attributes component, see the Attributes Generic configuration.
Was this helpful?