2

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>
Samet Dağ
  • 93
  • 6
  • From looking at how the Sheet works and rendered all in JS code not sure you can actually do this. Unless handsonTable has a title element that can be added to cells. – Melloware Feb 15 '23 at 22:52

1 Answers1

2

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.

Melloware
  • 10,435
  • 2
  • 32
  • 62
  • i tried like that but still didn't work. I updated my question. You can see on the below like as you said. I tried to even give th to 'for="@(.coverage)' here. But no luck – Samet Dağ Feb 15 '23 at 06:01
  • Just guessing here, but can it be that you need to update your project to the current version of PrimeFaces first? ...Which is always a good idea. 6.2 is kind of old. – Jasper de Vries Feb 15 '23 at 11:24
  • it might be that value doesn't work and you need to add `title` to those records so the gloabl tooltip finds the `coverage` class and makes the title a tooltip. – Melloware Feb 15 '23 at 17:21