[ 
https://issues.apache.org/jira/browse/MYFACES-2949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12923403#action_12923403
 ] 

Hampus Wingren commented on MYFACES-2949:
-----------------------------------------

Sure, I´ve only seen the oamSubmit.js get printed and I followed it to a 
ResourceHandler which does an encodeAll on the script resources, not 
addComponentResource


Facelet snippet:

<dt>
                <label for="text">A text</label>
              </dt>
                <c:forEach items="#{products} var="produkt">
                        <c:if test="#{produkt.visible}">
              <dd>
                <label class="speech-only"></label>
                 <h:commandLink id="_textID" rendered="#{produkt.visible}" 
immediate="false" action="mock" 
actionListener="#{mockForm.setAttributes}"><h:outputText 
value="#{produkt.text}"/>
                                                <f:attribute name="one" 
value="#{produkt.one}"/>
                                                <f:attribute name="two" 
value="#{produkt.two}"/>
                                                <f:attribute name="three" 
value="#{produkt.three}"/>
                                        </h:commandLink>
              </dd>
                        </c:if>
                </c:forEach>



HTML output:
<dl>
              <dt>
                <label for="text">A text</label>
              </dt>
              <dd>
                <label class="speech-only"></label><script 
type="text/javascript" 
src="/hello/hampus/javax.faces.resource/oamSubmit.js?ln=org.apache.myfaces"><!--
 
//--></script><a href="#" onclick="return 
myfaces.oam.submitForm('text','text:_0_111111111);" id="text:_0_111111111">Some 
text</a>
              </dd>
                        </dl>
 
      <div class="clear"> 
      </div>
    </div>
</code>

> I think that MyFaces should use JSF 2 resource handling instead of directly 
> write script resources to the output stream
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-2949
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2949
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.0.2
>         Environment: ALL
>            Reporter: Hampus Wingren
>
> I think that MyFaces should use JSF 2 resource handling instead of directly 
> write script resources to the output stream. Why not use the 
> UIViewRoot.addComponentResource. The problem I´m having is that I´ve got a 
> simple portal implementation that queries the resources added to the viewroot 
> and then puts them in the portal <head> section.
> This could potentially be a problem in a portlet environment where several 
> portlets will write out this script import directly to the response stream 
> instead of collecting one of them under head.
> Regards,
> Hampus

-- 
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