Reputation: 7
This is the XHTML code
<p:commandLink style="width: 10px;height: 10px;"
actionListener="#{InboxBean.archiveInboxRecord(actionEvent)}">
<img src="../resources/images/arch.png" />
<f:setPropertyActionListener value="#{inboxitem}"
target="#{InboxBean.selectedInbox}"/>
</p:commandLink>
and this is bean
public void archiveInboxRecord(ActionEvent actionEvent){
System.err.println("Record Title is " + this.selectedInbox.AppTitle);
}
Upvotes: 0
Views: 743
Reputation: 7
after friends aid ..
the right code is
<p:commandLink style="width: 10px;height: 10px;"
process="inboxdt"
actionListener ="#{InboxBean.archiveInboxRecord(actionEvent)}" >
<img src="../resources/images/arch.png" />
<f:setPropertyActionListener value="#{inboxitem}" target="#{InboxBean.selectedInbox}" />
</p:commandLink>
and the key solution is process the datatable Id "inboxdt"
Upvotes: 0
Reputation: 132
Check if your datatable is in a form tag like that :
<h:form id="form">
<p:datatable var="student" value="#{studentbean.listStd}">
<p:column headerText="column 1">Something here ..</p:column>
<p:column headerText="Action">
<p:commandLink style="width: 10px;height: 10px;"
actionListener="#{InboxBean.archiveInboxRecord}" >
<img src="../resources/images/arch.png" />
<f:setPropertyActionListener value="#{inboxitem}"
target="#{InboxBean.selectedInbox}" />
</p:commandLink>
</p:column>
</p:datatable>
</h:form>
Or try to put your commandLink in a from tag like that:
<h:form id="formLink">
<p:commandLink style="width: 10px;height: 10px;"
actionListener="#{InboxBean.archiveInboxRecord}" >
<img src="../resources/images/arch.png" />
<f:setPropertyActionListener value="#{inboxitem}"
target="#{InboxBean.selectedInbox}" />
</p:commandLink>
</h:form>
Upvotes: 0
Reputation: 3162
An argument actionEvent do not require to send when you use actionListener. You should use the below code instead.
<p:commandLink style="width: 10px;height: 10px;"
actionListener="#{InboxBean.archiveInboxRecord}" >
<img src="../resources/images/arch.png" />
<f:setPropertyActionListener value="#{inboxitem}"
target="#{InboxBean.selectedInbox}" />
</p:commandLink>
Upvotes: 1