如何将参数添加到a4j:commandLink
?检入调试模式时,该参数始终为空。jsf - 从ajax请求中检索参数
网页代码:
<a4j:form>
<a4j:commandLink reRender="content" action="#{surveyEvaluationBean.doDetailEvaluation}">
<f:param name="question" value="#{result.question.pK.longValueAsString}" />
<h:graphicImage url="/survey/img/cloverleaf.jpg" styleClass="srv-analysis-cloverleaf" />
</a4j:commandLink>
</a4j:form>
豆:
HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
String param = request.getParameter("question");
我刚刚发现的错误。 a4j-components
没有问题,错误如下:我无法正确创建问题对象。所以PK是真的无效。我很抱歉浪费你的时间。
什么是'result.question.pk.longValueAsString'? – Ved
'result'是我的a4j:repeat的var名称,'getLongValueAsString()'以字符串值的形式重复pk对象 –