링크를 사용 (클릭)하면 링크 색상을 변경해야합니다. 조치 메소드와 함께 h : commandLink를 사용하고 있습니다. 다음은 코드 스 니펫입니다.a : visited with h : JSF 1.2의 commandLink
.xhtml 파일 -
<h:commandLink styleClass="changeLinkColor" action="#{bean.actionMethod}">
<span><h:outputText value="UserName"/></span>
</h:commandLink>
.css 파일 -
.changeLinkColor
{
color:#0000FF;
text-decoration:none;
}
.changeLinkColor a:link
{
color:blue;
text-decoration:none;
}
.changeLinkColor a:visited
{
color: black;
}
다음
모든 스타일은 제외하고 제대로 작동이 : 방문했다. 그러나 h : commandLink를 h : outputLink로 변경하면 정상적으로 작동합니다. 그러나 나중에 액션 메서드 속성이 없습니다. 따라서 그것을 사용할 수 없습니다.
h : commandLink 태그를 사용하여 링크 색상을 변경하려면 문제가 있으면 공유하십시오.