This is my Phase Listener
public class AdminPhaseListener implements PhaseListener {
private static final long serialVersionUID = -1161541721597667238L;
public void afterPhase(PhaseEvent e) {
System.out.println("after Phase " + e.getPhaseId());
}
public void beforePhase(PhaseEvent e) {
System.out.println("before Phase " + e.getPhaseId());
if(e.getPhaseId()== PhaseId.RESTORE_VIEW)
{
}
}
public PhaseId getPhaseId() {
return PhaseId.ANY_PHASE;
}
}
On click of a Command Button in my page, i call an action method and do some processing but the action method is not called at all, but in the server log , i could see the messages printed by my PhaseListener for all the Phases.
If my view was not changed, It would have stopped after the RESTORE_VIEW Phase right?
any thoughts?
Adding the code for How I display the Command Button :
<table width="100%">
<h:column rendered="#{adminBean.displayResultsSize > 0}">
<tr>
<td colspan="14" height="5" nowrap="nowrap" class="WhiteRow"></td>
</tr>
<tr>
<td colspan="14" height="1" nowrap="nowrap" align="center"
bgcolor="#999999"></td>
</tr>
<h:inputHidden id="removeUserId" value="#{adminBean.removeUserId}"/>
<h:inputHidden id="removeIBD" value="#{adminBean.removeIBD}"/>
<h:inputHidden id="removeAPA" value="#{adminBean.removeAPA}"/>
<tr>
<td colspan="14" height="30" nowrap="nowrap"
class="FilterColumnGrayHeader" align="center">
<input type="button" disabled="disabled" id="button_edit"
value="Edit Details" class="disabledfield"
onclick="populateEditRow();">
</input> <h:commandButton type="submit" class="disabledfield" immediate="true"
id="button_remove" value="Remove" onclick="populateRemoveRow();" action="#{adminBean.remove}">
</h:commandButton>  
</td>
</tr>
<tr bgcolor="#000000">
<td colspan="14" height="1" nowrap="nowrap" align="center"
bgcolor="#999999"></td>
</tr>
<tr>
<td height="10"></td>
</tr>
</h:column>
</table>
I'm citing from this answer:
Whenever an
UICommand
component fails to invoke the associated action, verify the following:
UICommand
components must be placed inside anUIForm
component (e.g.h:form
).- You cannot nest multiple
UIForm
components in each other (watch out with include files!).- No validation/conversion error should have been occurred (use
h:messages
to get them all).- If
UICommand
components are placed inside anUIData
component, ensure that exactly the sameDataModel
(the object behind theUIData
'svalue
attribute) is preserved.- The
rendered
anddisabled
attributes of the component and all of the parent components should not evaluate tofalse
during apply request values phase.- Be sure that no
PhaseListener
or anyEventListener
in the request-response chain has changed the JSF lifecycle to skip the invoke action phase.- Be sure that no
Filter
orServlet
in the same request-response chain has blocked the request fo theFacesServlet
somehow.
Another cause can be that you're not running the code you think you're running.
This generally means that there are validation errors on the page. Try setting immediate="true"
to overcome the errors, or use <h:messages>
to show the errors that arose.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With