User API

expand

Other API in Package

Web

Internal Tunnel

Internal Web

Tunnel

expand tag

Typically a child of a c:list tag. Optionally stand-alone using the json attribute. This tag allows you to expand a JSON encoded column into the rendering cycle. A query can be used for lists. See sample.

Tag Attributes
Attribute Notes
id Required
column
type
ref
var
row
test
query
json
path

Sample:

Load a one dimensional json array
<c:expand id="local" json="${json}" type="list" var="list"/>
<c:list name="list" id="rec">
    <li>${rec.col0} ${rec.col1} ${rec.col2}</li>
</c:list>

Obtain the data information from the data and put it into the request as a map
<c:expand id="local" json="${json}" type="data" var="map1"/>

Obtain the data information from the data column and put it into the request as a map
<c:list name="records" id="rec">
    <c:expand id="rec" column="myDataColumn" type="data" var="map1"/>
    ${map1.firstName} ${map1.lastName}
</c:list>

Obtain the data information from the data column and extend the existing record
<c:list name="records" id="rec">
    <c:expand id="rec" column="myDataColumn" type="data"/>
    ${rec.firstName} ${rec.lastName}
</c:list>

Obtain the datamap information from the payload column and extend the existing record
<c:list name="records" id="rec">
    <c:expand id="rec" column="myPayloadColumn" type="data" ref="map1"/>
    ${rec.firstName} ${rec.lastName}
</c:list>

Obtain the entire payload from the payload column and put it into the render cycle
<c:list name="records" id="rec">
    <c:expand id="rec" column="myPayloadColumn" type="payload"/>
    ${map1.firstName} ${map1.lastName}
    <c:list name="items" id="item">
        ${item.email} ${item.phone}
    </c:list>
</c:list>

Obtain the list from the list column and put it into the render cycle with its column name
<c:list name="records" id="rec">
    <c:expand id="rec" column="myListColumn" type="list"/>
    <c:list name="myListColumn" id="item">
        ${item.email} ${item.phone}
    </c:list>
</c:list>

Obtain the list from the list column and put it into the render cycle with an alias (var=items)
<c:list name="records" id="rec">
    <c:expand id="rec" column="myListColumn" type="list" var="items"/>
    <c:list name="items" id="item">
        ${item.email} ${item.phone}
    </c:list>
</c:list>

Obtain the list from the payload column and put it into the render cycle with its payload name.        
<c:list name="records" id="rec">
    <c:expand id="rec" column="myPayloadColumn" type="list" ref="items"/>
    <c:list name="items" id="item">
        ${item.email} ${item.phone}
    </c:list>
</c:list>

Obtain the first row from list from the payload column and put it into the render cycle the variable alias.
<c:list name="records" id="rec">
    <c:expand id="rec" column="myPayloadColumn" type="list" ref="items" row="first" var="item"/>
    ${item.email} ${item.phone}
</c:list>

Obtain all the rows from list from the payload column that satisfy the query and put it into the render cycle the variable alias.
<c:list name="records" id="rec">
    <c:expand id="rec" column="myPayloadColumn" type="list" ref="items" row="all" var="item" query="type eq primary;size gt number:3"/>
    ${item.email} ${item.phone}
</c:list>

The query syntax roughly follows DataListFilter methods.  See DataListFilter API for types.
Note that the query is an "and" or an "or" but you cannot combine both.        

query="col eq value" (equals)
query="col ct value" (contains)
query="col ne value" (not equal)
query="col gt type:value" (greater than)
query="col lt type:value" (less than)
query="col bt type:[low][high]" (between)

samples

query="name eq bob and type eq primary"
query="name ct fred or birth bt date:[01/01/1900][01/01/1912]"
Copyright © 2006 - 2024, ContractPal, Inc. All rights reserved. API Date: Jul 15, 2024 03:42 PM