[
https://issues.apache.org/jira/browse/WW-3516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984175#action_12984175
]
Burton Rhodes commented on WW-3516:
-----------------------------------
Actually I think the change should be made to all the templates. It makes
sense in the simple theme because all other templates in the simple theme make
use of cssClass, cssErrorClass, & cssStyle. This is one of the few templates
that doesn't and it would add consitancy. Most importantly, it's nearly
impossible to format the list if the <span> tag is not in place since it's an
iteration and the keys are defined on the fly. It almost makes this tag
unusable in a "simple" scenario.
In addition, adding the <span> will not change any formatting unless the user
defines values for one of the css values (otherwising keeping it "simple").
The simple theme is supposed to provide full flexibility while not auto
formatting anything... IMO, this would accomplish that idea.
> Add <div> tag to <s:checkboxlist> UI Tag
> ----------------------------------------
>
> Key: WW-3516
> URL: https://issues.apache.org/jira/browse/WW-3516
> Project: Struts 2
> Issue Type: Improvement
> Components: Plugin - Tags
> Affects Versions: 2.2.1
> Environment: n/a
> Reporter: Burton Rhodes
> Assignee: Maurizio Cucchiara
> Attachments: checkboxlist.ftl
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Currently the checkboxlist UI Tag does not implement the cssClass or cssStyle
> attributes in checkboxlist.ftl file (for both simple and xhtml themes). The
> file should be modified using a <div> tag so that css attibutes can be used
> around both the checkbox and label. This will allow user full flexibility
> with the layout of the checkboxlist. The layout capabilities for this tag
> "out of the box" are not adequate for almost any UI. Almost without fail
> users want a one column list or fixed width list so that the <input
> type=checkbox> and <label> tags do not break on a line. This fix could also
> be implemented on radio an option tags as well. Fully functional code
> snippet below and examples.
> // *** Modified Code: /template/simple/checkboxlist.ftl ****
> <#-- ***************Added div tag to use cssClass and/or
> cssStyle, etc -->
> <div
> <#include "/${parameters.templateDir}/simple/css.ftl" />
> >
>
> <input type="checkbox" name="${parameters.name?html}"
> value="${itemKeyStr?html}" id="${parameters.name?html}-${itemCount}"<#rt/>
> <#if tag.contains(parameters.nameValue, itemKey)>
> checked="checked"<#rt/>
> </#if>
> <#if parameters.disabled?default(false)>
> disabled="disabled"<#rt/>
> </#if>
> <#if parameters.title??>
> title="${parameters.title?html}"<#rt/>
> </#if>
> <#include
> "/${parameters.templateDir}/simple/scripting-events.ftl" />
> <#include
> "/${parameters.templateDir}/simple/common-attributes.ftl" />
> />
>
> <label for="${parameters.name?html}-${itemCount}"
> class="checkboxLabel">${itemValue?html}</label>
>
> <#-- ****************** End div -->
> </div>
> // ***** Will produce multi-column (fixed width for each item), preserving
> checkbox and label on the same line, and carry over to next line
> <s:checkboxlist
> name="customers"
> list="%{customerList}"
> cssClass="AnyClass"
> cssStyle="float: left; width:150px"
> />
> // ***** Will produce fixed width one column list, 150px wide
> <s:checkboxlist
> name="customers"
> list="%{customerList}"
> cssClass="AnyClass"
> cssStyle="width:150px"
> />
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.