我正在尝试使 ap:commandLink 在 primefaces mobile 中的 ap:dataList 中工作。
在此代码段中,commandButton 进入方法内部并重定向到不同的视图,但 commandLink 没有。为什么是这样?
<pm:content id="resultsContent">
<h:form id="resultsForm">
<p:dataList type="inset" id="studyList" value="#{navigationBean.studies}" var="study">
<p:commandLink action="{navigationBean.individualStudy}" update=":studyView">#{study.styRefNum} - #{study.shortDesc}</p:commandLink>
<p:commandButton value="#{study.styRefNum} - #{study.shortDesc}" action="#{navigationBean.individualStudy}" update=":studyView" />
</p:dataList>
</h:form>
</pm:content>
@ManagedBean
@ViewScoped
public class NavigationBean {
public String individualStudy() {
System.out.println("in individualStudy");
return "pm:studyView?transition=slide";
}
}