Setting Tooltip for Primefaces Sheet

72 Views Asked by At

I would like to use tooltip for sheet columns. Like

<pe:sheetcolumn  headerText="Coverage Shape" value="#{material.coverageShape}" colWidth="250"
                        colType="dropdown"
                        selectItems="#{itemActionsManagedBean.getMapItems('coverageShape')}">
            <pe:tooltip value="Coverage" atPosition="top" autoShow="true" />
        </pe:sheetcolumn>

It doesn't show any tooltip. I tried to give id to sheetcolumn and tried to use in tooltip like referring by for attribute. But no luck. How can i show tooltips for sheetcolumns ?

My JSF VERSION : 2.2.1 PRİMEFACES AND PRIMEFACES EXTENSION VERSION : 6.2

I tried @Melloware solution but it didn't work. I tried that. But didnt show me any error and didnt show tooltip.

<pe:tooltip value="Coverage" atPosition="top" global="true" for="@(.coverage)"/>
    <pe:sheet id="someSheet" widgetVar="someSheetSheetWidget" value="#{itemActionsManagedBean.materials}" var="material"
               extender="sheetExtender" height="300">
  <pe:sheetcolumn headerText="Material Number" readOnly="true" value="#{material.materialNumber}" styleClass="coverage"
                        colWidth="250"/> </pe:sheet>
1

There are 1 best solutions below

3
Melloware On

That won't work. OK remove that tooltip from inside the sheet and do this.

  1. Add a custom style class coverage to the column like..
<pe:sheetcolumn  headerText="Coverage Shape" 
value="#{material.coverageShape}" 
colWidth="250" 
styleClass="coverage"
colType="dropdown"
selectItems="#{itemActionsManagedBean.getMapItems('coverageShape')}">
  1. Add this global tooltip OUTSIDE of the sheet.
<pe:tooltip value="Coverage" atPosition="top" global="true" for="@(.coverage)" />

That should find every one of your cell values with coverage style and give it the tooltip.