How to remove the border in p:dataList

UI Components for JSF
Post Reply
theodor.richard
Posts: 25
Joined: 15 Jul 2010, 09:23

07 Oct 2010, 12:07

Hi,

is it possible to remove the border in the p:datalist component.

Thanks,
Theo
PrimeFaces 5.2, PrimeFaces Extensions 3.2, OmniFaces 2.1, Glassfish v4.1, Mojarra 2.2.12

Daedin
Posts: 25
Joined: 04 Dec 2010, 13:24

08 Dec 2010, 18:03

Has this been answered somewhere? I googled for it, but could not find any hint.
Sébastien

JavaServer Faces 2.0
Primefaces 2.2 RC2
Tomcat 7.0

Flash
Posts: 1
Joined: 18 Oct 2010, 23:12

09 Dec 2010, 00:23

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.

Daedin
Posts: 25
Joined: 04 Dec 2010, 13:24

09 Dec 2010, 23:12

This works perfectly! Thanks again for your quick response
Sébastien

JavaServer Faces 2.0
Primefaces 2.2 RC2
Tomcat 7.0

bhiles
Posts: 4
Joined: 15 Dec 2010, 05:49

22 Dec 2010, 04:36

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

jendruch
Posts: 2
Joined: 04 Jun 2011, 11:08

17 Jun 2011, 23:58

yet another css style solution (quite good in my opinion;)

- css:

.dataList .ui-datalist-data{
border: none;
background: transparent;
background-image: none;
}

- xhtml:

<p:dataList value="#{dlRows}" var="dlRow" styleClass="dataList">

etapia
Posts: 9
Joined: 02 Apr 2013, 05:36

02 Apr 2013, 05:38

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. :shock:

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

david.chacon
Posts: 17
Joined: 23 Jun 2011, 23:33

20 Sep 2016, 00:44

Use ui:repeat instead :lol:
David Andrade B
Oracle Certified

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 35 guests