Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Later
-
1.1.4-SNAPSHOT, 1.1.5-SNAPSHOT
-
None
Description
inputSuggestAjax doesn't work since the phase listener never gets called. The APPLY_REQUEST_VALUES phase is not entered in some circumstances, specifically if the RENDER_RESPONSE view completes early as it does when the view root is null in the following LifecycleImpl code snippet:
//boolean viewCreated = false;
UIViewRoot viewRoot = viewHandler.restoreView(facesContext, viewId);
if (viewRoot == null)
If the null view root case is entered, the lifecycle is short-circuited and the APPLY_REQUEST_VALUES phase is never entered, causing the ajax control to have no suggested values.
I was able to get the application to work as expected by subclassing the default AjaxDecodePhaseListener as follows:
/**
- Override the default ajax support, since it doesn't seem to work in the
- APPLY_REQUEST_VALUES phase, since that phase never gets entered. Process immediately
- after the RESTORE_VIEW phase instead.
*/
public class AjaxDecodePhaseListener
extends org.apache.myfaces.custom.ajax.api.AjaxDecodePhaseListener
{
private static final long serialVersionUID = 1660766611978163100L;
public PhaseId getPhaseId()
{ return PhaseId.RESTORE_VIEW; }public void afterPhase(PhaseEvent event)
{ super.beforePhase(event); } public void beforePhase(PhaseEvent event) {
}
}