Oncomplete attribute h: commandLink not called
We are migrating from JSF 1.2 to JSF 2.2.6 along with RichFaces 4.5.2. Facing problems with oncomplete
not caused. The JS function onclick
is called at time , but the JS is oncomplete
not called. How is this caused and how can I solve it?
<h:commandLink ... onclick="ed();" oncomplete="cEd(#{rowIndex});">
source to share
There is <h:commandLink>
no such attribute in the attribute . Chances are you are confusing <a4j:commandLink>
who this attribute has .
You basically have 2 options:
-
Just replace
<h:commandLink>
with<a4j:commandLink>
.<a4j:commandLink ... oncomplete="oncompleteFunction()" />
-
Customize a
<f:ajax>
with an event handler internally<h:commandLink>
.<h:commandLink ...> <f:ajax onevent="oneventFunction" /><!-- No parenthesis! --> </h:commandLink>
function oneventFunction(data) { if (data.status === "success") { oncompleteFunction(); } }
Hint for the future: just read the tag documentation. Links are indicated in the 1st paragraph.
source to share