Suppose I have two h:inputText components. I want to bind both of the text fields with single property in the backing bean. The problem is that the value submitted to backing bean is that from second text field. I want that the value should be submitted from that field in which user entered the text.
My code:
<h:inputText id="text1" value="#{bean.value}">
......
</h:inputText>
<h:inputText id="text2" value="#{bean.value}">
.......
</h:inputText>
Note that the value in both of the above fiekds is bean.value
add
<f:ajax event="blur"...or<f:ajax event="keyup"...like this
or using js (check your
text1andtext2real ids using viewsource)