I have multiple <h:inputtext>
and an ajax in each.
As I change each input the setter is called along with a @PostContruct
i created for testing. Why is the bean being recreated ever time i change and input?
<h:form>
<h:outputLabel value="Lunch"/><br/>
<h:inputText id="item0" value="#{bean.item0}" >
<f:ajax execute="@this"/>
</h:inputText><br/>
<h:inputText id="item1" value="#{bean.item1}">
<f:ajax execute="@this"/>
</h:inputText><br/>
<h:inputText id="item2" value="#{bean.item2}">
<f:ajax execute="@this"/>
</h:inputText><br/>
</h:form>
I have the Bean class as well as getters and setters for each.
@Named(value = "bean")
@ViewScoped
public class Bean {
String item0, item1, item2;
public Bean(){}
//Getters/Setters
....