It works as expected, with one exception:
The menu itself is in its own h:form. There is no desired navigation, action or actionListener to be invoked, just the copy to the clipboard.
Yet the entire page is re-rendered, resulting in the same DB IO that was invoked when the page is first accessed.
I do not understand why or how to prevent this. Is there a way? I have tried url="#", actionListener pointed at a noOp method; nothing works.
In this case, using PF 6.1, PFE 6.1.1.
Code: Select all
<pe:clipboard id="copyAppDlIdUnl" trigger="appDlIdUnl"
action="copy"
text="#{sessionScope.SELECTED_APPLICANT.selectedApplicantDlIDUnlNumber}">
<p:ajax event="success" listener="#{clipboardController.successListener}"
update="applicantMenuFormGrowler" />
<p:ajax event="error" listener="#{clipboardController.errorListener}"
update="applicantMenuFormGrowler" />
</pe:clipboard>
<pe:clipboard id="copyAppDob" trigger="appDob" action="copy"
text="#{sessionScope.SELECTED_APPLICANT.selectedApplicantDobMdy}">
<p:ajax event="success" listener="#{clipboardController.successListener}"
update="applicantMenuFormGrowler" />
<p:ajax event="error" listener="#{clipboardController.errorListener}"
update="applicantMenuFormGrowler" />
</pe:clipboard>
<p:menubar id="applicantMenuBar" rendered="#{not empty sessionScope.SELECTED_APPLICANT}">
<p:submenu
label="Selected Applicant: #{sessionScope.SELECTED_APPLICANT.selectedApplicantLName}, #{sessionScope.SELECTED_APPLICANT.selectedApplicantFName}">
<p:menuitem id="appDlIdUnl" icon="fa fa-copy"
value=" DL/ID/UNL: #{sessionScope.SELECTED_APPLICANT.selectedApplicantDlIDUnlNumber}" />
<p:menuitem id="appDob" icon="fa fa-copy"
value=" DOB: #{sessionScope.SELECTED_APPLICANT.selectedApplicantDobMdy}" />
<p:menuitem value="Go" icon="fa fa-arrow-circle-left" url="/viewBasicRecord.do" />
</p:submenu>