将<f:convertDateTime>与<h:commandLink>一起使用

ale*_*der 3 jsf datetime commandlink

我看到BalusC提供的这个例子:

<h:outputText value="#{bean.calendar.time}">
    <f:convertDateTime type="both" dateStyle="long" />
</h:outputText>
Run Code Online (Sandbox Code Playgroud)

怎么用< 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>
Run Code Online (Sandbox Code Playgroud)

Bal*_*usC 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>
Run Code Online (Sandbox Code Playgroud)