Introduced in Feature Pack 3

Populating the new tab with content

Introduced in Feature Pack 3 In this lesson, you populate the new warranty tab with content using the CachedProductOnlyTabPanesExt.jspf file. This is where you retrieve warranty information using the getData tag. This invokes the expression builder created earlier.

About this task

Procedure

  1. Open the following file:
    • WebSphere Commerce DeveloperWCDE_installdir\workspace\Stores\WebContent\Madisons\Snippets\Catalog\CatalogEntryDisplay\CachedProductOnlyTabPanesExt.jspf
  2. Copy the following snippet into the file:
    
    <%--
    The getData tag is used to retrieve data from the new getCatalogEntryViewWarrantyByID expression builder.
    --%>
    <wcf:getData type="com.ibm.commerce.catalog.facade.datatypes.CatalogNavigationViewType" var="catalogNavigationView" 
    	expressionBuilder="getCatalogEntryViewWarrantyByID" varShowVerb="showCatalogNavigationView" maxItems="1" recordSetStartNumber="0" scope="request">
    	<wcf:param name="UniqueID" value="${productId}" />
    	<wcf:contextData name="storeId" data="${WCParam.storeId}" />
    	<wcf:contextData name="catalogId" data="${WCParam.catalogId}" />
    </wcf:getData>
    <c:set var="catEntry" value="${catalogNavigationView.catalogEntryView[0]}" />
    <%--
    Cycle through all userData entries and determine if it is warranty data.  Display the translated typedKey value using the translated values defined in storetext.properties followed by the typedValue
    --%>
    <div id="Warranty" dojoType="dijit.layout.ContentPane">
    	<c:forEach var="userDataField" items="${catEntry.userData.userDataField}">
    		<c:if test="${userDataField.typedKey == 'WARRANTYTYPE' || userDataField.typedKey == 'WARRANTYTERM' || userDataField.typedKey == 'CAREINSTRUCTION'}">
    			<b><span class="text"><fmt:message key ="${userDataField.typedKey}" bundle="${storeText}" /></span>: </b>${userDataField.typedValue} <br>
    		</c:if>
    	</c:forEach>
    </div>
    
  3. Save your changes and close the file.
  4. Start the WebSphere Commerce server.

Results