rich suggestions - why input is null? (seam framework)
- by Cristian Boariu
Hi,
I'm trying to build a rich suggestions and i do not understand WHY the input value is null...
I mean, why inputText value is not taken when i enter something.
The .xhtml code:
<h:inputText value="#{suggestion.input}" id="text">
</h:inputText>
<rich:suggestionbox id="suggestionBoxId" for="text" tokens=",[]"
                    suggestionAction="#{suggestion.getSimilarSpacePaths()}" var="result"
                    fetchValue="#{result.path}"
                    first="0"
                    minChars="2"
                    nothingLabel="No similar space paths found"
                    columnClasses="center"
        >
    <h:column>
        <h:outputText value="#{result.path}" style="font-style:italic"/>
    </h:column>
</rich:suggestionbox>
and action class:
@Name("suggestion")
@Scope(ScopeType.CONVERSATION)
public class Suggestion {
@In
protected EntityManager entityManager;
private String input;
public String getInput() {
    return input;
}
public void setInput(final String input) {
    this.input = input;
}
public List<Space> getSimilarSpacePaths() {
    List<Space> suggestionsList = new ArrayList<Space>();
    if (!StringUtils.isEmpty(input) && !input.equals("/")) {
        final Query query = entityManager.createNamedQuery("SpaceByPathLike");
        query.setParameter("path", input + '%');
        suggestionsList = (List<Space>) query.getResultList();
    }
    return suggestionsList;
}
}
So, input beeing null, suggestionList is always empty...
Why input's value is not posted?