【问题标题】:Using <f:convertDateTime> with <h:commandLink>将 <f:convertDateTime> 与 <h:commandLink> 一起使用
【发布时间】:2013-12-13 18:06:23
【问题描述】:

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

<h:outputText value="#{bean.calendar.time}">
    <f:convertDateTime type="both" dateStyle="long" />
</h:outputText>

如何与 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>

【问题讨论】:

    标签: jsf datetime commandlink


    【解决方案1】:

    &lt;h:outputText&gt; 放入&lt;h:commandLink&gt;

    <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>
    

    【讨论】:

    • 完美运行!我没想到,我可以在 <:hcommandlink> 中使用
    猜你喜欢
    • 1970-01-01
    • 2012-04-13
    • 1970-01-01
    • 2015-06-04
    • 1970-01-01
    • 2012-03-28
    • 2016-03-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多