Behavior CSS selector in p:dataTable !

UI Components for JSF
Post Reply
User avatar
neijunior
Posts: 74
Joined: 15 Jul 2010, 04:46
Location: São Paulo - Brasil

26 Oct 2010, 21:10

Hello !

Consider the following example:

Code: Select all

<p:dataTable id="dtbCars"
             widgetVar="wgvDtbCar"
             value="#{mbTest.listCars}"
             var="car"
             selection="#{mbTest.car}"
             selectionMode="single">

    <f:facet name="header">
        <table>
            <tbody>
                <tr>
                    <td style="text-align: left;">
                        <h:outputText value="List Cars"/>
                    </td>
                    <td style="text-align: right;">
                        <h:panelGroup>
                            <h:outputText value="Filter"/>
                            <h:inputText id="globalFilter"
                                         onkeyup="wgvDtbCar.filter()"
                                         style="width:250px"/>
                        </h:panelGroup>
                    </td>
                </tr>
            </tbody>
        </table>
    </f:facet>

    <p:column headerText="Car"
                    filterBy="#{car}">
        <h:outputText value="#{car}"/>
    </p:column>

</p:dataTable>
Within the "f:facet name=header " i created a "table" to be able to put a text in left and the input filter on the right.
But when a "p:dataTable" with this option "selectionMode=single", the "table" of "facet" assumes the same of CSS of the "p:dataTable" PrimeFaces. It is as if it were possible to select the facet.

This would be a problem :?:
Mojarra 2.2.x, Facelets, Glassfish V4.1, Primefaces 5.1, Eclipse Mars 1, JPA 2, EJB 3

Nei Alcantara Jr.
http://twitter.com/NeiAlcantaraJr

User avatar
neijunior
Posts: 74
Joined: 15 Jul 2010, 04:46
Location: São Paulo - Brasil

29 Oct 2010, 20:22

Is this a problem :?:
Mojarra 2.2.x, Facelets, Glassfish V4.1, Primefaces 5.1, Eclipse Mars 1, JPA 2, EJB 3

Nei Alcantara Jr.
http://twitter.com/NeiAlcantaraJr

User avatar
bumble.bee
Posts: 723
Joined: 29 Sep 2010, 21:39
Location: United States

29 Oct 2010, 20:54

Sounds like the cascading part of cascading style sheets is at work.

You probably want to override the styles by adding more specific selectors and possibly using the !important thingy (it's a technical term :) ).

User avatar
neijunior
Posts: 74
Joined: 15 Jul 2010, 04:46
Location: São Paulo - Brasil

30 Oct 2010, 13:31

Hello bumble.bee

Sorry, but I did not understand his answer. :?

Briefly I want that the "table" that I put in the "facet" not get the css "p:datatable". How do I do this :?:
In my opinion the correct thing to "table" not inherit the css of the "p:datatable".
Mojarra 2.2.x, Facelets, Glassfish V4.1, Primefaces 5.1, Eclipse Mars 1, JPA 2, EJB 3

Nei Alcantara Jr.
http://twitter.com/NeiAlcantaraJr

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

30 Oct 2010, 13:39

Any subtable placed in p:dataTable will inherit styles from p:dataTable, if you think this doesn't make sense, we can improve it, why not.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

30 Oct 2010, 14:02

For 2.3, though, I don't want to change these before 2.2. release.

User avatar
neijunior
Posts: 74
Joined: 15 Jul 2010, 04:46
Location: São Paulo - Brasil

30 Oct 2010, 14:20

Hello Optimus.prime.

Thanks for the reply.

Just to make an example of what happens, here's a screenshot of the table.

Image


As for improvement, I must open the issue?

Thanks.
Mojarra 2.2.x, Facelets, Glassfish V4.1, Primefaces 5.1, Eclipse Mars 1, JPA 2, EJB 3

Nei Alcantara Jr.
http://twitter.com/NeiAlcantaraJr

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

30 Oct 2010, 14:58

No, we haven't decided what to do so an issue is not needed at the moment. I think you need to play with css not to inherit stuff from p:dataTable to solve your issue. Firebug can help.

User avatar
neijunior
Posts: 74
Joined: 15 Jul 2010, 04:46
Location: São Paulo - Brasil

30 Oct 2010, 15:10

Ok

Thanks.

:)
Mojarra 2.2.x, Facelets, Glassfish V4.1, Primefaces 5.1, Eclipse Mars 1, JPA 2, EJB 3

Nei Alcantara Jr.
http://twitter.com/NeiAlcantaraJr

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 24 guests