문제

I saw this example provided by BalusC:

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

How is that working with <h:commandLink> ?

I tried:

<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>
도움이 되었습니까?

해결책

Put <h:outputText> inside <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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top