I am noticing that when I use h:commandButton
to call an actionlistener
method from a managedbean, managed beans that are used on current view page, are re-instantiated on their own. Now since my data from those beans was already fetched and added to the view, there is no need to re-instantiate those beans, but JSF does that.
I used the following code to call a method,
<h:commandButton value="Increment" actionListener="#{channelController.increment()}"/>
I found that another managed bean UserChannelsList
is instantiated on its own.. I am not submitting any data to this bean, or using any of its method, neither the view needs to fetch any properties from this bean. Why does JSF instantiates all these beans used in the view, on its own ?
EDIT
It is not due to actionListener
attribute, even if I remove this attribute & just click on the commandButton
then too the managed bean's are instantiated on their own!