arya-blue
luna-amber
luna-blue
luna-green
luna-pink
nova-dark
nova-light
saga-blue
vela-blue
MarkText - Synonyms
Demonstrates the synonyms property, which allows highlighting synonymous terms bidirectionally. For example, searching for "one" will also highlight "1", and vice versa, based on the provided synonyms map.
Search term:
Searchable Content
Counting is easy: one, two, three, four, five. Numbers: 1, 2, 3, 4, 5. You can use either words or digits: one (1), two (2), three (3). This demonstrates synonyms highlighting both ways.
Source

                <h:panelGrid columns="3">
        <h:outputText value="Search term:"/>
        <p:inputText id="searchInput" value="#{synonymsMarkTextController.searchTerm}" placeholder="Enter search term">
             <p:ajax event="keyup" delay="500" update="searchContainer markText"/>
        </p:inputText>
        <p:commandButton value="Highlight" update="searchContainer markText" icon="pi pi-search"/>
    </h:panelGrid>

    <p:panel id="searchContainer" header="Searchable Content" style="margin-top: 20px">
        <h:panelGroup id="searchContent" layout="block">
            #{synonymsMarkTextController.processedText}
        </h:panelGroup>
    </p:panel>

    <pe:markText id="markText" for="searchContent" value="#{synonymsMarkTextController.searchTerm}" synonyms="#{synonymsMarkTextController.synonyms}" styleClass="marktext-highlight" actionListener="#{synonymsMarkTextController.onHighlight}"/>
            
Components and more
Documentation pe:
Attributes (move mouse over the names to see data types)
Name Description
No attributes available for this component.
PrimeFaces Extensions Showcase - © 2011-2025,PrimeFaces: 15.0.13,PrimeFaces Extensions: 15.0.14-SNAPSHOT,JSF: Apache MyFaces JSF-2.3 Core Impl 2.3.10,Server: Apache Tomcat (TomEE)/9.0.82 (8.0.16),Build time: 2026-02-23 00:32