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:getattributevalues
repeatedly 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
(required, if assetset-sortlistentry not used)- 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:sortlistentry
tags 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
false
value 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
byasset
isfalse
, creates a set of lists with the names:prefix:attrname
. Ifbyasset
istrue
, 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:getmultiplevalues
when 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:getmultiplevalues
has 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:unknowndeps
will be performed.Example
This example reads two attribute values from the assetset object
myassetset
, "FSIIPrice
" and "FSIISKU
". Since thebyasset
attribute is not specified, the result will be two lists, one for each attribute:ValueList:FSIIPrice
andValueList:FSIISKU
.
<!-- Associate the blank searchstate with a new asset set. --> <searchstate:create name="ss"/> <assetset:setsearchedassets name="myassetset" constraint="ss" assettypes="Product_C"/> <listobject:create name="mylistobject" columns="attributetypename,attributename,direction"/> <listobject:addrow name="mylistobject">
<listobject:argument name="attributetypename" value="Product_A"/> <listobject:argument name="attributename" value="FSIIPrice"/> <listobject:argument name="direction" value="descending"/></listobject:addrow> <listobject:addrow name="mylistobject">
<listobject:argument name="attributetypename" value="Product_A"/> <listobject:argument name="attributename" value="FSIISKU"/> <listobject:argument name="direction" value="ascending"/></listobject:addrow> <listobject:tolist name="mylistobject" listvarname="listout"/> <!-- Apply the sort list to an assetset and create output lists, where data exists --> <assetset:getmultiplevalues name="myassetset" prefix="ValueList" list="listout" immediateonly="false"/> <!-- Display results --> FSIIPrice List: <br/> <ics:listloop listname="ValueList:FSIIPrice"> <ics:listget listname="ValueList:FSIIPrice" fieldname="value" /><br/> </ics:listloop> FSIISKU List:<br/> <ics:listloop listname="ValueList:FSIISKU"> <ics:listget listname="ValueList:FSIISKU" fieldname="value" /><br/> </ics:listloop>Alternately,
you may use the sortlistentry argument.<assetset:getmultiplevalues name="myassetset" prefix="ValueList" immediateonly="false"> <assetset:sortlistentry attributetypename="Product_A" attributename="FSIIPrice"/> <assetset:sortlistentry attributetypename="Product_A" attributename="FSIISKU" direction="ascending"/> </assetset:getmultiplevalues> <!-- Display results --> FSIIPrice List: <br/> <ics:listloop listname="ValueList:FSIIPrice"> <ics:listget listname="ValueList:FSIIPrice" fieldname="value" /><br/> </ics:listloop> FSIISKU List:<br/> <ics:listloop listname="ValueList:FSIISKU"> <ics:listget listname="ValueList:FSIISKU" fieldname="value" /><br/> </ics:listloop>This example shows the use of
byasset
:<assetset:getmultiplevalues name="myassetset" prefix="vlist" immediateonly="false" byasset="true"> <assetset:sortlistentry attributetypename="Product_A" attributename="FSIIPrice"/> <assetset:sortlistentry attributetypename="Product_A" attributename="FSIISKU"/> </assetset:getmultiplevalues> <!-- Display results --> <assetset:getassetlist name="myassetset" listvarname="aslist"/> <ics:listloop listname="aslist"> <ics:listget listname="aslist" fieldname="assetid" output="theid"/> <%=ics.GetVar("theid")%><br/> <ics:listget listname='<%="vlist:"+ics.GetVar("theid")+":FSIIPrice"%>' fieldname="value" /><br/> <ics:listget listname='<%="vlist:"+ics.GetVar("theid")+":FSIISKU"%>' fieldname="value" /><br/> </ics:listloop>See Also
assetset:getattributevalues
assetset:sortlistentry
listobject:create
listobject:addrow
listobject:tolist
Home > Contents > Index > ![]()
Oracle JSP Tag Reference
Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.