2010-06-08 2 views
0

조건에 따라 풍부한 패널 내에서 일부 <h:inputText> 컨트롤의 배경색을 변경해야합니다. 이것은 이러한 컨트롤을 읽기 전용으로 구분하기위한 것입니다. styleClassstyle 속성을 사용해 보았지만 두 가지 모두 작동하지 않았습니다. styleClass은 무시되며 스타일 색상은 텍스트 상자의 절반에 불과합니다.풍부한 내부 h : inputText 컨트롤의 배경색을 변경하는 방법 :

1) styleClass 코드 :

.readonlycontrol 
{ 
    background-color: #C0C0C0; 
} 

.xhtml 페이지에서 :

<rich:panel styleClass="inputpanel"> 
    <f:facet name="header" > 
    <h:outputText value= "#{cardreqmsg.apptinfo}"/> 
    </f:facet> 
    <h:panelGrid columns="4" cellpadding="2" border="0"> 
    <h:inputText id ="name" styleClass="readonlycontrol" readonly="true"/> 
    ......... 

2) 스타일 코드 :

<h:inputText id ="name" readonly="true" style="background-color:#C0C0C0"/> 

어떤 도움이 될 CSS에서

대단히 감사합니다.

답변

1

CSS로이를 수행 할 수 있습니다. 다음과 같음 :

#name input[readonly] { 
    background-color: #C0C0C0; 
} 
+0

그것은 매력처럼 작동했습니다. 고마워. – kiransri

관련 문제