In the Bookshelf > Product Administration Guide > Configurator Web Templates > Modifying the Display Name of Items
The following 3 steps are needed in order to change display name of items:
1. Creating a New UI Control Template. You do this by saving a copy of the UI control template you selected in the User Interface view. Then you insert a
variable name in the new template.
2. Assigning the New UI Control Template. Assign the new template to the item.
3. Defining a UI Property for the Item. Define a UI Property for the item. "
Note: In the Bookshelf it is mentioned to change the attribute CfgFieldName = "CxObjName" however this does not exist in the eCfgControlCheckJS.swt
template.
The above steps 2 and 3 remain the same. However for step 1 the following need to be considered when your changes are for a checkbox (based on
eCfgControlCheckJS.swt):
The eCfgControlCheckJS.swt contains the following code:
"...
Usage="CheckBox"
CfgFieldList="CfgFieldName:Name, CfgUIControl:lblName, HtmlAttrib_width:310, Default:Y*
CfgFieldName:RequireMoreChild, Default:Y*
CfgFieldName:Explanation, CfgUIControl:lblExplanation*
CfgFieldName:Customize, CfgUIControl:lblCustomize"
>
CfgJSShow="showCheckBox" CfgJSUpdateExclusion="updateExcludedItemForPort" CfgJSUpdateSelection="updatePortItemsForCheckBox"/>
..."
A) In case you would just need to add additional information for your checkbox.
The information you want to display is stored your UI Property "My_UI_Property" and you want to display it next to your item name. Then the following
changes can be done in the template:
Add the following line to your cfgFieldList definition:
CfgFieldName:.My_UI_Property, CfgUIControl:lblName, DataSource:Broker, NeedRefresh:N*
The part of the template would look like:
"...
Usage="CheckBox"
CfgFieldList="CfgFieldName:Name, CfgUIControl:lblName, HtmlAttrib_width:310, Default:Y*
CfgFieldName:.My_UI_Property, CfgUIControl:lblName, DataSource:Broker, NeedRefresh:N*
CfgFieldName:RequireMoreChild, Default:Y*
CfgFieldName:Explanation, CfgUIControl:lblExplanation*
CfgFieldName:Customize, CfgUIControl:lblCustomize"
>
..."
B) If you want to rename the item name with the value in your UI Property please note the following:
The Item name of the checkbox has additional functionality as it is displayed as a hyperlink when the checkbox is checked. Therefore, it is displayed via a
java script that is called in the template in tag by the following snippet: CfgJSShow="showCheckBox"
This actual java script is located in the cfgui.js file.Therefore, in order to change the display of the name you need to do the following:
1) change the .swt template
Instead of launching the showCheckBox script, launch your custom script: showCheckBox_Custom:
CfgJSShow="showCheckBox_Custom" CfgJSUpdateExclusion="updateExcludedItemForPort" CfgJSUpdateSelection="updatePortItemsForCheckBox"/>
2) change the cfgui.js file: (make sure to create a backup file before changing it)
2a) locate and function showCheckBox and copy it to showCheckBox_Custom.
Then change the showCheckBox_Custom function:
Call showDomainAndChildrenControl_Custom instead of showDomainAndChildrenControlfunction showCheckBox_Custom (grpItemId)
{
showDomainAndChildrenControl_Custom (grpItemId, "checkbox");
}
2b) locate the function showDomainAndChildrenControl and copy it to
showDomainAndChildrenControl_Custom
function showDomainAndChildrenControl_Custom (grpItemId, controlType)
{
...
}
2c) change showDomainAndChildrenControl_Custom function:
locate the following line:
displayName=portDomainPropSet.GetProperty("CxObjName")
and change it to:
displayName=portDomainPropSet.GetProperty(".My_UI_Property")
2d) Save the files
3) Make sure to refresh the cache (browser and server)
This should change your checkbox display to the value defined in the UI property.
Please note: All your products that use your custom .swt file need to have the UI property defined in order to get the appropriate values for your
customization.
Hi again,
ReplyDeleteI needed your help for one more thing, which is related to this post:
I am using this template: eCfgControlComboAddPriceAttribGridJS.swt for a certain type of Products. When I add one of these products I want to also display the start date of the line items, next to the product name.
I have been trying to modify the swt/cfgui files but have not managed it yet. I am having trouble in how to get the data required for the Start Date.
Thanks,
Kostas