[ 
http://issues.apache.org/jira/browse/MYFACES-993?page=comments#action_12361539 
] 

Dennis Byrne commented on MYFACES-993:
--------------------------------------

Hmm ... OK.  Perhaps you can change this one to an minor improvement for t:div, 
rather than a major bug for f:view .  The improvement could be for both t:div 
and a new t:span as well .  I can't find anything on Google or the mailing list 
archives about this - do you remember who was in the thread?  For me, it would 
be nice to programmatically add children to spans and divs.

> Programmatically added UIComponents forgotton
> ---------------------------------------------
>
>          Key: MYFACES-993
>          URL: http://issues.apache.org/jira/browse/MYFACES-993
>      Project: MyFaces
>         Type: Bug
>   Components: General
>     Versions: 1.1.1
>  Environment: tomcat 5.5.9 
>     Reporter: Dennis Byrne

>
> In the following JSP, the test method of the test bean creates a 
> HtmlOutputText, sets a unique id, sets a value, and adds it to the children 
> collection of the UIComponent of the div tag.  However the new child 
> component is never rendered.  The only child rendered is the first one (w/ 
> @value = "foo" ).
> <f:view>
>    <h:commandLink value="action" action="#{test.test}" />
>    <t:div binding="#{test.tag}">
>              <h:outputText value="foo" />
>    </t:div>
> </f:view>
> The reason why the first child (@value=foo) is always rendered has to do w/ 
> the fact that UIComponentTag.doEndTag ends up triggerring 
> HtmlTextRendererBase.renderOutputText during the render response phase.  This 
> also explains why the programmatically added sibling is not rendered - there 
> is no UIComponentTag.doEndTag() .
> The programmatically added UIComponent will be rendered if you wrap t:div w/ 
> a panelGrid or panelGroup.  This is because the UIComponents for these two 
> tags render their own children, and MyFaces uses recursion in order to make 
> sure the proper encoding methods are called on *all* children.   

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to