2016-10-15 8 views
1

CommandLink는과 아이콘을 표시하는 방법 :아이콘 표시 : CommandLink는

<p:commandLink 
     styleClass="ui-icon ui-icon-plus" 
     action="#{bean.doSomething}"  > 

     <h:outputText value="Add" /> 
</p:commandLink> 

이 outputText는 (추가) 표시되지 않습니다. commandLink가 아이콘을 지원하는 올바른 방법은 무엇입니까? 감사.

답변

1

당신은 styleClass를 제거하고 텍스트와 graphicImage을 사용해야합니다

<p:commandLink > 
    <h:graphicImage value="resources/images/add.png" title="add" > 
     add 
    </h:graphicImage> 
</p:commandLink> 
2
<p:commandLink action="#{bean.doSomething}"> 
    <h:outputText value="Add" class="ui-icon ui-icon-plus"/> </p:commandLink> 
+0

이 질문에 대한 답변을 제공하지 않습니다. 충분한 [평판] (https://stackoverflow.com/help/whats-reputation)이 있으면 [모든 게시물에 주석 달기] (https://stackoverflow.com/help/privileges/comment) 할 수 있습니다. 대신, [질문자의 설명이 필요없는 답변을 제공하십시오] (https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can- i-do- 대신). - [From Review] (리뷰/저품절 게시물/16787473) –