I have a small JSF application where the user is required to enter some data about themselves.
For each component on the page that has required="true" I want to show an icon depending if there is data in the field or not.

My problem is that when the page is initially shown all fields are valid, even if they do not have any data in them.

So my question is how I can set a component to be invalid based on if there is data in the field or not?

After a submit of the page (or after the component loses focus) the icon is shown properly, it is only on the initial page load I have a problem. (i.e there is no post data)

Thanks Bozho I implemented a version where I use a4j:jsFunction to trigger the validation, and that works :) It would have been nice to to have the component state set without having to resort to "submitting" the panel (you can just see the state of the component change when the page is opened), but I can live with this solution.
–
mhylleJun 6 '10 at 6:49