풍부한 제안을 구축하려고하는데 입력 값이 null 인 이유를 이해하지 못합니다. 무언가를 입력 할 때 inputText 값이 사용되지 않는 이유는 무엇입니까?제안 사항 - 왜 입력이 null입니까? (솔기 프레임 워크)
.xhtml 코드 :
<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>
액션 클래스
:@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;
}
} 그래서
, 입력이 널 (null) beeing는, suggestionList 항상 ... 입력의 값이 비어 왜 게시되지 않았습니까?
불행히도, 아닙니다. 메소드 이름은 디버그 모드에서 메소드가 성공적으로 "catched"되었으므로 괜찮습니다. –