【发布时间】:2013-12-31 06:43:02
【问题描述】:
我正在尝试从 primefaces 使用,但我遇到了一些奇怪(和“不可见”)的问题。 我正在使用 Spring/Hibernate/Primefaces 这是我的 .xhtml 代码:
<p:autoComplete cache='true' id='autocomplete'
value="#{controller.filter_field_editor}"
completeMethod="#{controller.getAll()}"
dropdown="true" />
'getAll' 函数的代码是这样的:
public List<String> getAll(){
List<HardTag> allhardtags = new ArrayList<HardTag>();
List<String> allhardtags_titles = new ArrayList<String>();
allhardtags = repositoryService.findByCollection("Editors");
for (HardTag hardTag : allhardtags) {
allhardtags_titles.add(hardTag.getTitle());
}
return allhardtags_titles;
}
如果我调试,当我返回 allhardtags_titles 时,这个变量有一个正确的字符串列表,但自动完成输入不显示任何内容。
我的控制台也没有显示任何内容,所以我意识到我有 Web 开发人员工具...但是所有检查(标准/CSS/Jscript)都正常,即使我点击 Jscript,这里也有一个错误。
> Fecha y hora: 12/12/2013 18:38:57
Error: no se encuentra elemento (*can't find element)
Archivo de origen: http://localhost:8080/inbox.xhtml
Línea: 1
如果我点击它,它会显示:
<!DOCTYPE html >
仅此而已……所以我有点迷路了!
如果需要更多,请告诉我!提前致谢!
有人有想法吗?
【问题讨论】:
-
当它应该有一个
String参数时,为什么你在后端使用一个非参数方法? -
嗯,不需要。我按照示例进行,不需要发送参数。
标签: jquery jsf jsf-2 primefaces autocomplete