I wonder if this might somehow be related.  item was a UIData interator var.

On 8/2/06, David Van Stone <[EMAIL PROTECTED]> wrote:
I made a new test JSF application to try to recreate the problem, in order to
publish on this forum. Instead, I got to carefully review all the pieces and
in the process solved it.

I needed to add the class (representing a row) as a managed bean in
faces-config.xml with scope of "none":

  <managed-bean>
        <managed-bean-name>item</managed-bean-name>
        <managed-bean-class>whatever.the.class.is.called</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>
  </managed-bean>

Without this, you get the "Base is null" error.

On 8/2/06, Venkat Rao <[EMAIL PROTECTED]> wrote:
Yes, I do have two different beans, but the code inside the 'rendered' block
is getting evaluated even when the condition is false.

To dynamically change the component tree based on internal structures, it
appears that constructs like <ui:repeat> / "rendered" / <c:forEach> are not
working too well. I am having better success by binding a h:panelGroup to my
Java code, and from Java code, programmatically manipulate the tree.
However, it is not as convenient as scripting.

-- venkat

-----Original Message-----
From: Mr Arvind Pandey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 02, 2006 11:02 AM
To: MyFaces Discussion
Subject: RE: "rendered" condition does not work as expected

Hi Venkat!

     If you have two pulic classes then there must be
two different beans in your xml file, say circle and
rectangle. In first panelGroup use
rendered="#{circle.objType == 'circle'}" and in second
one use rendered="#{rectangle.objType ==
'rectangle'}". It seems as if in your code rendered
property is working as expected.

Arvind.

> -----Original Message-----
> From: Venkat Rao [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 1 August 2006 2:43 AM
> To: 'MyFaces Discussion'
> Subject: "rendered" condition does not work as
> expected
>
> My code inside a "rendered" flag is getting invoked
> even when the
> condition is false. I am iterating over a list of
> Graphics objects to
> display information about each by calling the object
> specific methods.
> The code works fine if I use only <h:outputText>. If
> I use <h:inputText>
> however, the rendered property does not seem to be
> taking effect.
>
> <ui:repeat var="graphicsObj"
> value="#{gfx.graphicsObjList}">
>
>     <h:panelGroup rendered="#{graphicsObj.objType ==
> 'circle'}" >
>         [Circle] Radius: <h:outputText
> value="#{graphicsObj.radius}"/>
>     </h:panelGroup>
>
>     <h:panelGroup rendered="#{graphicsObj.objType ==
> 'rectangle'}" >
>         [Rectangle] Length: <h:outputText
> value="#{graphicsObj.length}"/>
>     </h:panelGroup>
>
> </ui:repeat>
>
> The above works fine, as expected. However, if I
> change from
> <h:outputText> to <h:inputText>, it complains :
>
> javax.faces.el.PropertyNotFoundException:
> /graphics.xhtml @24,54
> value="#{graphicsObj.radius}": Bean: Rectangle,
> property: radius
>
> So, the first block of code is getting executed for
> a Rectangle object
> when using a <h:inputText> but not when using
> <h:outputText>.
>
> Any help in solving the problem is appreciated. The
> code for the Circle
> and Rectangle beans is given below:
>
> public class Circle implements Serializable {
>     public String getObjType() {
>         return "circle";
>     }
>
>     int radius;
>     public void setRadius(int radius) {
>         this.radius = radius;
>     }
>     public int getRadius() {
>         return this.radius;
>     }
> }
>
> public class Rectangle implements Serializable {
>     public String getObjType() {
>         return "rectangle";
>     }
>
>     private int length;
>     public void setLength(int length) {
>         this.length = length;
>     }
>     public int getLength() {
>         return this.length;
>     }
> }
>
>
> This correspondence is for the named persons only.
> It may contain confidential or privileged
> information or both.
> No confidentiality or privilege is waived or lost by
> any mis transmission.
> If you receive this correspondence in error please
> delete it from your system immediately and notify
> the sender.
> You must not disclose, copy or relay on any part of
> this correspondence, if you are not the intended
> recipient.
> Any opinions expressed in this message are those of
> the individual sender except where the sender
> expressly,
> and with the authority, states them to be the
> opinions of the Department of Emergency Services,
> Queensland.
>




__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/



Reply via email to