<#list> and <#map> in FTL files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

<#list> and <#map> in FTL files

Patrick-4
I'm looking around for maps in the FTL files.  I can use <#list> just
fine, but can't seem to find a directive for a map.  What's the
correct way to do this ?   Thanks
Patrick
Reply | Threaded
Open this post in threaded view
|

Re: <#list> and <#map> in FTL files

Jacques Le Roux
Administrator
This might help
http://stackoverflow.com/questions/1497777/freemarker-iterating-over-hash-map-keys

You will find some examples also in OFBiz

Jacques

From: "Patrick" <[hidden email]>
> I'm looking around for maps in the FTL files.  I can use <#list> just
> fine, but can't seem to find a directive for a map.  What's the
> correct way to do this ?   Thanks
> Patrick
>

Reply | Threaded
Open this post in threaded view
|

Re: <#list> and <#map> in FTL files

BJ Freeman
In reply to this post by Patrick-4
only <#list varname as map>
http://fmpp.sourceforge.net/freemarker/app_faq.html
14.
the confusion my come from things like
            <actions>
                <set field="titleProperty"
value="PageTitleAddressMatchMap"/>
                <set field="headerItem" value="addrmap"/>
                <entity-condition entity-name="AddressMatchMap"
list="addressMatchMaps">
                    <order-by field-name="sequenceNum"/>
                </entity-condition>
            </actions>
then the ftl
      <#if addressMatchMaps?has_content>
        <table class="basic-table hover-bar" cellspacing="0">
          <tr class="header-row">
            <td>${uiLabelMap.PartyAddressMatchKey}</td>
            <td>=></td>
            <td>${uiLabelMap.PartyAddressMatchValue}</td>
            <td>${uiLabelMap.CommonSequence}</td>
            <td class="button-col"><a
href="<@ofbizUrl>clearAddressMatchMap</@ofbizUrl>">${uiLabelMap.CommonClear}
${uiLabelMap.CommonAll}</a></td>
          </tr>
          <#assign alt_row = false>
          <#list addressMatchMaps as map>
            <tr valign="middle"<#if alt_row> class="alternate-row"</#if>>
              <td>${map.mapKey}</td>
              <td>=></td>
              <td>${map.mapValue}</td>
              <td>${map.sequenceNum?if_exists}</td>
              <td class="button-col"><a
href="<@ofbizUrl>removeAddressMatchMap?mapKey=${map.mapKey}&mapValue=${map.mapValue}</@ofbizUrl>">${uiLabelMap.CommonDelete}</a></td>
            </tr>
            <#-- toggle the row color -->

            <#assign alt_row = !alt_row>
          </#list>
        </table>
      </#if>



========================

BJ Freeman
http://bjfreeman.elance.com
Strategic Power Office with Supplier Automation <http://www.businessesnetwork.com/automation/viewforum.php?f=93>
Specialtymarket.com <http://www.specialtymarket.com/>

Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man
Linkedin
<http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro>


Patrick sent the following on 3/30/2010 9:40 AM:
> I'm looking around for maps in the FTL files.  I can use <#list> just
> fine, but can't seem to find a directive for a map.  What's the
> correct way to do this ?   Thanks
> Patrick
>