Package de.xima.fc.gui.common.bean
Class ViewIdBean
java.lang.Object
de.xima.fc.gui.common.bean.ViewIdBean
- All Implemented Interfaces:
Serializable
Bean that associates a UUID with each view. This is better that relying on the internal
java.faces.ViewState,
which may not contain an ID in case of client-side state saving etc.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisDifferentView(UUID viewId) static booleanisSameView(UUID viewId)
-
Constructor Details
-
ViewIdBean
public ViewIdBean()
-
-
Method Details
-
getViewId
- Returns:
- The ID of the current view.
-
getCurrentViewId
- Returns:
- The ID of the current view, if this method is called within a JSF context. Otherwise,returns an empty optional.
-
isSameView
- Parameters:
viewId- A view ID against which to check.- Returns:
truewhen called within a JSF context and the current view equals the given view ID,falseotherwise.
-
isDifferentView
- Parameters:
viewId- A view ID against which to check.- Returns:
- When the given view ID is not
null:truewhen either not within a JSF context or the current view is different from the given view ID,falseotherwise. When the given view ID isnull:truewhen there is a an active view ID,falseotherwise.
-