Note that there are some explanatory texts on larger screens.

plurals
  1. PORender Map<String,Object> in freemarker table
    primarykey
    data
    text
    <p>I am getting error while rendering Map to freemarker template table. below is the map what i am getting from controller with actual values.</p> <pre><code>Map&lt;Object, Object&gt; hramonths ={4={id=4, empjoindate=16 Nov 2007, description=Apr-2012, editable=T}, 5={id=5, empjoindate=16 Nov 2007, description=May-2012, editable=T}, 6={id=6, empjoindate=16 Nov 2007, description=Jun-2012, editable=T}, 7={id=7, empjoindate=16 Nov 2007, description=Jul-2012, editable=T}, 8={id=8, empjoindate=16 Nov 2007, description=Aug-2012, editable=T}, 9={id=9, empjoindate=16 Nov 2007, description=Sep-2012, editable=T}, 10={id=10, empjoindate=16 Nov 2007, description=Oct-2012, editable=T}, 11={id=11, empjoindate=16 Nov 2007, description=Nov-2012, editable=T}, 12={id=12, empjoindate=16 Nov 2007, description=Dec-2012, editable=T}, 1={id=1, empjoindate=16 Nov 2007, description=Jan-2013, editable=T}, 2={id=2, empjoindate=16 Nov 2007, description=Feb-2013, editable=T}, 3={id=3, empjoindate=16 Nov 2007, description=Mar-2013, editable=T}} </code></pre> <p>from my controller now i want to render this values to my freemarker template like </p> <pre><code>&lt;#list hramonths as indication&gt; &lt;tr&gt; &lt;td class="center"&gt; &lt;#list monthlyrent as rent&gt; &lt;#if indication.id == rent.month&gt;&lt;input type="hidden" name="locationIndicatorId_${indication.id}" value="${indication.id}" /&gt; &lt;/#if&gt; &lt;/#list&gt; &lt;/td&gt; &lt;td class="center"&gt; ${indication.description} &lt;input type="hidden" name="month_${indication.id}" id="month_${indication.id}" value="${indication.id}" /&gt; &lt;/td&gt; &lt;td class="center"&gt; &lt;# assign varIndicatorId =""&gt; &lt;#list monthlyrent as rent&gt; &lt;#if indication.id == rent.month&gt; &lt;# assign varIndicatorId = ${rent.Indicator}&gt; &lt;/#if&gt; &lt;/#list&gt; &lt;select name="indicator_${indication.id}" &lt;#if indication.editable == "F"&gt; disabled="true" &lt;/#if&gt; &lt;#if editable == false&gt;disabled="true"&lt;/#if&gt;&gt; &lt;#list indicators as indicator&gt; &lt;option value="${indicator.cid}" &lt;#if indicator.cid == varIndicatorId&gt; selected &lt;/#if&gt;&gt; ${indicator.description} &lt;/option&gt; &lt;/#list&gt; &lt;/select&gt; &lt;/td&gt; &lt;td class="right"&gt; &lt;#if mothlyrentsize != "0"&gt; &lt;#list monthlyrent as rent&gt; &lt;#if indication.id == rent.month&gt; &lt;input type="text" align="right" name="rent_${indication.id}_${rent.cid}" value="$DelphiNumber.formatNumber("$!rent.rent")" &lt;#if indication.editable == "F"&gt; readonly="true" class="rbox" &lt;/#if&gt; &lt;#if editable == false&gt; readonly="true" class="rbox" &lt;/#if&gt; &lt;#if indication.editable != "F" &amp;&amp; editable != false&gt; onBlur="isnumeric(this.form,this),updateHRATotalAll(this.form,'blurtype')" &lt;/#if&gt; /&gt; &lt;/#if&gt; &lt;/#list&gt; &lt;#else&gt; &lt;input type="text" name="rent_${indication.id}_0" value="$DelphiNumber.formatNumber("0")" #if("$!indication.editable" == "F") readonly="true" class="rbox" #end #if($editable == false) readonly="true" class="rbox" #end style="TEXT-ALIGN: right" #if("$!indication.editable" != "F" &amp;&amp; $editable != false) onBlur="isnumeric(this.form,this),updateHRATotalAll(this.form,'blurtype')" #end &gt; &lt;/input&gt; &lt;/#if&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/#list&gt; </code></pre> <p>but i am getting error </p> <pre><code>Expected collection or sequence. hramonths evaluated instead to freemarker.template.SimpleHash on line 199, column 40 in WEB-INF/classes/com/greytip/cougar/module/epayroll/v2/freemarker/salary/it-declaration.ftl. The problematic instruction: ---------- ==&gt; list hramonths as indication [on line 199, column 33 in WEB-INF/classes/com/greytip/cougar/module/epayroll/v2/freemarker/salary/it-declaration.ftl] ---------- Java backtrace for programmers: ---------- freemarker.template.TemplateException: Expected collection or sequence. hramonths evaluated instead to freemarker.template.SimpleHash on line 199, column 40 </code></pre> <p>How do i render it on a table please any one help me.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload