我看到BalusC提供的这个例子:
<h:outputText value="#{bean.calendar.time}">
<f:convertDateTime type="both" dateStyle="long" />
</h:outputText>
如何使用&lt; h:commandLink>
?
我试过了:
<h:commandLink value="#{question.creationDate.time}"
action="#{managerBean.searchQuestion()}">
<f:convertDateTime type="both" dateStyle="short" />
<f:setPropertyActionListener target="#{managerBean.questionID}"
value="#{question.ID}" />
</h:commandLink>
答案 0 :(得分:9)
将<h:outputText>
放入<h:commandLink>
。
<h:commandLink action="#{managerBean.searchQuestion}">
<h:outputText value="#{question.creationDate.time}">
<f:convertDateTime type="both" dateStyle="short" />
</h:outputText>
<f:setPropertyActionListener target="#{managerBean.questionID}" value="#{question.ID}" />
</h:commandLink>