It's not a secret anymore!*
The moose likes JSF and the fly likes disabling and rendering components using private boolean - more elegant solution? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "disabling and rendering components using private boolean - more elegant solution?" Watch "disabling and rendering components using private boolean - more elegant solution?" New topic
Author

disabling and rendering components using private boolean - more elegant solution?

Joe Shannow
Ranch Hand

Joined: Dec 01, 2010
Posts: 35
Hello,

i have a cosmetic problem. I'm using
(+ getters and setters)

for inner logic of application. And in the JSF I'm calling it for rendering or disabling components, for example
And it works. But it seems to me a bit ugly.
Is there some other way to achieve the same functionality?

I'm looking for more elegant solution. Because JSF wants it private + getters and setters, and the other JAVA class wants it private STATIC + get, sets. So I sometimes need to use two booleans for one thing and it makes a bit of mess...

Thank you
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

Ultimately, all the JSF EL is looking for is a public getter or setter named setProduction(value) or getProduction() as members of your backing bean. Yuo can make it static if you need to, or even add a little business logic in those setters or getters if need be.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: disabling and rendering components using private boolean - more elegant solution?
 
Similar Threads
JSF 1.2 Inner Datatable selectBooleanCheckBox - Selected options wrongly reflected in the Bean
using c:forEach to iterate over Map<String, ArrayList<Hashmap>>
Question about Hibernate Inheritance
A LOT of if statements
PropertyKeys