/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, Map<String, Object> stateMap) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("FaceletPartialStateManagementStrategy.restoreDynamicActions"); } List<Object> savedActions = (List<Object>) stateMap.get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (savedActions != null && !savedActions.isEmpty()) { for (Object object : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, object); if (ComponentStruct.ADD.equals(action.action)) { restoreDynamicAdd(context, stateMap, action); } if (ComponentStruct.REMOVE.equals(action.action)) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, HashMap<String, Object> state) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.restoreDynamicActions"); } UIViewRoot viewRoot = context.getViewRoot(); List<Object> savedActions = (List<Object>) viewRoot.getAttributes().get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (savedActions != null && !savedActions.isEmpty()) { for (Object object : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, object); if (ComponentStruct.ADD.equals(action.action)) { restoreDynamicAdd(context, state, action); } if (ComponentStruct.REMOVE.equals(action.action)) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, HashMap<String, Object> state) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.restoreDynamicActions"); } @SuppressWarnings("unchecked") List<Object> savedActions = (List<Object>) context.getViewRoot().getAttributes().get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (!isEmpty(savedActions)) { for (Object savedAction : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, savedAction); if (ADD.equals(action.getAction())) { restoreDynamicAdd(context, state, action); } if (REMOVE.equals(action.getAction())) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, HashMap<String, Object> state) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.restoreDynamicActions"); } @SuppressWarnings("unchecked") List<Object> savedActions = (List<Object>) context.getViewRoot().getAttributes().get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (!isEmpty(savedActions)) { for (Object savedAction : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, savedAction); if (ADD.equals(action.getAction())) { restoreDynamicAdd(context, state, action); } if (REMOVE.equals(action.getAction())) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, Map<String, Object> stateMap) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletPartialStateManagementStrategy.restoreDynamicActions"); } @SuppressWarnings("unchecked") List<Object> savedActions = (List<Object>) stateMap.get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (!isEmpty(savedActions)) { for (Object savedAction : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, savedAction); if (ADD.equals(action.getAction())) { restoreDynamicAdd(context, stateMap, action); } if (REMOVE.equals(action.getAction())) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, Map<String, Object> stateMap) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletPartialStateManagementStrategy.restoreDynamicActions"); } @SuppressWarnings("unchecked") List<Object> savedActions = (List<Object>) stateMap.get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (!isEmpty(savedActions)) { for (Object savedAction : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, savedAction); if (ADD.equals(action.getAction())) { restoreDynamicAdd(context, stateMap, action); } if (REMOVE.equals(action.getAction())) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, Map<String, Object> stateMap) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletPartialStateManagementStrategy.restoreDynamicActions"); } @SuppressWarnings("unchecked") List<Object> savedActions = (List<Object>) stateMap.get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (!isEmpty(savedActions)) { for (Object savedAction : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, savedAction); if (ADD.equals(action.getAction())) { restoreDynamicAdd(context, stateMap, action); } if (REMOVE.equals(action.getAction())) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, HashMap<String, Object> state) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.restoreDynamicActions"); } @SuppressWarnings("unchecked") List<Object> savedActions = (List<Object>) context.getViewRoot().getAttributes().get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (!isEmpty(savedActions)) { for (Object savedAction : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, savedAction); if (ADD.equals(action.getAction())) { restoreDynamicAdd(context, state, action); } if (REMOVE.equals(action.getAction())) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Handle the remove. * * @param context the Faces context. * @param component the UI component to add to the list as a REMOVE. */ @Override protected void handleRemove(FacesContext context, UIComponent component) { if (component.isInView()) { decrementDynamicChildCount(context, component.getParent()); handleAddRemoveWithAutoPrune( component, new ComponentStruct(REMOVE, component.getClientId(context), component.getId()) ); } }
/** * Handle the remove. * * @param context the Faces context. * @param component the UI component to add to the list as a REMOVE. */ @Override protected void handleRemove(FacesContext context, UIComponent component) { if (component.isInView()) { decrementDynamicChildCount(context, component.getParent()); ComponentStruct struct = new ComponentStruct(); struct.action = ComponentStruct.REMOVE; struct.clientId = component.getClientId(context); struct.id = component.getId(); handleAddRemoveWithAutoPrune(component, struct); } }
/** * Handle the remove. * * @param context the Faces context. * @param component the UI component to add to the list as a REMOVE. */ @Override protected void handleRemove(FacesContext context, UIComponent component) { if (component.isInView()) { decrementDynamicChildCount(context, component.getParent()); handleAddRemoveWithAutoPrune( component, new ComponentStruct(REMOVE, component.getClientId(context), component.getId()) ); } }
/** * Handle the remove. * * @param context the Faces context. * @param component the UI component to add to the list as a REMOVE. */ @Override protected void handleRemove(FacesContext context, UIComponent component) { if (component.isInView()) { decrementDynamicChildCount(context, component.getParent()); handleAddRemoveWithAutoPrune( component, new ComponentStruct(REMOVE, component.getClientId(context), component.getId()) ); } }
component.clearInitialState(); component.getAttributes().put(DYNAMIC_COMPONENT, component.getParent().getChildren().indexOf(component)); ComponentStruct struct = new ComponentStruct(); struct.action = ComponentStruct.ADD; struct.facetName = facetName; component.clearInitialState(); component.getAttributes().put(DYNAMIC_COMPONENT, component.getParent().getChildren().indexOf(component)); ComponentStruct struct = new ComponentStruct(); struct.action = ComponentStruct.ADD; struct.parentClientId = component.getParent().getClientId(context);
component.getAttributes().put(DYNAMIC_COMPONENT, component.getParent().getChildren().indexOf(component)); ComponentStruct struct = new ComponentStruct( ADD, facetName, component.getAttributes().put(DYNAMIC_COMPONENT, component.getParent().getChildren().indexOf(component)); ComponentStruct struct = new ComponentStruct( ADD, null,
component.getAttributes().put(DYNAMIC_COMPONENT, component.getParent().getChildren().indexOf(component)); ComponentStruct struct = new ComponentStruct( ADD, facetName, component.getAttributes().put(DYNAMIC_COMPONENT, component.getParent().getChildren().indexOf(component)); ComponentStruct struct = new ComponentStruct( ADD, null,
component.getAttributes().put(DYNAMIC_COMPONENT, component.getParent().getChildren().indexOf(component)); ComponentStruct struct = new ComponentStruct( ADD, facetName, component.getAttributes().put(DYNAMIC_COMPONENT, component.getParent().getChildren().indexOf(component)); ComponentStruct struct = new ComponentStruct( ADD, null,