从<p:autoComplete>
这是我的xhtml
<p:autoComplete
dropdown="true"
value="#{kabupatenBacking.selectedServiceLocation}"
completeMethod="#{kabupatenBacking.autoComplete}"
var="svl"
itemLabel="#{svl.serviceLocationName}"
itemValue="#{svl.serviceLocationID}">
</p:autoComplete>
这是我的豆子
private KabupatenEntity selectedServiceLocation;
public List<KabupatenEntity> autoComplete(String query)
{
listServiceLocation = kabupatenRules.getServiceLocationByStatus();
List<KabupatenEntity> queried = new ArrayList<KabupatenEntity>();
String output = query.substring(0,1).toUpperCase() + query.substring(1);
for(KabupatenEntity kabupaten : listServiceLocation)
{
if(kabupaten.getServiceLocationName().contains(output))
{
queried.add(kabupaten);
}
}
return queried;
}
问题是我把组件itemValue.autocomplete不起作用
但是当我从<p:autoComplete>
中移除ItemValue时就可以了
但我需要价值,如何才能获得价值?
谢谢