Good morning! Help solve the problem, pozhst. Event ajax code:
<h:form> <h:panelGroup class="form-group col-lg-8"> <label for="usr">Поиск:</label> <h:inputText class="form-control" id="searchParam" value="#{searchBeen.serchInput}" > </h:inputText> </h:panelGroup> <h:panelGroup class="form-group col-lg-3"> <label for="sel1">Поиск по:</label> <select class="form-control" id="sel1"> <option>Название</option> <option>Автор</option> </select> </h:panelGroup> <h:commandButton class="btn btn-default col-lg-1" style="margin-top: 23px;" value="Найти"> <f:ajax event="click" render=":booksContent" listener="#{booksList.formArrayListBySearch(searchBeen.serchInput)}"/> </h:commandButton> </h:form> Listener code for listener = "# {booksList.formArrayListBySearch (searchBeen.serchInput)}":
public void formArrayListBySearch(String sp){ System.out.println("Отрабатывает функция поиска нужных книг : " + sp); } In the console we get:
Works out the search function for the right books:
Walking box input box filled
booksList.formArrayListBySearch(searchBeen.serchInput). You can do so except#{trader.buy('SOMESTOCK')}. Read: docs.oracle.com/javaee/7/tutorial/jsf-el003.htm#BNAHU - not a ProgrammerFacesContext. Throughnew SearchBeen()it will not work, since you simply create a new object whoseserchInputfield will have a default value. And you also have several syntax errors: 1.SearchBeen- correctlyBean(bin), 2.serchInput- probably wantedsearchInput. Although you may have conceived it =) - not a Programmer