// FormPlaceholderFacet
@SuppressWarnings("unchecked")
	public static void SetPageFacet(int facetType, String facetName, long delay) {
		FacesContext context = FacesContext.getCurrentInstance();
		Map viewScope = context.getViewRoot().getViewMap();
		String previousFacet = "";
		String selectedFacet = "";
		try {
			switch (facetType) {
			case 1:// Login
				previousFacet = "previousLoginFacet";
				selectedFacet = "selectedLoginFacet";
				break;
			case 2:// Home
				previousFacet = "previousHomeFacet";
				selectedFacet = "selectedHomeFacet";
				break;
			case 3:// FormPlaceholderFacet
				previousFacet = "previousFormPlaceholderFacet";
				selectedFacet = "selectedFormPlaceholderFacet";
				break;
			}
			if (facetName.equals("Previous")) {
				SetPageFacet(facetType, viewScope.get(previousFacet).toString(), delay);
			} else if (!facetName.equals(viewScope.get(selectedFacet))) {
				if (delay > 0) {
					Thread.currentThread();
					Thread.sleep(delay);
				}
				viewScope.put(previousFacet, viewScope.get(selectedFacet));
				viewScope.put(selectedFacet, facetName);
			}
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
selectedFacet = "selectedHomeFacet";
break;
case 3:// FormPlaceholderFacet
previousFacet = "previousFormPlaceholderFacet";
selectedFacet = "selectedFormPlaceholderFacet";
try {
switch (facetType) {
case 1:// Login
previousFacet = "previousLoginFacet";
selectedFacet = "selectedLoginFacet";
break;
case 2:// Home
previousFacet = "previousHomeFacet";
selectedFacet = "selectedHomeFacet";
break;
case 3:// FormPlaceholderFacet
previousFacet = "previousFormPlaceholderFacet";
selectedFacet = "selectedFormPlaceholderFacet";
break;
}
if (facetName.equals("Previous")) {
SetPageFacet(facetType, viewScope.get(previousFacet).toString(), delay);
} else if (!facetName.equals(viewScope.get(selectedFacet))) {
if (delay > 0) {
Thread.currentThread();
Thread.sleep(delay);
@SuppressWarnings("unchecked")
public static void SetPageFacet(int facetType, String facetName, long delay) {
FacesContext context = FacesContext.getCurrentInstance();
Map viewScope = context.getViewRoot().getViewMap();
String previousFacet = "";
String selectedFacet = "";
try {
switch (facetType) {
case 1:// Login
previousFacet = "previousLoginFacet";
selectedFacet = "selectedLoginFacet";
break;
case 2:// Home
previousFacet = "previousHomeFacet";
selectedFacet = "selectedHomeFacet";
break;
case 3:// FormPlaceholderFacet
previousFacet = "previousFormPlaceholderFacet";
selectedFacet = "selectedFormPlaceholderFacet";
break;
}
if (facetName.equals("Previous")) {
SetPageFacet(facetType, viewScope.get(previousFacet).toString(), delay);
} else if (!facetName.equals(viewScope.get(selectedFacet))) {
if (delay > 0) {
Thread.currentThread();
Thread.sleep(delay);
}
viewScope.put(previousFacet, viewScope.get(selectedFacet));
viewScope.put(selectedFacet, facetName);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}