Identifying the current JSF lifecycle phase as Integer

public void beforePhase(PhaseEvent event) {
	try {
		Map<String, Object> r = ExtLibUtil.getRequestScope();
		r.put("currPhase", event.getPhaseId().getOrdinal());
	} catch (Throwable t) {
		IntecUtils.handleException(t);
	}
}





After I wrote this code, I found this XSnippet that allows you to check for a specific phase http://openntf.org/XSnippets.nsf/snippet.xsp?id=xrpl-isphase-api.
I found ent.getDocument().getResponses() used as the value of a repeat control nested inside a DataView throws an error during the earlier JSF lifecycle phases, so wrote this code to add the current phase as an integer. You can then use e.g. requestScope.currPhase < 4

Java
Paul S Withers
May 8, 2014 4:51 AM
Rating
3

All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.



No comments yetLogin first to comment...