Search code examples
jsforacle-adf

how to show placeholder/watermark in table filter column


show placeholder in it

I have added table from data control on my .jsf page with filterable option enabled. now i can filter data from my table, but i want to show some placeholder like "search here". how can i show placeholder in search column box?

<af:column
    sortProperty="#{bindings.TblProgView12.hints.ProgId.name}"
    filterable="true" sortable="true" headerText="Program ID"
    align="center" id="c1" width="51">
    <af:inputText value="#{row.bindings.ProgId.inputValue}"
        label="#{bindings.TblProgView12.hints.ProgId.label}"
        required="#{bindings.TblProgView12.hints.ProgId.mandatory}"
        columns="#{bindings.TblProgView12.hints.ProgId.displayWidth}"
        maximumLength="#{bindings.TblProgView12.hints.ProgId.precision}"
        shortDesc="#{bindings.TblProgView12.hints.ProgId.tooltip}" id="it1"
        readOnly="true" contentStyle='text-align:center'>
        <f:validator binding="#{row.bindings.ProgId.validator}" />
    </af:inputText>
</af:column>

Solution

  • One way to create a specific search form for your table with a notice and title is to use the af:query component that comes with your iterator.(Drag&Drop your iterator from datacontrol and select query, read more here : https://docs.oracle.com/cd/E15523_01/apirefs.1111/e12419/tagdoc/af_query.html)

    However as you ask specificaly how can i show placeholder in search column box?

    You can add a filter facet to your column to modify the filter component like follow :

    <af:column sortProperty="#{bindings.TblProgView12.hints.ProgId.name}"
           filterable="true" sortable="true"
           headerText="Program ID" align="center"
           id="c1" width="51">
           <f:facet name="filter">
                <af:inputText value="#{vs.filterCriteria.ProgId}" 
                      placeholder="SEARCH HERE" id="id4">
                </af:inputText>
            </f:facet>
        <af:inputText value="#{row.bindings.ProgId.inputValue}"
                      label="#{bindings.TblProgView12.hints.ProgId.label}"
                      required="#{bindings.TblProgView12.hints.ProgId.mandatory}"
                      columns="#{bindings.TblProgView12.hints.ProgId.displayWidth}"
                      maximumLength="#{bindings.TblProgView12.hints.ProgId.precision}"
                      shortDesc="#{bindings.TblProgView12.hints.ProgId.tooltip}"
                      id="it1" readOnly="true"
                      contentStyle='text-align:center'>
            <f:validator binding="#{row.bindings.ProgId.validator}"/>
        </af:inputText>
    </af:column>