jyothisree | 19 Jul 2010 13:18
Favicon

freemarker in struts2 application


I have a struts2 application ,where in the jsp page i have struts2 tag
checkbacklist ,which displays the list of checkboxes in a row ,i want to
display it in the column form , for that i have made changes in the
checkboxlist.flt file as 

<#if parameters.cssStyle?exists>
<#if "${parameters.cssStyle?html}" == "vertical">
<#if itemCount%2==0>
<br><#rt/>
<#else>&nbsp;
</#if>
</#if>
</#if>

In this i can display the way i want to display the checkboxes in 2 columns
,but the problem is the checkboxes starting from the 2nd column are not in
the line 
something like this

  1 chkbox     2 chkbox
  3 chkbox        4 chkbox
  5 chkbox    5 chkbox 

 i want it to be as 
  1 chkbox            2 chkbox
  3 chkbox            4 chkbox
  5 chkbox            5 chkbox 

What do i do for the above code 
(Continue reading)

Daniel Dekany | 19 Jul 2010 15:35
Picon
Favicon

Re: freemarker in struts2 application

Monday, July 19, 2010, 1:18:33 PM, jyothisree wrote:

> I have a struts2 application ,where in the jsp page i have struts2 tag

Note that this is the FMPP mailing-list, not the FreeMarker
mailing-list.

> checkbacklist ,which displays the list of checkboxes in a row ,i want to
> display it in the column form , for that i have made changes in the
> checkboxlist.flt file as 
>
> <#if parameters.cssStyle?exists>
> <#if "${parameters.cssStyle?html}" == "vertical">

The above line should be just:

  <#if parameters.cssStyle == "vertical">

Does the same but cleaner and faster...

Also, the two #if could be united as

  <#if parameters.cssStyle?exists and parameters.cssStyle == "vertical">

which furthermore can be reduced to:

  <#if parameters.cssStyle!'' == "vertical">

> <#if itemCount%2==0>
> <br><#rt/>
(Continue reading)


Gmane