[ 
https://issues.apache.org/jira/browse/OFBIZ-3623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851362#action_12851362
 ] 

Blas Rodriguez Somoza commented on OFBIZ-3623:
----------------------------------------------

Thanks

1.- No yo can't, because UtilHttp only encode ampersands it if is not already 
encoded, if it is encoded (&) it does nothing. An here you need doubly 
encoded ampresands (&)

2.- The condition three lines up is an OR condition which can evaluate to true 
with an empty modelFormField.getWidgetStyle()
if (UtilValidate.isNotEmpty(modelFormField.getWidgetStyle()) || 
modelFormField.shouldBeRed(context))

Anyway the check can be removed as " alert" (with a space before) is valid as 
class attribute, so the following is valid:
            if (modelFormField.shouldBeRed(context)) {
                str.append(" alert");
            }

3-.OK, I changed it to rendererMenuItemCount, I use rendered instead of 
displayed because it seems more appropriate here.  I changed also the 
ModelMenuItem method to "shouldBeRendered"

I added a new patch file updated with those changes.

> XHTML validation errors (framework/widget)
> ------------------------------------------
>
>                 Key: OFBIZ-3623
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3623
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Blas Rodriguez Somoza
>            Assignee: Adrian Crum
>            Priority: Trivial
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-3623_framework_widget_xhtml.diff
>
>
> XHTML validation errors
>     * Unclosed INPUT
>     * attributes without values (checked, selected, disabled, etc)
>     * attribute values without "
>     * Uppercase tags or attributes.
>     * Unencoded ampersands in urls.
> Other errors:
> htmlFormMacroLibrary.ftl
> Line 452. img tag must have src and alt attributes.
> <span id="${id}_indicator" style="display: none" class="indicator"><img 
> /></span>
> htmlScreenMacroLibrary.ftl
> Wrong markup at Line 143. Entity without final ;
> >&nbsp</a></li>
> Changes in java classes:
> MacroFormRenderer.java (renderSortField)
> The sort URL must use encoded ampersands.
> HtmlFormRenderer.java (renderDisplayField)
> The alert style must be included in the class attribute not appear as a 
> attribute name (which is what happens now)
> HtmlMenuRenderer.java (renderMenuOpen, renderMenuClose)
> XHTML don't like empty UL. To avoid that, the renderMenuOpen and 
> renderMenuClose methods need to know how many menu items pass the condition 
> and so will be included.
> ModelMenu.java (public int passConditionCount)
> New method to get how many menu items pass the condition.
> ModelMenuItem (public boolean passCondition)
> New method to get if the menu item pass the condition.
> Patch attached

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to