rich:dataGrid边界发出富面孔4 [英] rich:dataGrid borders issue rich faces 4

查看:73
本文介绍了rich:dataGrid边界发出富面孔4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在从jsf 1.2升级到jsf 2. 我们正在使用Apache Myfaces 2.1和Rich Faces 4.3.

We are upgrading from jsf 1.2 to jsf 2. We are using apache myfaces 2.1 and rich faces 4.3.

问题是我无法在<rich:dataGrid>组件周围获得边界. 我看到过描述如何删除边框的帖子,但没有人指定如何获取边框. 似乎默认情况下会早渲染边框(使用富面孔3时会出现),但升级到富面孔4后,则不会渲染 默认情况下. 以下是xhtml代码段.

The issue is i am not able to get borders around <rich:dataGrid> component. I have seen posts describing how to remove the borders but no one specifies how to get borders. It seems that borders are by default rendered earlier (they were coming when rich faces 3 is used ) but after upgrading to rich faces 4 , ther are not rendered by default. Following is the xhtml snippet.

<rich:dataGrid value="#{bean.getListValues}"  var="value" columns="1" rowKeyVar="index" id="qsns"
style="border-bottom-width:10px;">


        <h:panelGrid id="qsn#{index+1}"  border="10" columns="2">

                   <h:outputText value="qsn #{index+1}"/>
                   <h:selectOneMenu value="#{value.qsn}">
                 <f:selectItems value="#{bean.qsnPool}" />
                </h:selectOneMenu> 


                <h:outputText value="Answer"/>                                            
                    <h:inputText value="#{value.answer}"/>


        </h:panelGrid>  


</rich:dataGrid>

我还尝试在上面的代码段中明确为panelGrid(border ="10")设置边框.
并传递到rich:dataGrid(边框底部宽度:10像素),但是它无法按照url中指定的网址工作:

I also tried setting borders explicitely for panelGrid (border="10") in above snippet.
and to rich:dataGrid (border-bottom-width:10px), but it is not working as specified in url according to url : http://docs.jboss.org/richfaces/latest_4_2_X/Component_Reference/en-US/html/chap-Component_Reference-Tables_and_grids.html#sect-Component_Reference-Tables_and_grids-richlist

任何人都可以帮忙吗?

推荐答案

我可以通过以下更改来获得所需的行为

I am able to get the desired behavoiur by following changes

.tableClass1 .rf-dg-c{   
      border: 1px solid #000;
}
table.tableClass1.rf-dg{     
     border-collapse:collapse;
}


<rich:dataGrid value="#{bean.getListValues}"  var="value" columns="1" rowKeyVar="index" id="qsns"
styleClass="tableClass1">

        <h:panelGrid id="qsn#{index+1}"  border="10" columns="2">

                 <h:outputText value="qsn #{index+1}"/>
                 <h:selectOneMenu value="#{value.qsn}">
                    <f:selectItems value="#{bean.qsnPool}" />
                 </h:selectOneMenu> 


                 <h:outputText value="Answer"/>                                            
                 <h:inputText value="#{value.answer}"/>


        </h:panelGrid>  

</rich:dataGrid>

使用上述样式类和xhtml代码,可以完美呈现边框.

With above style classes and xhtml code , borders are perfectly rendered.

第一个样式表呈现网格单元格的边框,第二个样式表折叠 相邻单元格边界之间的间隔(因为cellspacing属性不适用于rich:dataGrid)

First style sheet renders borders for grid cells and second style sheet collapses the space between adjacent cell borders (since cellspacing attribute doesn't work for rich:dataGrid)

上述选择器仅适用于本地<rich:dataGrid>,这意味着不会对所有<rich:dataTables>

The above selectors apply only to local <rich:dataGrid> , that means not affecting globally for all <rich:dataTables>

这篇关于rich:dataGrid边界发出富面孔4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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