将styleClass应用于datatable列上的inputText时的问题 [英] Issues in applying styleClass to inputText placed on column of datatable

查看:55
本文介绍了将styleClass应用于datatable列上的inputText时的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CSS:

.sample {
   background: red;
}

XHTML

<p:inputText id="inputTxtOnForm" value="hi" styleClass="sample"/>

<p:column id="articleDescription" headerText="Article Description"
               filterBy="#{article.description}" filterMatchMode="startsWith">
               <p:inputText id="inputTxtOnDataTable" value="#{article.description}"
                  styleClass="sample" />
 </p:column>

inputTxtOnForm直接放置在表单上. inputTxtOnDataTable放在数据表的列上.

inputTxtOnForm is placed on a form directly. inputTxtOnDataTable is placed on a column of a datatable.

正在应用具有id="inputTxtOnForm"inputText上的styleClass.但是,styleClass不会应用于具有id="inputTxtOnDataTable"inputText.在后一种情况下,primefaces的themes.css属性不会被覆盖.

The styleClass on the inputText having id="inputTxtOnForm" is getting applied. But, styleClass is not getting applied on the inputText having id="inputTxtOnDataTable". The properties of primefaces' themes.css are not getting over-ridden in the latter case.

这是一个已知的错误吗?有没有解决的办法.

Is it a known bug ? Is there any workaround for the same.

推荐答案

.sample {
   background: red  !important;
}

为我工作.可能在primefaces的css中将背景标记为重要.

worked for me. Probably, the background is marked as important in primefaces' css.

这篇关于将styleClass应用于datatable列上的inputText时的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆