我必须通过N否。参数的一个javascript方法。那个N没有参数shoule传递给我的bean类。代码是这样的:
<a4j:jsFunction name="setParamForAutoSuggestion">
<a4j:param name="param1" assignTo="#{genericSuggestionBackBean.dependentParam[0]}" />
<a4j:param name="param2" assignTo="#{genericSuggestionBackBean.dependentParam[1]}" />
<a4j:param name="param3" assignTo="#{genericSuggestionBackBean.dependentParam[2]}" />
</a4j:jsFunction>
其中dependentParam
是我的Bean类中的ArrayList。
问题是,数据没有传递给bean类以及如何在a4j:jsFunction中使用循环,以便将数据设置为与参数大小相关的bean。
我的被叫部分可以是:
<rich:autocomplete mode="ajax" minChars="2" var="message" fetchValue="#{message.displayName}"
autocompleteMethod="#{genericSuggestionControlAction.suggestionAction}"
onfocus="setParamForAutoSuggestion('Param1')">
//OR
<rich:autocomplete mode="ajax" minChars="2" var="message" fetchValue="#{message.displayName}"
autocompleteMethod="#{genericSuggestionControlAction.suggestionAction}"
onfocus="setParamForAutoSuggestion('Param1','Param2')">
//OR
<rich:autocomplete mode="ajax" minChars="2" var="message" fetchValue="#{message.displayName}"
autocompleteMethod="#{genericSuggestionControlAction.suggestionAction}"
onfocus="setParamForAutoSuggestion('Param1','Param2',....'Param N')">