Now, what I want to do is, on click of a radio button, I want to enable/disable the corersponding textarea's.
In the custom listener I'm unable to get hold of the TextArea object that I want to control.
I tried FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(event.getComponent().getId + "TextArea"); //this should translate to "Declaration1TextArea" for the first radio button group and so on....
Can anyone help or give ideas on how to access the UI Components in this listener class.
Any time you resort to javax.faces classes for anything other than datamodels, there's a strong possibility you're doing things the hard way.
I'm going to assume that you want partial page updating where the radio button enables/disables the textarea without actually re-rendering the entire page.
Which AJAX framework you use it up to you. Here's how it would look in RichFaces, however (more or less).
The client-side code looks like this:
Note the complete absence of JSF-specific code. It's all done with POJO stuff.
Note also, however, that this particular example doesn't do the full enable/disable, but that's because of UI concerns. A Radio button isn't a boolean control, so you can't click-on/click-off. For that you should use a checkbox. You can have 2 radio buttons and enable/disable based on which one of them is clicked, however.
Customer surveys are for companies who didn't pay proper attention to begin with.