[jboss-jira] [JBoss JIRA] (WFLY-957) Mojarra 2.1.18 upgrade breaks Renderers' @ResourceDependency

Marek Schmidt (JIRA) issues at jboss.org
Tue Apr 15 06:50:34 EDT 2014


     [ https://issues.jboss.org/browse/WFLY-957?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marek Schmidt closed WFLY-957.
------------------------------

    Resolution: Out of Date

    
> Mojarra 2.1.18 upgrade breaks Renderers' @ResourceDependency
> ------------------------------------------------------------
>
>                 Key: WFLY-957
>                 URL: https://issues.jboss.org/browse/WFLY-957
>             Project: WildFly
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: JSF
>         Environment: AS 7.2.0.Final-prerelease1
>            Reporter: Marek Schmidt
>            Assignee: Stan Silvert
>            Priority: Critical
>              Labels: regression
>         Attachments: AS7-6513-test.tar, AS7-6513-test.war, AS7-6513-test2.zip
>
>
> Since Mojarra 2.1.18 upgrade, the JSF doesn't render required @ResourceDependency of custom renderers on postback, if the component is bound.
> Having an renderer:
> {code}
> @ResourceDependencies({ @ResourceDependency(library = "my", name = "mylib.js") })
> public class MyOutputTextRenderer extends Renderer 
> {
>    @Override
>    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
>       context.getResponseWriter().startElement("button", null);
>       context.getResponseWriter().writeAttribute("onclick", "javascript:myHello();", null);
>       context.getResponseWriter().writeText("Hello, world", null);
>       context.getResponseWriter().endElement("button");
>    }
> }
> {code}
> And 
> {code}
> <h:form>
>         <my:hello binding="#{counter.hello}"/>
>         <h:commandButton value="Send" action="#{counter.add}" />
> </h:form>
> {code}
> The rendered output contains the required mylib.js only in the first request, but no script element with mylib.js is rendered in the header on the page after clicking the "Send" button, thus breaking the custom component.
> Note that this happens only if the the component is using the "binding" attribute.
> {code}
> @ManagedBean(name = "counter")
> @ViewScoped
> public class Counter implements Serializable
> {
>    private int counter = 0;
>    
>    private UIOutput hello;
>    
>    public void setHello(UIOutput hello) {
>       this.hello = hello;
>    }
>    
>    public UIOutput getHello() {
>       return this.hello;
>    }
>    public void add()
>    {
>       ++counter;
>    }
>    
>    public int getCounter() {
>       return counter;
>    }
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list