myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Kitching (JIRA)" <>
Subject [jira] Commented: (MYFACES-856) t:aliasBean + binding + panelGrid causes exception
Date Tue, 22 Nov 2005 04:58:43 GMT
    [ ] 

Simon Kitching commented on MYFACES-856:

UIComponentTag.doStartTag calls encodeBegin() only for components that do *not* render their
children. For components like UIPanel that render their children, *no* calls of any sort are
made on the component until after all the child components have been created. But that's too
late in this case, as the create will fail due to the binding EL being evaluated as the child
components are created :-(

I'm looking into whether is is possible to customise the AliasBeanTag class to work around

> t:aliasBean + binding + panelGrid causes exception
> --------------------------------------------------
>          Key: MYFACES-856
>          URL:
>      Project: MyFaces
>         Type: Bug
>     Reporter: Simon Kitching

> The following use of t:aliasBean causes an exception:
> ==== including page
> <%@ taglib uri="" prefix="h"%>
> <%@ taglib uri="" prefix="f"%>
> <%@ taglib uri="" prefix="t"%>
> <f:view>
>   <h:panelGrid>
>     <t:aliasBean alias="#{target}" value="#{someBean}">
>       <jsp:include page="included.jsp"/>
>     </t:aliasBean>
>   </h:panelGrid>
> </f:view>
> ==== included page
> <%@ taglib uri="" prefix="h"%>
> <%@ taglib uri="" prefix="f"%>
> <%@ taglib uri="" prefix="t"%>
> <f:subview id="foo">
>     <h:inputText binding="#{target.input}"/>
> </f:subview>
> The thrown exception is:
> javax.faces.el.PropertyNotFoundException: Base is null: target
>         at org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(
>         at org.apache.myfaces.el.ValueBindingImpl.setValue(
>         at org.apache.myfaces.application.ApplicationImpl.createComponent(
> I believe the problem is that panelGrid renders its children. This means that the components
are first created, then the panelGrid iterates over them to render them. However the alias
bean hasn't set up the alias at the time the components are being created. And ApplicationImpl.createComponent(binding,
context, componentType) is immediately evaluating the binding expression, resulting in the
target bean for the binding not being found.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message