我需要在 subTable 标题中显示一个命令链接。页面正确呈现,但是只有第一个命令链接会触发并调用操作方法。所有后续命令链接都不会调用操作方法。我查看了前两个锚元素的 html 源代码。生成的 id 略有不同。第一个链接的 id 在 j_dt68 之后没有数字,而第二个链接的 id 有 j_dt68:0。不确定它是否重要。请帮忙!
First commandlink's html code:
<a id="center_content_form:equipment_tabview:equipment-table:0:j_idt68:equipment_details_link" href="#" class="ui-commandlink" onclick="PrimeFaces.ab({source:'center_content_form:equipment_tabview:equipment-table:0:j_idt68:equipment_details_link'});return false;">DGI5120_GI:SB-5120 | 06634CVJTKH5</a>
Second commandlink's html code:
<a id="center_content_form:equipment_tabview:equipment-table:1:j_idt68:0:equipment_details_link" href="#" class="ui-commandlink" onclick="PrimeFaces.ab({source:'center_content_form:equipment_tabview:equipment-table:1:j_idt68:0:equipment_details_link'});return false;">DAR502G_ARRIS:TM502G | 6A7BMU47P225361</a>
<p:dataTable id="equipment-table" styleClass="list-datatable"
var="equipment" value="#{equipmentBean.equipmentList}"
emptyMessage="#{equipment_msgs['equipment.table.emptyMessage']}">
<f:facet name="header">
<p:commandButton immediate="true" id="assign_equipment"
icon="add-sign" styleClass="table-header-button-class"
title="#{equipment_msgs['assign.equipment.tooltip.text']}"
action="#{equipmentBean.navigateToAssignEquipmentPage()}" />
<h:outputText
value="#{equipment_msgs['assign.equipment.button.label']}"
styleClass="table-header" />
</f:facet>
<p:column id="port_number"
headerText="#{equipment_msgs['port.number.column.label']}"
styleClass="col10 table_text" />
<p:column id="port_address"
headerText="#{equipment_msgs['address.column.label']}"
styleClass="co20 table_text" />
<p:column id="port_type"
headerText="#{equipment_msgs['type.column.label']}"
styleClass="col20 table_text" />
<p:column id="port_category"
headerText="#{equipment_msgs['port.category.column.label']}"
styleClass="col20 table_text" />
<p:column id="service_category"
headerText="#{equipment_msgs['service.category.column.label']}"
styleClass="col20 table_text" />
<p:column id="occurrence"
headerText="#{equipment_msgs['occurrence.column.label']}"
styleClass="col20 table_text" />
<p:column id="modem"
headerText="#{equipment_msgs['modem.column.label']}"
styleClass="col10 table_text" />
<p:subTable var="port" value="#{equipment.portList}">
<f:facet name="header">
<p:separator styleClass="header-separator" />
<p:commandLink id="equipment_details_link"
value="#{equipment.detailLinkValue}"
action="#{equipmentBean.navigateToEquipmentDetailsPage()}" >
<f:setPropertyActionListener value="#{equipment}"
target="#{equipmentBean.selectedEquipment}" />
</p:commandLink>
<p:separator styleClass="header-separator" />
</f:facet>
<p:column>
<p:commandLink immediate="true" id="equipment_port_details_link"
value="#{port.portNumber}"
action="#{equipmentBean.navigateToEquipmentPortDetailsPage(port.portNumber)}">
<f:setPropertyActionListener value="#{equipment}"
target="#{equipmentBean.selectedEquipment}" />
</p:commandLink>
</p:column>
<p:column>
<p:commandLink immediate="true" id="equipment_port_addressable_transaction_details_link1"
value="#{port.portAddress}"
action="#{equipmentBean.navigateToEquipmentAddressPortDetailsPage(port.portNumber)}">
<f:setPropertyActionListener value="#{equipment}"
target="#{equipmentBean.selectedEquipment}" />
</p:commandLink>
</p:column>
<p:column>#{port.portType}</p:column>
<p:column>#{port.portDetails.portCategory}</p:column>
<p:column>#{port.portDetails.serviceCategory}</p:column>
<p:column>#{port.portDetails.occurrence}</p:column>
<p:column>#{port.portDetails.modemText} </p:column>
</p:subTable>
</p:dataTable>