Hi,
is it possible to remove the border in the p:datalist component.
Thanks,
Theo
How to remove the border in p:dataList
-
- Posts: 25
- Joined: 15 Jul 2010, 09:23
PrimeFaces 5.2, PrimeFaces Extensions 3.2, OmniFaces 2.1, Glassfish v4.1, Mojarra 2.2.12
I think so. You have to override the CSS class.
For example: supose you have this code:
<p:dataList value="#{tableBean.carsSmall}" var="car" itemType="disc">
#{car.manufacturer}, #{car.year}
</p:dataList>
You would add the following:
<style type="text/css">
.datalist-noborder .ui-widget-content {
border: none;
}
</style>
<div class="datalist-noborder">
<p:dataList value="#{tableBean.carsSmall}" var="car" itemType="disc">
#{car.manufacturer}, #{car.year}
</p:dataList>
</div>
This way the new CSS class "datalist-noborder" overrides the settings of CSS class "ui-widget-content", but only within the nested context, leaving the rest untouched. I would recomment a tool like Firebug to see how the underpinnings of all this CSS stuff adds together.
Hope this helps.
For example: supose you have this code:
<p:dataList value="#{tableBean.carsSmall}" var="car" itemType="disc">
#{car.manufacturer}, #{car.year}
</p:dataList>
You would add the following:
<style type="text/css">
.datalist-noborder .ui-widget-content {
border: none;
}
</style>
<div class="datalist-noborder">
<p:dataList value="#{tableBean.carsSmall}" var="car" itemType="disc">
#{car.manufacturer}, #{car.year}
</p:dataList>
</div>
This way the new CSS class "datalist-noborder" overrides the settings of CSS class "ui-widget-content", but only within the nested context, leaving the rest untouched. I would recomment a tool like Firebug to see how the underpinnings of all this CSS stuff adds together.
Hope this helps.
That works for a solution, but I'm not sure I like that it is there by default and I need special CSS rules to remove it. It should be absent by default and be able to be added by stylesheet. Can this be addressed?
Primefaces 2.2 RC2, Glassfish 3.1-b32, JSF 2.0
I'm using bootstrap theme and PF 3.5.2 and the above solution didn't work. After investigating with Firebug I found the following solution.
Code: Select all
.ui-widget-content .ui-datalist-content{
border: none;
background: transparent;
background-image: none;
}
PrimeFaces 3.5.8 | Glassfish 3.1.2.2 | Mojarra 2.1
Centos 6.3, Firefox 20.0
Centos 6.3, Firefox 20.0
-
- Posts: 17
- Joined: 23 Jun 2011, 23:33
Use ui:repeat instead
David Andrade B
Oracle Certified
Oracle Certified
-
- Information
-
Who is online
Users browsing this forum: No registered users and 35 guests