我正在嘗試使用rich:suggestionbox
。我瀏覽了Richfaces提供的教程。重要的是我正在使用Richfaces 3.1.4 JAR。在建議框中,我只是試圖在開始時填充一些默認數據,但建議框根本沒有渲染。當我嘗試看看在Firefox錯誤控制檯,顯示以下錯誤消息:rich:suggestionbox錯誤 - 此元素爲空
Error: this.element is null Source File: http://localhost:9080/sample/a4j_3_1_4.GAorg/richfaces/renderkit/html/scripts/suggestionbox.js.faces Line: 2
JSF CODE
<a4j:region selfRendered="true" id="region1">
<h:inputText id="fx" />
<rich:suggestionbox width="50" height="50" for="fx" nothingLabel="HI"
suggestionAction="#{basic.inputData}" fetchValue="#{basic.selectedData}"
var="result" id="suggestion">
<h:column>
<h:outputText value="#{result.value}" />
</h:column>
</rich:suggestionbox>
<h:commandButton id="submit" value="show data"
action="#{basic.submit}"></h:commandButton>
</a4j:region>
Managed Bean的
enter code here
private List<SelectedList> inputData; // Setter
private String selectedData; // Getter and Setter
public List<SelectedList> getInputData() { //Getter
if(inputData!=null){
inputData = new ArrayList<SelectedList>();
inputData.add(new SelectedList("1","equal"));
inputData.add(new SelectedList("2","not equal"));
inputData.add(new SelectedList("3","greater"));
inputData.add(new SelectedList("4","lesser"));
}
return inputData;
}
請幫助,如果你願意。
的例子嗎? – Dejell 2010-08-18 14:52:57
我正在使用JSF 1.1。 – Hariharbalaji 2010-08-18 15:14:17