Home > Contents > Index > 
ASSETSET.GETMULTIPLEVALUES
Scatters attribute values from several attributes (and potentially more than one product) into several specified lists. This tag executes a single SQL query in order to perform its function. (It is therefore much more efficient than using
ASSETSET.GETATTRIBUTEVALUESrepeatedly for multiple attribute values.)Syntax
<ASSETSET.GETMULTIPLEVALUES NAME="assetset name" [LIST="sort list name"] [BYASSET="true|false"] [IMMEDIATEONLY="true|false"] PREFIX="prefix"/>Parameters
name(required)- Input parameter. Name of the assetset object.
 
list(optional)- Input parameter (see as output, below). List of attribute names to scatter. This list has three columns:
 
attributetypename- The attribute asset type name.attributename- The attribute name.direction- Legal values include:none,ascending, ordescending.If this list is not specified, nested
assetset:sortlistentrytags must be used instead.byasset(optional)- Input parameter. Boolean value indicating whether to scatter a different instance of each attribute for each individual asset in the assetset (
 true), or to group all the attribute values for all assets together into one list per attribute (false). The default isfalse.
immediateonly(optional)- Input parameter. Boolean value indicating whether to scatter inherited attribute values or not. A
 falsevalue indicates that inherited values should be scattered (the default).
prefix(required)- Input parameter. Starting part of the list names that this method creates.
 
Description
If
byassetisfalse, creates a set of lists with the names:prefix:attrname. Ifbyassetistrue, creates a set of lists with the names:prefix:assetid:attrname.This tag is highly efficient in that it executes a single query to retrieve all values. We therefore recommend using this tag wherever possible instead of multiple instances of
assetset:getattributevalues.We recommend using
assetset:getmultiplevalueswhen the goal is to display a fixed-format table of assets, or to obtain many attributes of a single asset (such as for a product detail page).
assetset:getmultiplevalueshas the following limitations:
- Only non-foreign attributes can be scattered.
 
- Text-type attributes cannot be scattered.
 
- No lists will be created or destroyed for any attributes which would return no values.
 
NOTE: This tag also causes dependencies to be recorded for all assets that contribute to the returned lists, or if this assetset object is not an enumerated one, then the equivalent of
RENDER.UNKNOWNDEPSwill be performed.
The ordering values Note
ascendinganddescendingoperate in the reverse manner from what might be logically expected. Therefore, ifascendingorder is specified, the ordinally lowest value will occur last in the result list.Example
The example below is in JSP, though the XML syntax is analogous. This example reads two attribute values from the assetset object
myassetset, "lumens" and "bulbsize". Since thebyassetattribute is not specified, the result will be two lists, one for each attribute:ValueList:lumensandValueList:bulbsize.
<listobject:create name="mylistobject" columns="attributetypename,attributename,direction"/> <listobject:addrow name="mylistobject">
<listobject:argument name="attributetypename" value="PAttributes"/> <listobject:argument name="attributename" value="bulbsize"/> <listobject:argument name="direction" value="descending"/></listobject:addrow> <listobject:addrow name="mylistobject">
<listobject:argument name="attributetypename" value="PAttributes"/> <listobject:argument name="attributename" value="lumens"/> <listobject:argument name="direction" value="ascending"/></listobject:addrow> <listobject:tolist name="mylistobject" listvarname="listout"/> <!-- Make sure the output lists are precreated and are empty, in case there are no values --> <listobject:create name="mylistobject" columns="value"/> <listobject:tolist name="mylistobject" listvarname="ValueList:lumens"/> <listobject:tolist name="mylistobject" listvarname="ValueList:bulbsize"/> <!-- Apply the sort list to an assetset and create output lists, where data exists --> <assetset:getmultiplevalues name="myassetset" prefix="ValueList" list="listout" immediateonly="false" byasset="true"/>Alternately,
<assetset:getmultiplevalues name="myassetset" prefix="ValueList" immediateonly="false" byasset="true"> <assetset:sortlistentry attributetypename="PAttributes" attributename="bulbsize"/> <assetset:sortlistentry attributetypename="PAttributes" attributename="lumens" direction="ascending"/> </assetset:getmultiplevalues>See Also
ASSETSET.GETATTRIBUTEVALUES
LISTOBJECT.CREATE
LISTOBJECT.ADDROW
LISTOBJECT.TOLIST