Add SWE Code to the Web Template
The following example shows the SWE code you would insert in a Web template to retrieve the Part Number field for display:
<od-type="control" id="swe:101Id+4400" CfgUIControl="CfgLabel" CfgHtmlType="CfgLabel"
property="FormattedHtml" CfgFieldName="Part Number"/>
The "id" must be that specified in the for-each loop iteratorName, and the increment amount must be unique within the for-each loop.
If you want to display a field name next to the field value, insert an od-type="control" statement that extracts the field name from the repository. This allows you to support localization. You can insert the od-type="control" wherever needed in the template. It does not have to be inside a for-each loop. Here is an example of an od-type="control" tag that extracts the field name for Part Number from the repository. The "id" in the tag must be present but is not used for anything. The lblPartNumber value is the name of the label control in the repository.
For the Open UI interface, insert the following code:
<!-- Template Start: eCfgRelationContentsPriceQuantityJS -->
<table border="0" cellpadding="0" cellspacing="3" width="100%">
<od-iterator id="500" CfgLoopType="Children" startValue="1500" count="Dynamic"
iteratorName="101Id"
CfgFieldList="CfgFieldName:Quantity, CfgUIControl:lblQuantity,
HtmlAttrib_width:80, HtmlAttrib_align:left, Default:Y*
CfgFieldName:Name, CfgUIControl:lblName, HtmlAttrib_width:250,
HtmlAttrib_align:left, Default:Y*
CfgFieldList="CfgFieldName:Part Number, CfgUIControl:lblPartNo, DataSource:Broker,
NeedRefresh:N, HtmlAttrib_align:center,
HtmlAttrib_width:80*
CfgFieldName:RequireMoreChild, Default:Y*
CfgFieldName:List Price, CfgUIControl:lblListPrice, DataType:DTYPE_CURRENCY,
NeedRefresh:N, HtmlAttrib_align:center, HtmlAttrib_width:80*
CfgFieldName:Current Price, CfgUIControl:lblYourPrice, DataType:DTYPE_CURRENCY,
HtmlAttrib_align:center, HtmlAttrib_width:80*
CfgFieldName:Explanation, CfgUIControl:lblExplanation, HtmlAttrib_width:70,
HtmlAttrib_align:center*
CfgFieldName:Customize, CfgUIControl:lblCustomize, HtmlAttrib_width:70,
HtmlAttrib_align:center"
>
To add SWE code to a template
Copy the desired template and give it a new filename.
Insert the SWE code into the new template.
Add the new template to the Pick UI Style dialog box.
Select the new template as the UI control for a relationship or an item.