I have a jsf page where I have this form :
<h:commandButton id="submit" value="Submit">
<h:inputText id="locationInputId" value="#{historicCtrl.historic.search}" ></h:inputText>
<f:ajax event="click" render="resultGroup" listener="#{cSVobjectCtrl.doRender}"/>
<label for="lat">Latitude</label>
<h:inputText id="lat" value="#{cSVobjectCtrl.lat}"/>
<label for ="lng">Longitude</label>
<h:inputText id="lng" value="#{cSVobjectCtrl.lng}"/>
<f:actionListener binding="#{historicCtrl.insertSearch(2)}"/>
</h:commandButton >
The problem is that the line :
< f:actionListener binding="#{historicCtrl.insertSearch(2)}"/>
Is ignored and I don't know why.
I tried a easier version of the code :
<h:form>
<h:outputText value="Lieu"/>
<h:inputText id="login" value="#{historicCtrl.historic.search}" required="true"></h:inputText>
<br/>
<h:commandButton value="Search">
<h:outputText id ="textToInsertId" value="#{historicCtrl.insertSearch(2)}"/>
</h:commandButton>
</h:form>
This one is working, I can see the trace that the method is supposed to print on the console and I have the insertion in my database.
On the opposite the first code that I wrote in the message isn't working as expected. Indeed, all is working naturally except the f;actionListener as I explain above.
Why is this instruction ingnored ?