August 7, 2012

Accessing components from JSF without binding them

We can access the components and their values of JSF from program without binding them to any attribute of beans or Data Control by using the below statement.

FacesContext.getCurrentInstance().getViewRoot().findComponent(String name);

Where name is the id of the component which needs to be accessed.