Hint for each row in the data table

These questions are screaming like a duplicate of JSF 2.0 + Primefaces 2.x: a hint for the datatable string , but since this old question has no working / satisfying solution for me and there is no way (?) To attract attention to itself. I opened this new one.

It is very simple: I have a dataTable (with JSF standard or with performances), and I would like to add another tooltip for each row (not just for one field in it!).

What I have tried so far:

 <pe:tooltip value="This is row number #{rowIndex}" for="@(#table1 tr[role=row][data-ri=#{rowIndex}])" atPosition="top center" myPosition="bottom center" shared="true" /> 

where #table1 is the identifier of my data table. It occurred to me because of this .

And both solutions are from JSF 2.0 + Primefaces 2.x: tooltip for the datatable string : the first solutions work, but only for ONE field / id, and not for the whole string. The second solution will not work for me.

And I'm 100% sure that both simple and primary extensions work for me, I tested it.

+8
jsf-2 datatable tooltip primefaces primefaces-extensions
source share
3 answers

I did some tests, and this approach works fine:

 <p:dataTable var="entry" value="#{....}" styleClass="myTable" rowIndex="rowIndex"> <p:column headerText="Header 1"> <h:outputText value="#{entry.value1}" /> </p:column> <p:column headerText="Header 2"> <h:outputText value="#{entry.value2}" /> <pe:tooltip value="This is row number #{rowIndex}" forSelector=".myTable tr[role=row][data-ri=#{rowIndex}]" shared="true" atPosition="top center" myPosition="bottom center" showDelay="500" /> </p:column> </p:dataTable> 

Note that in order for the data-ri attribute to fit on string strings, you need to add the rowIndex attribute (rowIndex = "rowIndex").

He also worked with

 <p:tooltip for="@(.myTable tr[role=row][data-ri=#{rowIndex}])" value="This is row number #{rowIndex}" /> 
+6
source share

You can also do this without using primary extensions. This sample code works for me with performances 5.2. Note that in performances 5.2, the value of p: dataTable is rowIndexVar , not rowIndex, as in the above example.

 <h:form id="idform"> <p:dataTable var="komp" id="idDataTable" value="#{kompselect.listKomponenten}" rowIndexVar="rowIndex" selection="#{kompselect.selectedKomponente}" rowKey="#{komp.name}"> <p:column> <h:outputText id="otSelKomponente" value="#{komp.name}" /> <p:tooltip rendered="#{komp.displayToolTip}" for="idForm:iddataTable:#{rowIndex}:otSelKomponente" value="this is my Tooltip"/> </p:column> </p:dataTable> 

+3
source share

in accordance with this commission https://stackoverflow.com/a/166268/threads-threads-threads/threads/threads/threads/threads/threads/threads/threads/html.htm I can show a tooltip for textArea Primefaces 3.5 as shown below

 <p:dataTable id="commentsTable" value="#{historyReq.commentsFromReq}" var="comment" emptyMessage="#{localeMsg.roles_table_empty}" rows="10" styleClass="myTable" rowIndexVar="rowIndex"> <p:column headerText="HEADER A"> <h:outputText value="#{bean.valorA}" /> </p:column> <p:column headerText="#{HEADER B}"> <p:inputTextarea id="txtArea" cols="45" rows="1" value="#{bean.valorB}" readonly="true" disabled="false" autoResize="false"> <f:converter converterId="commentsConverter" /> </p:inputTextarea> <p:tooltip for="txtArea" value="This is row number #{rowIndex}" /> </p:column> 

+2
source share

All Articles