I want to write a code in this way, that If I click on a button a data table appears populated with data. before that there should not be the data table in view.
You can initialize a simple getter/setter :
private boolean visible = false; // getter/setter
public void getUserList(ActionEvent event)
{
setVisible(true);
// Your code
}
And modify your view like this :
Note the update
attribute on button, h:panelGroup
wrapper and rendered
attribute on table.