This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSF and the fly likes How to change attribute of a component? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to change attribute of a component?" Watch "How to change attribute of a component?" New topic
Author

How to change attribute of a component?

Dmitriy Kastikovich
Greenhorn

Joined: Jun 29, 2008
Posts: 23
Hi!

For example, I want to disable entering date in calendar for user until he not selected it. Then he can edit.

I use to disable input. But then
I want to enable manual date editing.

I remember that I can use [''], but cant remeber it. And I dont wont to use server side for this.
As a solution i can create second calendar with enabled manual input and show it after date was setted....
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Just let the attribute depend from a bean property or so?

Dmitriy Kastikovich
Greenhorn

Joined: Jun 29, 2008
Posts: 23
Bauke Scholtz wrote:Just let the attribute depend from a bean property or so?



I think, you didnt understand me - I dont want to use server side for changing attribute. And if I understand a dependency on bean will use server.
So the question was, how to change it on client side. Or it is not possible as the page has been already rendered with all components?
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
I understood you perfectly. You just don´t understand how JSF works. The server side must be notified of the component´s state at any way. As you´re using Ajax4jsf, you can just rerender the component without having a "flash of content" (if that is where your aversion against the "server side" is based on).
 
wood burning stoves
 
subject: How to change attribute of a component?