Refine search
@Override public void decode(FacesContext context, UIComponent component) { RemoteCommand command = (RemoteCommand) component; if (context.getExternalContext().getRequestParameterMap().containsKey(command.getClientId(context))) { ActionEvent event = new ActionEvent(command); if (command.isImmediate()) { event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES); } else { event.setPhaseId(PhaseId.INVOKE_APPLICATION); } command.queueEvent(event); } }
@Override public void processAction(ActionEvent event) throws AbortProcessingException { UIComponent source = event.getComponent(); // don't use event#getFacesContext() - it's only available in JSF 2.3 Map<Object, Object> attrs = FacesContext.getCurrentInstance().getAttributes(); if (source instanceof Widget) { attrs.put(Constants.DIALOG_FRAMEWORK.SOURCE_WIDGET, ((Widget) source).resolveWidgetVar()); } attrs.put(Constants.DIALOG_FRAMEWORK.SOURCE_COMPONENT, source.getClientId()); base.processAction(event); }
@Override public void decode(FacesContext facesContext, UIComponent component) { Map<String, String> params = facesContext.getExternalContext().getRequestParameterMap(); Hotkey hotkey = (Hotkey) component; if (params.containsKey(hotkey.getClientId(facesContext))) { hotkey.queueEvent(new ActionEvent(hotkey)); } }
Map parameterMap = context.getExternalContext(). getRequestParameterMap(); clientId, phaseEvent.getFacesContext().getViewRoot()); if (inputFile != null) { inputFile.getAttributes().put("fileInfo", fileInfo); inputFile.queueEvent( new InputFileProgressEvent(inputFile) ); if (fileInfo.isSaved()) { inputFile.queueEvent( new InputFileSetFileEvent(inputFile) ); ActionEvent event = new ActionEvent(inputFile); event.setPhaseId(PhaseId.INVOKE_APPLICATION); inputFile.queueEvent(event);
@Override public void processAction(ActionEvent event) { FacesContext context = FacesContext.getCurrentInstance(); ELContext elContext = context.getELContext(); if (repeat != null) { repeating = repeat.isLiteralText() ? Boolean.parseBoolean(repeat.getValue(context.getELContext()).toString()) : (Boolean) repeat.getValue(context.getELContext()); List components = SearchExpressionFacade.resolveComponents(context, event.getComponent(), tables);
public void afterPhase(PhaseEvent event) { if (JsfUtils.isFlowRequest()) { FacesContext context = event.getFacesContext(); if (context.getExternalContext().getRequestParameterMap().containsKey("_eventId")) { UICommand eventSource = new UICommand(); eventSource.setTransient(true); eventSource.setParent(context.getViewRoot()); eventSource.setId("_eventId"); String eventId = context.getExternalContext().getRequestParameterMap().get("_eventId"); eventSource.setActionExpression(convertEventIdToMethodExpression(context, eventId)); context.getViewRoot().queueEvent(new ActionEvent(eventSource)); } } }
@Override public void processAction(ActionEvent event) throws AbortProcessingException { FacesContext context = FacesContext.getCurrentInstance(); ELContext elContext = context.getELContext(); VisitContext visitContext = VisitContext.createVisitContext(context, null, ComponentUtils.VISIT_HINTS_SKIP_UNRENDERED); String expressions = (String) target.getValue(elContext); boolean resetModel = false; if (clearModel != null) { resetModel = clearModel.isLiteralText() ? Boolean.parseBoolean(clearModel.getValue(context.getELContext()).toString()) : (Boolean) clearModel.getValue(context.getELContext()); } ResetInputVisitCallback visitCallback = resetModel ? ResetInputVisitCallback.INSTANCE_CLEAR_MODEL : ResetInputVisitCallback.INSTANCE; List<UIComponent> components = SearchExpressionFacade.resolveComponents(context, event.getComponent(), expressions); for (int i = 0; i < components.size(); i++) { UIComponent component = components.get(i); component.visitTree(visitContext, visitCallback); } } }
@Override public void broadcast(FacesEvent event) throws AbortProcessingException { FacesContext facesContext = FacesContext.getCurrentInstance(); if (event instanceof ItemChangeEvent) { String newItemName = ((ItemChangeEvent) event).getNewItemName(); updateModel(facesContext); if (event.getPhaseId() != PhaseId.UPDATE_MODEL_VALUES) { facesContext.renderResponse(); ActionEvent actionEvent = new ActionEvent(childCommand); childCommand.broadcast(actionEvent); } else { actionEvent.queue();
@Override protected UIComponent getPopup(ActionEvent actionEvent) { String id = (String) popupIdExpression.getValue(FacesContext.getCurrentInstance().getELContext()); UIComponent popup = FindComponentUtils.findComponent(actionEvent.getComponent(), id); if (popup == null) { LOG.error("Found no popup for \"" + popupIdExpression.getExpressionString() + "\" := \"" + id + "\"! Search base componentId : " + actionEvent.getComponent().getClientId(FacesContext.getCurrentInstance())); } return popup; }
public void decode(FacesContext context) { super.decode(context); Map map = context.getExternalContext().getRequestParameterMap(); String clickedNodeName = getClientId(context) + "ClickedNodeName"; boolean ignoreClick = "input".equalsIgnoreCase((String) map.get(clickedNodeName)) && !isToggleOnInput(); String clientId = getClientId(context)+"Expanded"; if (map.containsKey(clientId) && !map.get(clientId).toString().equals("") && !ignoreClick) { getAttributes().put(getMatureClientId()+"changedByDecode", "true"); boolean exp = Boolean.valueOf(map.get(clientId).toString()).booleanValue(); exp = !exp; setExpanded(exp); queueEvent(new ActionEvent(this)); } }
@Override protected UIComponent getPopup(ActionEvent actionEvent) { String id = (String) popupIdBinding.getValue(FacesContext.getCurrentInstance()); UIComponent popup = FindComponentUtils.findComponent(actionEvent.getComponent(), id); if (popup == null) { LOG.error("Found no popup for \"" + popupIdBinding.getExpressionString() + "\" := \"" + id + "\"! Search base componentId : " + actionEvent.getComponent().getClientId(FacesContext.getCurrentInstance())); } return popup; }
public void broadcast(FacesEvent event) throws AbortProcessingException { if (event instanceof ActionEvent) { ActionEvent actionEvent = (ActionEvent) event; if (actionEvent.getPhaseId() == PhaseId.APPLY_REQUEST_VALUES) { AbstractHtmlCommandNavigationItem navItem = (AbstractHtmlCommandNavigationItem) actionEvent.getComponent(); navItem.toggleOpen(); FacesContext.getCurrentInstance().renderResponse(); } } super.broadcast(event); } }
@Override public void decode(FacesContext context, UIComponent component) { rendererParamsNotNull(context, component); if (!shouldDecode(component)) { return; } String clientId = component.getClientId(context); if (RenderKitUtils.isPartialOrBehaviorAction(context, clientId)) { UICommand command = (UICommand) component; ActionEvent event = new ActionEvent(command); event.setPhaseId(command.isImmediate() ? PhaseId.APPLY_REQUEST_VALUES : PhaseId.INVOKE_APPLICATION); command.queueEvent(event); if (logger.isLoggable(Level.FINE)) { logger.fine("This commandScript resulted in form submission ActionEvent queued."); } } }
public void listenerAddContact(ActionEvent event) { UIComponent component = event.getComponent(); List<UIComponent> childs = component.getChildren(); String pattern = "^objectDocumentContactUidInput$|.*[:\\.]objectDocumentContactUidInput$"; for (UIComponent child : childs) { if (child.getId().matches(pattern)) { String newContactRef = (String) ((UIInput) child).getSubmittedValue(); addContact(newContactRef); break; } } }
if ((context.isPostback() && !isOnPostback()) || !isRendered()) { return; ActionEvent e = new ActionEvent(context, this); PhaseId phaseId = getPhaseId(); if (phaseId != null) { e.setPhaseId(phaseId); } else if (isImmediate()) { e.setPhaseId(PhaseId.APPLY_REQUEST_VALUES); } else { e.setPhaseId(PhaseId.INVOKE_APPLICATION);
private ChainSelect getChainSelect(ActionEvent event) { UIComponent component = event.getComponent(); while (!(component instanceof ChainSelect)) { component = component.getParent(); } return (ChainSelect) component; }
@Override protected void doDecode(FacesContext facesContext, UIComponent uiComponent) { if (isSubmitted(facesContext, uiComponent)) { new ActionEvent(uiComponent).queue(); } }
public void toggleCreateForm(ActionEvent event) { UIComponent cmp = event.getComponent(); String id = cmp.getId(); if ("ToggleTrainingForm".equals(id)) { showCreateForm = !showCreateForm; showCreateContactForm = false; } else { showCreateContactForm = !showCreateContactForm; showCreateForm = false; } }
public void decode(FacesContext facesContext, UIComponent uiComponent) { org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.checkParamValidity(facesContext, uiComponent, UICommand.class); //super.decode must not be called, because value is handled here if (!isReset(uiComponent) && isSubmitted(facesContext, uiComponent)) { uiComponent.queueEvent(new ActionEvent(uiComponent)); org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.initPartialValidationAndModelUpdate(uiComponent, facesContext); } }
if (context.isPostback() && !isOnPostback()) PhaseId phaseId = (phase != null) ? PhaseId.phaseIdValueOf(phase) : isImmediate() ? PhaseId.APPLY_REQUEST_VALUES : PhaseId.INVOKE_APPLICATION; evt.setPhaseId(phaseId); this.queueEvent(evt); Integer count = (Integer) context.getAttributes().get(EVENT_COUNT_KEY); count = (count == null) ? 1 : count + 1; context.getAttributes().put(EVENT_COUNT_KEY, count);