2013-04-16 1 views
0

Je veux colorer une partie de la valeur a4j:commandLink texte
Par exemple Ma vue cible
enter image description hereComment colorer une partie de la valeur de texte a4j: commandLink?

J'utilise ce code

<a4j:commandLink value="My Link &lt;span style='color:red;'&gt;*&lt;/span&gt;"       
    action="#{MyController.sort}">       
</a4j:commandLink> 

Mais j'ai que (vue indésirable)
enter image description here

Remarque
Avec h:outputText qui ont escape propriété
La valeur texte sera colorée

Par exemple
Ce code

<h:outputText value="My Text &lt;span style='color:red;'&gt;*&lt;/span&gt;" 
escape="false"/> 

Produira ce point de vue
enter image description here

Répondre

1

Juste nid votre élément <span> dans votre tag <a4j:commandLink> au lieu d'utiliser l'attribut value. Utilisez-le comme ceci:

<a4j:commandLink ...> 
    <span>Plain text 
     <span class='red'>*</span> 
    </span> 
</a4j:commandLink> 
Questions connexes