Code: Select all
<h:inputText value="#{test.naam}" valueChangeListener="#{test.change}" >
<f:ajax event="[b]focus[/b]" listener="#{test.ajax1}" />
<f:ajax event="[b]change[/b]" listener="#{test.ajax2}" />
</h:inputText>
<br/><br/>
<h:inputText value="#{test.naam}" valueChangeListener="#{test.change}" >
<p:ajax event="[b]focus[/b]" listener="#{test.ajax1}" />
<p:ajax event="[b]change[/b]" listener="#{test.ajax2}" />
</h:inputText>
<br/><br/>
<p:inputText value="#{test.naam}" valueChangeListener="#{test.change}" >
<f:ajax event="[b]focus[/b]" listener="#{test.ajax1}" />
<f:ajax event="[b]change[/b]" listener="#{test.ajax2}" />
</p:inputText>
<br/><br/>
<p:inputText value="#{test.naam}" valueChangeListener="#{test.change}" >
<p:ajax event="[b]focus[/b]" listener="#{test.ajax1}" />
<p:ajax event="[b]chang[/b]e" listener="#{test.ajax2}" />
</p:inputText>
1) If I enter the field the onfocus listener fires only.
2) If I change the field the and then leave it, the onchange triggers fires only.
In the situations where I use a <p:inputText> only the onchange trigger fires.
I have got two questions:
1) Is JSF ment to differentiatie to different listeners on different events or is it sheer luck that it is working?
2) Why does is not work with <p:inutText>?
I try to make a master-detail screen with a multi-record master and a multierecord detail. Once the the record in the master get the focus I want to show the detail records belonging to that master record. I also need the respond on changes. So that's why I want to responds differentely to different events. I am using textInput fields and that does not work together with the rowSelectListener. I use textInput fields while I think that incell editing with the toggling of the rowEditor is clumsy and not a real good solution for a data entry screen. With the above "trick" to diffentiate between events I was able to build some kind of master-detail screen, but still I feell that I need a lot of tricks to get the Primefaces dataTable to do what I want.
Has somebody experience with mast-detail screens with textInputFields?
Could the dataTable be enhanced so that if you have textInputFields, the event like the rowSelectListener and so are working?