private Object getSubmittedValue(UIInput input) { return input.getSubmittedValue() == null && input.isLocalValueSet() ? input.getValue() : input.getSubmittedValue(); } }
Date startDate = (Date) startDateComponent.getValue();
protected Object getValue(UIComponent uiComponent) { if (uiComponent instanceof UIInput) { Object value = ((UIInput) uiComponent).getValue(); return value; } return null; }
public void passwordValidator(FacesContext context, UIComponent toValidate, Object value) { UIInput passwordField = (UIInput) context.getViewRoot().findComponent("registerForm:password"); if (passwordField == null) throw new IllegalArgumentException(String.format("Unable to find component.")); String password = (String) passwordField.getValue(); String confirmPassword = (String) value; if (!confirmPassword.equals(password)) { FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Passwords do not match!", "Passwords do not match!"); throw new ValidatorException(message); } }
@JSFProperty(deferredValueType="java.lang.Boolean") public Object getValue() { return super.getValue(); } }
protected Object getValue(UIComponent uiComponent) { //need this to support conversion. use UIInput or ValueHolder?? if (uiComponent instanceof UIInput) { Object value = ((UIInput) uiComponent).getValue(); if (logger.isLoggable(Level.FINE)) { logger.fine("component.getValue() = " + value + " for component=" + uiComponent.getClientId()); } return value; } return null; }
public void validateEmailAndPassword(FacesContext context, UIComponent component, Object value) throws ValidatorException { UIInput emailComponent = (UIInput) component.getAttributes().get("emailComponent"); String email = (String) emailComponent.getValue(); String password = (String) value; // ... }
private boolean isRowSelected(UIComponent component) { UIInput input = (UIInput) component; Object value = input.getValue(); int currentRowIndex = getCurrentRowIndex(component); return (value != null) && (currentRowIndex == ((Long) value).intValue()); }
@SuppressWarnings("unchecked") @Override public List<Object> getValue() { Object value = super.getValue(); if ( !( value instanceof List<?> ) ) { throw new FacesException( "value of HtmlInputMultiple must be a list" ); } return (List<Object>) value; }
private boolean isRowSelected(UIComponent component) { UIInput input = (UIInput) component; Object value = input.getValue(); int currentRowIndex = getCurrentRowIndex(component); return (value != null) && (currentRowIndex == ((Number) value).intValue()); }
@Override public Object getValue() { if (getValueExpression("value") == null) { throw new IllegalStateException("rowSelector 'value' attribute must be set to an EL expression."); } return super.getValue(); }
@FacesValidator("confirmPasswordValidator") public class ConfirmPasswordValidator implements Validator { @Override public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { UIInput passwordComponent = (UIInput) component.getAttributes().get("passwordComponent"); String password = (String) passwordComponent.getValue(); String confirmPassword = (String) value; if (confirmPassword != null && !confirmPassword.equals(password)) { throw new ValidatorException(new FacesMessage( FacesMessage.SEVERITY_ERROR, "Confirm password is not the same as password", null)); } } }
/** * Ajax event for changing database url. * * @param e AjaxBehavior event */ public void urlChanged(AjaxBehaviorEvent e) { UIInput uiInput = (UIInput) e.getComponent(); String url = uiInput.getValue().toString(); setDbUrl(url); }
/** * Ajax event for changing database username * * @param e AjaxBehavior event */ public void usernameChanged(AjaxBehaviorEvent e) { UIInput uiInput = (UIInput) e.getComponent(); String username = uiInput.getValue().toString(); setDbUsername(username); }
/** * Ajax event for changing database username * * @param e AjaxBehavior event */ public void usernameChanged(AjaxBehaviorEvent e) { UIInput uiInput = (UIInput) e.getComponent(); String username = uiInput.getValue().toString(); setDbUsername(username); }
/** * Ajax event for changing database url. * * @param e AjaxBehavior event */ public void urlChanged(AjaxBehaviorEvent e) { UIInput uiInput = (UIInput) e.getComponent(); String url = uiInput.getValue().toString(); setDbUrl(url); }
public String getValue(FacesContext facesContext, UIComponent uiComponent) { // for input components, get the submitted value if (uiComponent instanceof UIInput) { Object submittedValue = ((UIInput) uiComponent).getSubmittedValue(); if (submittedValue != null && submittedValue instanceof String) { return (String) submittedValue; } } return DomBasicInputRenderer.converterGetAsString(facesContext, uiComponent, ((UIInput) uiComponent).getValue()); } }
public String getValue(FacesContext facesContext, UIComponent uiComponent) { // for input components, get the submitted value if (uiComponent instanceof UIInput) { Object submittedValue = ((UIInput) uiComponent).getSubmittedValue(); if (submittedValue != null && submittedValue instanceof String) { return (String) submittedValue; } } return DomBasicInputRenderer.converterGetAsString(facesContext, uiComponent, ((UIInput) uiComponent).getValue()); }
public Object getValue() { setupPerspective(); Object retValue = innerGetDelegateInput().getValue(); teardownPerspective(); return retValue; } }