sugggestionbox don't work
arielfernando Jan 12, 2008 8:20 AMHi all,
I'm having problems using rich:suggestionbox. I try to put this component in my application, but it doesn't work.
My enviroment:
Richfaces 3.1.3-GA
jsf-1.2_05-b06-FCS
Tomahawk 1.1.6
Tomcat 6.0.14
Hibernate...Spring...
Problem description: when I type some chars in an inputText associated to a suggestionbox, nothing happend. No suggestion box, no erros... and the beans method associated to suggestionAction is never excecuted.
This is my test case:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
<f:view>
<f:subview id="idSubView">
<h:form id="form">
<h:outputText value="RAZON SOCIAL"/>
<h:inputText id="idRazonSocial" value="#{altaNotaPedidoVenta.razonSocial}">
<rich:suggestionbox id="idSuggestionBox"
tokens=",["
for="idRazonSocial"
suggestionAction="#{altaNotaPedidoVenta.sugerirRazonSocial}"
var="result"
fetchValue="#{result.nombre}"
minChars="1"
shadowOpacity="4"
border="1"
width="250"
height="150"
shadowDepth="4"
cellpadding="2"
nothingLabel="NOTHING TO SHOW"
rowNumber="5">
<h:column>
<h:outputText value="#{result.nombre}" />
</h:column>
</rich:suggestionbox>
</h:inputText>
</h:form>
</f:subview>
</f:view>
And my managed bean:
public class AltaNotaPedidoVentaBean {
private String razonSocial = new String();
private List<Ciudad> lista;
public AltaNotaPedidoVentaBean() {
lista = new ArrayList<Ciudad>();
Ciudad ciudad1 = new Ciudad();
ciudad1.setNombre("RAZON SOCIAL TESTING");
lista.add(ciudad1);
}
public List<Ciudad> sugerirRazonSocial(Object event){
return lista;
}
public String getRazonSocial() {
return razonSocial;
}
public void setRazonSocial(String razonSocial) {
this.razonSocial = razonSocial;
}
}
Important:
When page is loaded, I can see at Firefox Error Console follows message:
Error: this.element has no properties Source File: http://localhost:8080/Facturacion/a4j_3_1_3.GAorg/richfaces/renderkit/html/scripts/suggestionbox.js.faces Line: 2