我正在尝试实现richfaces自动完成组件,我遇到的问题是永远不会调用autocompleteMethod。
<rich:autocomplete id="formacode" styleClass="champ_select310" layout="list"
autocompleteList="#{enregistrementFormationsMBean.toShow}"
autocompleteMethod="#{enregistrementFormationsMBean.autocomplete}"
value="#{enregistrementFormationsMBean.formacode}">
</rich:autocomplete>
MBean:
public String getFormacode() {
return testDto.getFormacode();
}
public void setFormacode(String formacode) {
testDto.setFormacode(formacode);
}
public List<String> getToShow() {
return testDto.getToShow();
}
public void setToShow(List<String> toShow) {
testDto.setToShow(toShow);
}
public List<String> autocomplete(String prefix) {
Map<String, String> map;
List<String> listOfItems = new ArrayList<String>();
try {
map = testFacade.getFormacode(prefix);
for (Entry<String, String> e : map.entrySet()) {
listOfItems.add(e.getValue());
}
} catch (RemoteException | ServiceException e1) {
e1.printStackTrace();
}
setToShow(listOfItems);
return listOfItems;
}
当我调试时,从不调用getter getToShow和函数自动完成。
我正在使用richfaces 4.3.3
ps:在日志中
ERROR [com.liferay.faces.bridge.application.MissingResourceImpl] (http--127.0.0.1-8080-3) Resource handler=[com.liferay.faces.bridge.application.ResourceHandlerOuterImpl@73ceed1] was unable to create a resource for resourceName=[AutocompleteBase.js] libraryName=[org.richfaces.images] contentType=[null]
WARNING [javax.enterprise.resource.webcontainer.jsf.application] (http--127.0.0.1-8080-5) JSF1064 : Impossible de localiser ou de servir une ressource, Autocomplete.js, depuis la bibliothèque org.richfaces.images
谢谢你的帮助!!