JSF, AJAX und ManagedBeans

xxsteambroxx

Mitglied
Hallo Liebe Java-Freunde,

ich habe auf meiner Website ein inputText in das ich einen Namen eingeben kann und dann auf einen commandButton klicke um die suche zu Starten (BeanName: getGuestBookEntries()).
Synchron dazu muss noch ein Teil der Seite aktualisiert werden! (form:guestBookEntry)

Nun will ich allerdings diese Aktion via Ajax aufrufen lassen ohne jedes mal diesen Button klicken zu müssen.

Mein JSF Code sieht so aus:
<h:inputText id="textFieldUserSearch"> styleClass="text_field" maxlength="256" id="searchField"
value="#{personSearchForm.userSearch}"
<f:ajax event="valueChange"
execute="#{guestBookView.continueList()} #{guestBookView.getGuestBookEntries()}"
render=":guestBookEntry"
/></h:inputText>

Allerdings scheint das nicht so zu funktionieren, das er bei einer Eingabe das macht was ich will.

Wie würdet Ihr das machen

mit Freundlichen Grüßen

SteamBro
 
Probier mal:
HTML:
<h:inputText id="textFieldUserSearch" styleClass="text_field" maxlength="256" id="searchField" value="#{personSearchForm.userSearch}">
  <f:ajax render=":guestBookEntry" />
</h:inputText>
 
Zum execute-Attribut des f:ajax-tags:
Evaluates to Collection<String>. This is a space separated list of client ids of components that will participate in the "execute" portion of the Request Processing Lifecycle. If a literal is specified the ids must be space delimited. Any of the keywords "@this", "@form", "@all", "@none" may be specified in the id list. If not specified, the default value of "@this" is assumed. For example, @this clientIdOne clientIdTwo.

Du möchtest hier wohl eher einen listener verwenden...
 

Zurück
Oben