When this event (onkeyup) is triggered, the method searchingClients is not called on the adminiEvent bean.
<b:inputText placeholder="nome" required="true" id="name"
value="#{adminiEvent.clientOnSearch.firstName}"
onkeyup="#{adminiEvent.searchingClients}" update=":adminiForm:clientSearchTable"
style="background: rgb(251, 251, 251) none repeat scroll 0% 0%;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);"
/>
any idea ?
Here's the bean:
@ManagedBean(name="adminiEvent" , eager=true)
@ViewScoped
public class AdminiEvent {
...
public void searchingClients(){
List<Client> values = new ArrayList<Client>();
//build query
Map<String,Object> queryValues = new HashMap<String,Object>();
StringBuilder query = new StringBuilder();
query.append("Select c from Client c where ");
if(!StringUtils.isEmpty(clientOnSearch.getFirstName())){
query.append("c.firstName = :firstname");
queryValues.put("firstname", clientOnSearch.getFirstName());
}
if(!queryValues.isEmpty()){
values.addAll(clientService.findClientByFilter(query.toString(),queryValues));
}
clients.addAll(values);
}
...
Thanks
Here few more tests I made:
onkeyup="alert('test');ajax:adminiEvent.searchingClients;javascript:alert('test 2');"
value="#{adminiEvent.clientOnSearch.firstName}"
style="background: rgb(251, 251, 251) none repeat scroll 0% 0%;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);"/>`
It runs well the first and second alert, but the searchingClients is not called. I am on debug mode in server side and I got nothing there. Also there is nothing displayed on the browser debug console or on the server console.
sreenshot of the html generated:
Thanks