2

I have a <p:column> with a filter. I would like to show it with a watermark. This is what I have tried:

<p:column id="carType" filterBy="#{car.carType}" >
    <h:outputText value="#{car.carType}" />
    <p:watermark forElement="carType"
                 value="Car Type"/>
</p:column>

However, that didn't show up. How can I achieve this?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

2 Answers2

2

Try this

     <h:form id="parametersListForm">      

    <p:dataTable id="parameteresList" value="#{parameterController.lstParameter}"
                 var="parameters" styleClass="tnt-main-table"> 

    <p:column id="columnRefType" filterBy="#{parameters.beRefType}" >
        <h:outputText value="#{parameters.beRefType}" />
        <p:watermark forElement="parametersListForm:parameteresList:columnRefType:filter"
                     value="#{msgs['parameters.beRefType.label']}"/>  
        </p:column>
     </p:dataTable>              
</h:form>

Also see this

Community
  • 1
  • 1
Venkat Maridu
  • 892
  • 3
  • 22
  • 45
0

I've got the same problem, and after reading about p:watermark I've decided I don't prefer to give the full path to the filter. I've added the following snippet under the p:dataTable definition instead:

<script type="text/javascript">
    $('input.ui-column-filter').attr('placeholder','#{msgs['filter_placeholder']}"');
</script>

Of course, it will enrich ALL column filters in ALL tables, but you can always append data table id to the query...

Danubian Sailor
  • 1
  • 38
  • 145
  • 223