Bug in svn commit: r931416 - Added support for setting a class attribute (using widget-style) on the div rendered by ContainerField.

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

Bug in svn commit: r931416 - Added support for setting a class attribute (using widget-style) on the div rendered by ContainerField.

Blas Rodriguez Somoza
Hello

    There is an bug in this commit, htmlFormMacroLibrary.ftl expects
arguments id and className and HtmlFormRenderer.java and
MacroFormRenderer.java provides id and class.
    The error is visible in SFA Manager-> [Accounts |  Contacts | Leads ]

Macro renderContainerField has no such argument: class The problematic
instruction: ---------- ==> macro renderContainerField [on line 505,
column 1 in component://widget/templates/htmlFormMacroLibrary.ftl] in
user-directive renderContainerField [on line 1, column 1 in Mon Apr 12
03:01:04 CEST 2010] ---------- Java backtrace for programmers:
---------- freemarker.template.TemplateException: Macro
renderContainerField has no such argument:

<#macro renderContainerField id className><div id="${id}"
class="${className}"/></#macro>

MacroFormRenderer.java
    public void renderContainerFindField(Appendable writer,
            Map<String, Object> context, ContainerField containerField)
            throws IOException {
        String id = containerField.getId();
        String className =
UtilFormatOut.checkNull(containerField.getModelFormField().getWidgetStyle());

        StringWriter sr = new StringWriter();
        sr.append("<@renderContainerField ");
        sr.append("id=\"");
        sr.append(id);
        sr.append("\" class=\"");
        sr.append(className);
        sr.append("\" />");
        executeMacro(writer, sr.toString());
    }

HtmlFormRenderer.java
    public void renderContainerFindField(Appendable writer, Map<String,
Object> context, ContainerField containerField) throws IOException {
        writer.append("<div ");
        String id = containerField.getId();
        if (UtilValidate.isNotEmpty(id)) {
            writer.append("id=\"");
            writer.append(id);
            writer.append("\" ");
        }
        String className =
containerField.getModelFormField().getWidgetStyle();
        if (UtilValidate.isNotEmpty(className)) {
            writer.append("class=\"");
            writer.append(className);
            writer.append("\" ");
        }
        writer.append("/>");
    }


Regards
Blas
Reply | Threaded
Open this post in threaded view
|

Re: Bug in svn commit: r931416 - Added support for setting a class attribute (using widget-style) on the div rendered by ContainerField.

Bilgin Ibryam-2
Blas Rodriguez Somoza wrote:

> Hello
>
>    There is an bug in this commit, htmlFormMacroLibrary.ftl expects
> arguments id and className and HtmlFormRenderer.java and
> MacroFormRenderer.java provides id and class.
>    The error is visible in SFA Manager-> [Accounts |  Contacts | Leads ]
>
> Macro renderContainerField has no such argument: class The problematic
> instruction: ---------- ==> macro renderContainerField [on line 505,
> column 1 in component://widget/templates/htmlFormMacroLibrary.ftl] in
> user-directive renderContainerField [on line 1, column 1 in Mon Apr 12
> 03:01:04 CEST 2010] ---------- Java backtrace for programmers:
> ---------- freemarker.template.TemplateException: Macro
> renderContainerField has no such argument:
>
> <#macro renderContainerField id className><div id="${id}"
> class="${className}"/></#macro>
>
> MacroFormRenderer.java
>    public void renderContainerFindField(Appendable writer,
>            Map<String, Object> context, ContainerField containerField)
>            throws IOException {
>        String id = containerField.getId();
>        String className =
> UtilFormatOut.checkNull(containerField.getModelFormField().getWidgetStyle());
>
>
>        StringWriter sr = new StringWriter();
>        sr.append("<@renderContainerField ");
>        sr.append("id=\"");
>        sr.append(id);
>        sr.append("\" class=\"");
>        sr.append(className);
>        sr.append("\" />");
>        executeMacro(writer, sr.toString());
>    }
>
> HtmlFormRenderer.java
>    public void renderContainerFindField(Appendable writer, Map<String,
> Object> context, ContainerField containerField) throws IOException {
>        writer.append("<div ");
>        String id = containerField.getId();
>        if (UtilValidate.isNotEmpty(id)) {
>            writer.append("id=\"");
>            writer.append(id);
>            writer.append("\" ");
>        }
>        String className =
> containerField.getModelFormField().getWidgetStyle();
>        if (UtilValidate.isNotEmpty(className)) {
>            writer.append("class=\"");
>            writer.append(className);
>            writer.append("\" ");
>        }
>        writer.append("/>");
>    }
>
>
> Regards
> Blas
Thanks for reporting Blas, fixed in rev 933099

Bilgin