Class TaskComponent
- java.lang.Object
-
- javax.faces.component.UIComponent
-
- javax.faces.component.UIComponentBase
-
- javax.faces.component.UINamingContainer
-
- de.xima.fc.prompt.service.support.gui.component.TaskComponent
-
- All Implemented Interfaces:
EventListener,javax.faces.component.NamingContainer,javax.faces.component.PartialStateHolder,javax.faces.component.StateHolder,javax.faces.component.TransientStateHolder,javax.faces.component.UniqueIdVendor,javax.faces.event.ComponentSystemEventListener,javax.faces.event.FacesListener,javax.faces.event.SystemEventListenerHolder
public class TaskComponent extends javax.faces.component.UINamingContainer
-
-
Field Summary
-
Fields inherited from class javax.faces.component.UINamingContainer
COMPONENT_FAMILY, COMPONENT_TYPE, SEPARATOR_CHAR_PARAM_NAME
-
-
Constructor Summary
Constructors Constructor Description TaskComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PromptFancySelectItemgetFancySelectItemValue()Finds thePromptFancySelectItemcorresponding to the currently selected task.voidsetFancySelectItemValue(PromptFancySelectItem item)Sets the selected task from the givenPromptFancySelectItem.-
Methods inherited from class javax.faces.component.UINamingContainer
createUniqueId, getFamily, getSeparatorChar, visitTree
-
Methods inherited from class javax.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent
-
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression
-
-
-
-
Method Detail
-
getFancySelectItemValue
public PromptFancySelectItem getFancySelectItemValue()
Finds thePromptFancySelectItemcorresponding to the currently selected task.Access the
cc.attrs.valueattribute of the closestTaskComponentcomponent; which must be a string representing the selected task. Then accesses thecc.attrs.optionsattribute of the same component; which must be a list ofPromptFancySelectIteminstances representing the available options. Finally, finds the option whosevaluematches the selected value, and returns that option.This is a workaround for the
<p:selectOneMenu>component. We want to use a custom UI for each option, but PrimeFaces only makes the select item value available as an EL variable (which is a string). We need to access the entirePromptFancySelectItemthat contains the label and description to display.- Returns:
- The selected
PromptFancySelectItem, ornullif no option is selected.
-
setFancySelectItemValue
public void setFancySelectItemValue(PromptFancySelectItem item)
Sets the selected task from the givenPromptFancySelectItem.Accesses the given item's
valueand writes it to thecc.attrs.valueattribute of the closestTaskComponentcomponent.This is a workaround for the
<p:selectOneMenu>component. We want to use a custom UI for each option, but PrimeFaces only makes the select item value available as an EL variable (which is a string). We need to access the entirePromptFancySelectItemthat contains the label and description to display.- Parameters:
item- The selectedPromptFancySelectItem, ornullto clear the selection.
-
-