• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

managed bean value binding

 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am confused about why my value binding expression in my results.jsp does not show anything.

I am working in NetBeans 6.5.1, Tomcat 6.0.20 and using the JSF 1.2 implementation from the IDE. I am not using a visual web project, just a vanilla JSF 1.2 project.

I have a search.jsp that uses dynamic navigation from I guess what is called a "controller bean"? The search.jsp upon getting the string "success" from a method in the controller bean, called pzInfo, passes navigation to a results.jsp In the results.jsp I have many value binding expressions that write text to the results.jsp using h:outputText and several h:dataTables. All of those UI components reference a managed bean in my faces-config.xml tied to the pzInfo bean.

So, my value binding expressions look something like this: value="#{pzInfo.someProperty}"

Here is my problem, in pzInfo, I have several method calls that create instances of about 45 other Java classess that I am using to store arrays that populate the h:dataTables in my results.jsp. If I add a managed bean to my faces-config.xml using one of the names of those 45 java classes, and for example use a value binding expression of: value="#{javaClassOne.someProperty}", nothing is output to the page, even though using System.out.println statements in those java classes are showing that the bean values are populated.

I don't understand why I can't reference properties of more than one managed bean in my results.jsp. I must have something setup wrong, but I don't know where to look. Those 45 java classes have a public no arg constructor, and a public String [] constructor that I use to pass arrays into those classes from pzInfo.

The way I am able to output data from those 45 java classes is by creating public getter methods that represent array class types of those 45 over which the h:dataTables iterate. I can't directly access getter methods from those 45 java classes?

I have what seems like alot of lines of code just for getting each field property of those 45 classes in pzInfo and it seems like this should be easier, but I really don't know.

I would appreciate any advice.

Thanks,

Leo
 
leo donahue
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found an article that sort of answers my question.

The article

On slide #23, it shows how to use a utility method to return an instance of the other backing bean that you then use to get access to the other bean properties.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic