【发布时间】:2017-02-04 13:52:49
【问题描述】:
我想为表格中的每个单元格添加一个工具提示。表包含 126 个单元格,我需要找到一种简单的方法来添加工具提示。然而,他们每个人都必须有自己的头衔。因此,工具提示必须既适用于每个元素又可自定义。有什么办法可以做到这一点,尤其是在 PrimeFaces 中。 谢谢。
<tr>
<td id="0-0" onclick="locationClick(this)" class="table_cell" > info1 <br/> <span class="table_cell_line2">#{preparedProgramBean.getSecondLineInfoOfLocation(0,0)}</span></td>
<td id="0-1" onclick="locationClick(this)" class="table_cell" > info2 <br/> <span class="table_cell_line2">#{preparedProgramBean.getSecondLineInfoOfLocation(0,1)}</span></td>
<td id="0-2" onclick="locationClick(this)" class="table_cell" > info3 <br/> <span class="table_cell_line2">#{preparedProgramBean.getSecondLineInfoOfLocation(0,2)}</span></td>
<td id="0-3" onclick="locationClick(this)" class="table_cell" > info4 <br/> <span class="table_cell_line2">#{preparedProgramBean.getSecondLineInfoOfLocation(0,3)}</span></td>
<td id="0-4" onclick="locationClick(this)" class="table_cell" > info5 <br/> <span class="table_cell_line2">#{preparedProgramBean.getSecondLineInfoOfLocation(0,4)}</span></td>
<td id="0-5" onclick="locationClick(this)" class="table_cell" > info6 <br/> <span class="table_cell_line2">#{preparedProgramBean.getSecondLineInfoOfLocation(0,5)}</span></td>
<td id="0-6" onclick="locationClick(this)" class="table_cell" > info7 <br/> <span class="table_cell_line2">#{preparedProgramBean.getSecondLineInfoOfLocation(0,6)}</span></td>
</tr>
【问题讨论】:
-
您是要从 DB 加载工具提示内容吗?还是从一组工具提示或其他任何内容中,请说出您要从哪里加载工具提示内容?
-
来自托管 bean
-
来自课程对象数组。简短的名称当然显示在表格中,工具提示应显示全名。
-
这个jsf有什么关系?
-
@Kukeltje 信息来自像这样的支持 bean #{preparedProgramBean.getSecondLineInfoOfLocation(0,0)}