If you're using PrimeFaces 3.3 or newer, you could just add partialSubmit="true"
to the command component. You can then control the to-be-processed components in process
attribute. In this particular case, just the current component (the command component itself) is sufficient, thus so process="@this"
:
<p:commandLink ... process="@this" partialSubmit="true" />
This way only the request parameters which are really necessary for the process will be sent.
Unrelated to the concrete problem, I suggest to use oncomplete
instead of onclick
to open the dialog. Otherwise the dialog is opened before update
takes place and may cause poor user experience as the enduser would see the image instantly changing.