incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Baker,Jonathan" <Bak...@oclc.org>
Subject RE: Node Stamp Facet, af:commandNavigationItem rendered attribute, and boolean operators
Date Tue, 17 Oct 2006 12:58:52 GMT
Interesting...

I can successfully evaluate one call to the node i.e. #{navItem.rendered}

The problem is trying to and two node calls in the same expression i.e. #{navItem.rendered
&& navItem.authorized}

I don't have the option of using the menu model, because the rendered tag really is based
on values for each node.  Each node has completely different criteria to judge whether or
not it should be rendered.  It is interesting that in your example you only had one node call,
but it was somehow unsuccessful.


JB

-----Original Message-----
From: G√ľnther, Thorsten [mailto:Thorsten.Guenther@medocino.de] 
Sent: Tuesday, October 17, 2006 4:52 AM
To: adffaces-user@incubator.apache.org
Subject: AW: Node Stamp Facet, af:commandNavigationItem rendered attribute, and boolean operators

Hi Jonathan!

I have the same problem here. In my experience any kind of request in rendered against the
"node" evaluates to false. Requests against the menuModel work like expected. So 

            <tr:page var="node" value="#{menuModel.model}">
            <f:facet name="nodeStamp">
              <tr:commandNavigationItem text="#{node.label}" action="#{node.getOutcome}"
immediate="true" rendered="#{menuModel.rendered and menuModel.everTrue}" />
            </f:facet>

is ok, but 

            <tr:page var="node" value="#{menuModel.model}">
            <f:facet name="nodeStamp">
              <tr:commandNavigationItem text="#{node.label}" action="#{node.getOutcome}"
immediate="true" rendered="#{node.everTrue}" />
            </f:facet>

evaluates to false.
I also worked around this via the menuModel. At the time where I encountered this I thought
this would be because me getting something wrong. So I did not look in this issue any further
and did not report it, what I do regret now.

Regards,
Thorsten


-----Urspr√ľngliche Nachricht-----
Von: Baker,Jonathan [mailto:BakerJ@oclc.org]
Gesendet: Montag, 16. Oktober 2006 23:15
An: adffaces-user@incubator.apache.org
Betreff: Node Stamp Facet, af:commandNavigationItem rendered attribute, and boolean operators

I am using the af:page component.  Inside of the NodeStamp facet I am referencing a af:commandNavigationItem
with a rendered attribute.
Inside of the rendered attribute I am calling two methods on the same backing bean and ANDing
them together.  For some reason this makes my navigation hierarchy disappear.

If the rendered attribute looks like this #{navItem.rendered} it works correctly If the rendered
attribute looks like this #{navItem.authorized} it works correctly If the rendered attribute
looks like this #{navItem.rendered && navItem.authorized} then nothing is rendered
even though both values = true.

I have used the same combination outside of the node stamp facet and the components are rendered
correctly, so it is somehow related to how the nodestamp facet of the page component is rendered.
 

As a work-around I have created a method in my backing bean that performs the anding of the
two methods, so that is not a problem, I just preferred to have these two methods separated
as they stand for two different sets of criteria.


JB



Mime
View raw message