@Override public void doDecode(FacesContext context, UIComponent component) { AbstractMenuItem menuItem = (AbstractMenuItem) component; if (menuItem != null) { Mode mode = resolveSubmitMode(menuItem); if (!Mode.client.equals(mode)) { super.doDecode(context, component); } } }
@Override protected void doDecode(FacesContext facesContext, UIComponent uiComponent) { if (isSubmitted(facesContext, uiComponent)) { new ActionEvent(uiComponent).queue(); } }
public String getOnClick(FacesContext context, UIComponent component) { StringBuffer onClick = new StringBuffer(); if (!getUtils().isBooleanAttribute(component, "disabled")) { HandlersChain handlersChain = new HandlersChain(context, component); handlersChain.addInlineHandlerFromAttribute("onclick"); handlersChain.addBehaviors("click", "action"); handlersChain.addAjaxSubmitFunction(); String handlerScript = handlersChain.toScript(); if (handlerScript != null) { onClick.append(handlerScript); } if (!"reset".equals(component.getAttributes().get("type"))) { onClick.append(";return false;"); } } else { onClick.append("return false;"); } return onClick.toString(); }
public String getOnClick(FacesContext context, UIComponent component) { StringBuffer onClick = new StringBuffer(); if (!getUtils().isBooleanAttribute(component, "disabled")) { HandlersChain handlersChain = new HandlersChain(context, component); handlersChain.addInlineHandlerFromAttribute("onclick"); handlersChain.addBehaviors("click", "action"); handlersChain.addAjaxSubmitFunction(); String handlerScript = handlersChain.toScript(); if (handlerScript != null) { onClick.append(handlerScript); } if (!"reset".equals(component.getAttributes().get("type"))) { onClick.append(";return false;"); } } else { onClick.append("return false;"); } return onClick.toString(); }
public String getOnClick(FacesContext context, UIComponent component) { StringBuffer onClick = new StringBuffer(); if (!getUtils().isBooleanAttribute(component, "disabled")) { HandlersChain handlersChain = new HandlersChain(context, component); handlersChain.addInlineHandlerFromAttribute("onclick"); handlersChain.addBehaviors("click", "action"); handlersChain.addAjaxSubmitFunction(); String handlerScript = handlersChain.toScript(); if (handlerScript != null) { onClick.append(handlerScript); } if (!"reset".equals(component.getAttributes().get("type"))) { onClick.append(";return false;"); } } else { onClick.append("return false;"); } return onClick.toString(); }
@Override protected void doDecode(FacesContext facesContext, UIComponent uiComponent) { if (isSubmitted(facesContext, uiComponent)) { new ActionEvent(uiComponent).queue(); } }
@Override public void doDecode(FacesContext context, UIComponent component) { AbstractMenuItem menuItem = (AbstractMenuItem) component; if (menuItem != null) { Mode mode = resolveSubmitMode(menuItem); if (!Mode.client.equals(mode)) { super.doDecode(context, component); } } }
protected boolean isSubmitted(FacesContext facesContext, UIComponent uiComponent) { if (getUtils().isBooleanAttribute(uiComponent, "disabled")) { return false; } String clientId = uiComponent.getClientId(facesContext); Map<String, String> paramMap = facesContext.getExternalContext().getRequestParameterMap(); Object value = paramMap.get(clientId); /* * RF-13559, RF-13018, prevent commandButton with @type="button" or "reset" from executing its action if it didn't * submit the form */ boolean preventButtonExecution = false; if (uiComponent instanceof AbstractCommandButton) { AbstractCommandButton button = (AbstractCommandButton) uiComponent; String type = ((String) button.getAttributes().get("type")).toLowerCase(); String source = paramMap.get(SOURCE_ID); if ((type.equals("button") || type.equals("reset")) && !source.equals(button.getClientId())) { preventButtonExecution = true; } } boolean submitted = null != value && !preventButtonExecution; if (submitted && LOG.isDebugEnabled()) { LOG.debug("Decode submit of the Ajax component " + clientId); } return submitted; }
@Override protected void doDecode(FacesContext facesContext, UIComponent uiComponent) { if (isSubmitted(facesContext, uiComponent)) { new ActionEvent(uiComponent).queue(); } }
@Override public void doDecode(FacesContext context, UIComponent component) { AbstractMenuItem menuItem = (AbstractMenuItem) component; if (menuItem != null) { Mode mode = resolveSubmitMode(menuItem); if (!Mode.client.equals(mode)) { super.doDecode(context, component); } } }
protected boolean isSubmitted(FacesContext facesContext, UIComponent uiComponent) { if (getUtils().isBooleanAttribute(uiComponent, "disabled")) { return false; } String clientId = uiComponent.getClientId(facesContext); Map<String, String> paramMap = facesContext.getExternalContext().getRequestParameterMap(); Object value = paramMap.get(clientId); /* * RF-13559, RF-13018, prevent commandButton with @type="button" or "reset" from executing its action if it didn't * submit the form */ boolean preventButtonExecution = false; if (uiComponent instanceof AbstractCommandButton) { AbstractCommandButton button = (AbstractCommandButton) uiComponent; String type = ((String) button.getAttributes().get("type")).toLowerCase(); String source = paramMap.get(SOURCE_ID); if ((type.equals("button") || type.equals("reset")) && !button.getClientId().equals(source)) { preventButtonExecution = true; } } boolean submitted = null != value && !preventButtonExecution; if (submitted && LOG.isDebugEnabled()) { LOG.debug("Decode submit of the Ajax component " + clientId); } return submitted; }
protected boolean isSubmitted(FacesContext facesContext, UIComponent uiComponent) { if (getUtils().isBooleanAttribute(uiComponent, "disabled")) { return false; } String clientId = uiComponent.getClientId(facesContext); Map<String, String> paramMap = facesContext.getExternalContext().getRequestParameterMap(); Object value = paramMap.get(clientId); /* * RF-13559, RF-13018, prevent commandButton with @type="button" or "reset" from executing its action if it didn't * submit the form */ boolean preventButtonExecution = false; if (uiComponent instanceof AbstractCommandButton) { AbstractCommandButton button = (AbstractCommandButton) uiComponent; String type = ((String) button.getAttributes().get("type")).toLowerCase(); String source = paramMap.get(SOURCE_ID); if ((type.equals("button") || type.equals("reset")) && !source.equals(button.getClientId())) { preventButtonExecution = true; } } boolean submitted = null != value && !preventButtonExecution; if (submitted && LOG.isDebugEnabled()) { LOG.debug("Decode submit of the Ajax component " + clientId); } return submitted; }