You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Steve Horne <st...@gmail.com> on 2008/01/14 21:00:11 UTC

[Trinidad] tr:table "binding" attribute problem

I am using Facelets and Trinidad 1.0.4.

I have a <tr:table> that has a "detailStamp" facet which contains another
table.  It is this inner table with which I am having problems.  Here is the
outer table:

                <tr:table first="0" rows="10" var="wrapper" value="#{
backer.list}" rowBandingInterval="1" emptyText="#{labels['
Global.search.notFound']}">
                    <f:facet name="detailStamp">
                        <pmb:businessEntityList backer="#{
wrapper.entityBacker}" />
                    </f:facet>
                    <tr:column>
                        <f:facet name="header">Business Category
Name</f:facet>#{wrapper.businessCategory.name}</tr:column>
                    <tr:column>
                        <f:facet name="header">Business Category
Description</f:facet>#{wrapper.businessCategory.desc}</tr:column>
                </tr:table>


The contents of the detailStamp are a custom facelet that includes this
table:

<tr:table first="0" rows="10" var="sub" value="#{backer.list}"
rowSelection="multiple" rowBandingInterval="1" emptyText="#{labels['
Global.search.notFound']}">
    <f:facet name="footer">
        <pmb:brokeredActions />
    </f:facet>
    <f:facet name="selection">
        <tr:selectManyCheckbox />
    </f:facet>
    <tr:column>
        <f:facet name="header">#{labels['BusinessEntity.name']}</f:facet>#{
sub.name}</tr:column>
    <tr:column>
        <f:facet name="header">#{labels['BusinessEntity.desc']}</f:facet>#{
sub.desc}</tr:column>
</tr:table>

As you can see, the innermost facelet is passed a parameter "backer".  This
all works perfectly UNLESS I put a binding attribute on the innermost table:

<tr:table binding="#{backer.listTable}" ...

This causes an exception:

javax.faces.el.PropertyNotFoundException:
/components/lob/businessEntity/list.xhtml @24,223 binding="#{
backer.listTable}": Target Unreachable, identifier 'backer' resolved to null
    at com.sun.facelets.el.LegacyValueBinding.setValue(
LegacyValueBinding.java:72)
    at org.apache.myfaces.application.ApplicationImpl.createComponent(
ApplicationImpl.java:447)
    at com.sun.facelets.tag.jsf.ComponentHandler.createComponent(
ComponentHandler.java:237)
    at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java
:139)
    at com.sun.facelets.tag.UserTagHandler.apply(UserTagHandler.java:122)

I think this has something to do with the time at which the evaluation
happens for the binding attribute.  By removing the binding, the innermost
table works perfectly, meaning the identifier "backer" does NOT resolve to
null.

Any help or insight into this problem would be appreciated.

Steve

-- 
"Many men go fishing all of their lives without knowing it is not fish they
are after."

- Henry David Thoreau

Re: AW: [Trinidad] tr:table "binding" attribute problem

Posted by shhQuiet <st...@gmail.com>.

Rottstock, Sven wrote:
> 
> Hi Steve,
>  
> i don't know why the exception is thrown. But could you try the
> following solution:
>  <snip>
>         <pmb:businessEntityList backer="#{wrapper.entityBacker}" >
>             <f:attribute name="binding"
> value="#{wrapper.entityBacker.listTable}"/>
>         </pmb:businessEntityList>
> </snip>
> 

I tried this and it worked beautifully.  The only other change I made is in
the included component, I used the "binding" attribute like this:  <tr:table
binding="#{binding}" ... >

Thanks for your suggestion...  The next question is whether this is a
Trinidad or Facelets bug...

-- 
View this message in context: http://www.nabble.com/-Trinidad--tr%3Atable-%22binding%22-attribute-problem-tp14816168p14841555.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


AW: [Trinidad] tr:table "binding" attribute problem

Posted by "Rottstock, Sven" <Sv...@sungard.de>.
Hi Steve,
 
i don't know why the exception is thrown. But could you try the
following solution:
 
<tr:table var="wrapper" value="#{backer.list}"> 
    <f:facet name="detailStamp">
        <pmb:businessEntityList backer="#{wrapper.entityBacker}" >
            <f:attribute name="binding"
value="#{wrapper.entityBacker.listTable}"/>
        </pmb:businessEntityList>
    </f:facet>
    <tr:column>
        <!-- some stuff goes here -->
    </tr:column>
</tr:table>
 
<tr:table var="sub" value="#{backer.list}">
    <f:facet name="footer">
        <pmb:brokeredActions />
    </f:facet>
    <f:facet name="selection">
        <tr:selectManyCheckbox /> 
    </f:facet>
    <tr:column>
        <!-- some stuff goes here -->
    </tr:column>
    <ui:insert/>
</tr:table>

Regards,

Sven
________________________________

Von: Steve Horne [mailto:stevehorne@gmail.com] 
Gesendet: Montag, 14. Januar 2008 21:00
An: MyFaces Discussion
Betreff: [Trinidad] tr:table "binding" attribute problem


I am using Facelets and Trinidad 1.0.4.

I have a <tr:table> that has a "detailStamp" facet which contains
another table.  It is this inner table with which I am having problems.
Here is the outer table: 

                <tr:table first="0" rows="10" var="wrapper"
value="#{backer.list}" rowBandingInterval="1"
emptyText="#{labels['Global.search.notFound']}"> 
                    <f:facet name="detailStamp">
                        <pmb:businessEntityList
backer="#{wrapper.entityBacker}" />
                    </f:facet>
                    <tr:column> 
                        <f:facet name="header">Business Category
Name</f:facet>#{wrapper.businessCategory.name}</tr:column>
                    <tr:column> 
                        <f:facet name="header">Business Category
Description</f:facet>#{wrapper.businessCategory.desc}</tr:column>
                </tr:table>


The contents of the detailStamp are a custom facelet that includes this
table:

<tr:table first="0" rows="10" var="sub" value="#{backer.list}"
rowSelection="multiple" rowBandingInterval="1" emptyText="#{labels['
Global.search.notFound']}">
    <f:facet name="footer">
        <pmb:brokeredActions />
    </f:facet>
    <f:facet name="selection">
        <tr:selectManyCheckbox /> 
    </f:facet>
    <tr:column>
        <f:facet
name="header">#{labels['BusinessEntity.name']}</f:facet>#{sub.name}</tr:
column>
    <tr:column> 
        <f:facet
name="header">#{labels['BusinessEntity.desc']}</f:facet>#{sub.desc}</tr:
column>
</tr:table>

As you can see, the innermost facelet is passed a parameter "backer".
This all works perfectly UNLESS I put a binding attribute on the
innermost table: 

<tr:table binding="#{backer.listTable}" ...

This causes an exception:

javax.faces.el.PropertyNotFoundException:
/components/lob/businessEntity/list.xhtml @24,223
binding="#{backer.listTable }": Target Unreachable, identifier 'backer'
resolved to null
    at
com.sun.facelets.el.LegacyValueBinding.setValue(LegacyValueBinding.java:
72)
    at org.apache.myfaces.application.ApplicationImpl.createComponent
(ApplicationImpl.java:447)
    at
com.sun.facelets.tag.jsf.ComponentHandler.createComponent(ComponentHandl
er.java:237)
    at
com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:13
9)
    at com.sun.facelets.tag.UserTagHandler.apply
(UserTagHandler.java:122)

I think this has something to do with the time at which the evaluation
happens for the binding attribute.  By removing the binding, the
innermost table works perfectly, meaning the identifier "backer" does
NOT resolve to null. 

Any help or insight into this problem would be appreciated.

Steve

-- 
"Many men go fishing all of their lives without knowing it is not fish
they are after."

- Henry David Thoreau