我想向我的支持 bean 提交一个键值,以便我知道集合用户中的哪个人试图更新。我想我需要使用 f:param 来这样做,但不知何故它不起作用。如果我使用 af:commandButton 而不是 h:commandButton,它将提交该值。
这是我的按钮:
<h:commandButton styleClass="cntctmBtn" value="Update" action="#{pullForm.updateDependent}">
<f:param name="selectedIndex" value="#{loop.index}" />
<f:param name="selectedEDI" value="#{eachOne.identifier.dodEdiPnId}" />
</h:commandButton>
这就是我试图获取我提交的值的方式。
FacesContext context = FacesContext.getCurrentInstance();
Map map = context.getExternalContext().getRequestParameterMap();
String edi_tmp = (String)map.get("selectedEDI");
但我得到了 ArrayIndexOutOfBound 异常,请帮忙,谢谢。