簡體   English   中英

如何在ISML模板中從ProductBO對象循環“多個字符串”?

[英]How to loop a “Multiple String” from a ProductBO object in an ISML-Template?

如何從ProductBO對象循環多個字符串? 做這個的最好方式是什么?

只要您知道屬性的名稱,就可以在ISML中對ProductBO使用以下方法:

public AttributeValue getAttributeValue(String aName);

店面應用程序附帶了一個方便的功能,盡管它不是非常靈活的模塊,能夠顯示AV-s。 它也適用於多個屬性。 模塊的名稱為ISCustomAttribute

用法示例:

<isCustomAttribute 
    attributelabel="#AttributeDescriptor:DisplayName#" 
    attributevalue="#ProductBO:AttributeValue(AttributeDescriptor:ID)#" 
    attributeseparator=",&nbsp;">

最好的辦法是使用此模塊。 您可能會看到它的實際效果。 自定義ProductBO屬性打印在店面的“產品詳細信息”頁面上,如下圖所示(@see DetailsTab.isml ):

在此處輸入圖片說明

如果不合適,則必須以可迭代的方式檢索屬性。 我認為最合適的方法是使用BO擴展BusinessObjectAttributes 您將能夠從名稱中檢索BusinessObjectAttribute並遍歷其值。

<isloop iterator="BusinessObjectAttribute:Value" alias="AValue" counter="counter">
    <!--- Do something gorgeous here --->
</isloop>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM