private Object getSubmittedValue(UIInput input) { return input.getSubmittedValue() == null && input.isLocalValueSet() ? input.getValue() : input.getSubmittedValue(); } }
@Override public boolean isLocalValueSet() { return getWrapped().isLocalValueSet(); }
@Override public boolean isLocalValueSet() { return getWrapped().isLocalValueSet(); }
/** * <p class="changed_added_2_2">If there is a local value, return it, * otherwise return the result of calling {@code super.getVaue()}.</p> * * @since 2.2 */ @Override public Object getValue() { return isLocalValueSet() ? getLocalValue() : super.getValue(); }
/** * <p class="changed_added_2_2">If there is a local value, return it, * otherwise return the result of calling {@code super.getVaue()}.</p> * * @since 2.2 */ @Override public Object getValue() { return isLocalValueSet() ? getLocalValue() : super.getValue(); }
/** * <p class="changed_added_2_2">If there is a local value, return it, * otherwise return the result of calling {@code super.getVaue()}.</p> * * @since 2.2 */ @Override public Object getValue() { return isLocalValueSet() ? getLocalValue() : super.getValue(); }
/** * <p class="changed_added_2_2">If there is a local value, return it, * otherwise return the result of calling {@code super.getVaue()}.</p> * * @since 2.2 */ @Override public Object getValue() { return isLocalValueSet() ? getLocalValue() : super.getValue(); }
/** * <p class="changed_added_2_2">If there is a local value, return it, * otherwise return the result of calling {@code super.getVaue()}.</p> * * @since 2.2 */ @Override public Object getValue() { return isLocalValueSet() ? getLocalValue() : super.getValue(); }
/** * <p class="changed_added_2_2">If there is a local value, return it, * otherwise return the result of calling {@code super.getVaue()}.</p> * * @since 2.2 */ @Override public Object getValue() { return isLocalValueSet() ? getLocalValue() : super.getValue(); }
public Object getValue() { if (isLocalValueSet()) { return getLocalValue(); } return super.getValue(); }
/** * <p class="changed_added_2_2">If there is a local value, return it, * otherwise return the result of calling {@code super.getVaue()}.</p> * * @since 2.2 */ @Override public Object getValue() { return isLocalValueSet() ? getLocalValue() : super.getValue(); }
/** * <p class="changed_added_2_2">If there is a local value, return it, * otherwise return the result of calling {@code super.getVaue()}.</p> * * @since 2.2 */ @Override public Object getValue() { return isLocalValueSet() ? getLocalValue() : super.getValue(); }
/** * Return the current value of this component. * <p> * If a submitted value has been converted but not yet pushed into the * model, then return that locally-cached value (see isLocalValueSet). * <p> * Otherwise, evaluate an EL expression to fetch a value from the model. */ public Object getValue() { if (isLocalValueSet()) { return super.getLocalValue(); } return super.getValue(); }
public boolean isLocalValueSet() { setupPerspective(); boolean retVal = innerGetDelegateInput().isLocalValueSet(); teardownPerspective(); return retVal; }
@Produces @Dependent @InputField public Object getInputFieldValue(final InjectionPoint ip) { Object result = null; if (isInitialized()) { String id = getFieldId(ip); UIInput component = findComponent(id, id); components.put(id, component); if (component.isLocalValueSet()) { result = component.getValue(); } else { Converter converter = component.getConverter(); if (converter != null) { result = converter.getAsObject(context, component, (String) component.getSubmittedValue()); } else { result = component.getSubmittedValue(); } } } return result; }
/** * Returns the value of the given input component whereby any unconverted submitted string value will immediately * be converted/validated as this method is called. This method thus always returns the converted/validated value. * @param <T> The expected return type. * @param input The input component to obtain the converted/validated value for. * @return The converted/validated value of the given input component. * @throws ClassCastException When <code>T</code> is of wrong type. * @since 1.2 */ @SuppressWarnings("unchecked") public static <T> T getImmediateValue(UIInput input) { if (input.isValid() && input.getSubmittedValue() != null) { input.validate(getContext()); } return input.isLocalValueSet() ? (T) input.getValue() : null; }
/** * Returns the value of the given input component whereby any unconverted submitted string value will immediately * be converted/validated as this method is called. This method thus always returns the converted/validated value. * @param <T> The expected return type. * @param input The input component to obtain the converted/validated value for. * @return The converted/validated value of the given input component. * @throws ClassCastException When <code>T</code> is of wrong type. * @since 1.2 */ @SuppressWarnings("unchecked") public static <T> T getImmediateValue(UIInput input) { if (input.isValid() && input.getSubmittedValue() != null) { input.validate(getContext()); } return input.isLocalValueSet() ? (T) input.getValue() : null; }
@Produces @Dependent public InputElement produceInputElement(final InjectionPoint ip) { if (isInitialized()) { String id = ip.getMember().getName(); UIInput component = findComponent(id, id); components.put(id, component); InputElement inputElementResult = new InputElement(id, component.getClientId(context), component); if (component.isLocalValueSet()) { inputElementResult.setValue(component.getValue()); } else { Converter converter = component.getConverter(); if (converter != null) { Object value = converter.getAsObject(context, component, (String) component.getSubmittedValue()); inputElementResult.setValue(value); } else { inputElementResult.setValue(component.getSubmittedValue()); } } return inputElementResult; } return null; }
public void updateModel(FacesContext context) { AssertionUtil.assertNotNull("context", context); if (!isValid() || !isLocalValueSet()) { return; } final ValueBinding valueBinding = getValueBinding("value"); if (valueBinding == null) { return; } try { final Object localValue = getLocalValue(); valueBinding.setValue(context, localValue); setValue(null); setLocalValueSet(false); } catch (RuntimeException e) { Object[] args = { UIComponentUtil.getLabel(this) }; context.getExternalContext().log(e.getMessage(), e); FacesMessageUtil.addErrorComponentMessage(context, this, CONVERSION_MESSAGE_ID, args); setValid(false); } }
public void updateModel(FacesContext context) { if (!isValid()) return; if (!isLocalValueSet()) return; ValueExpression expression = getValueExpression("value"); if (expression == null) return; try { expression.setValue(context.getELContext(), getLocalValue()); setValue(null); setLocalValueSet(false); } catch (Exception e) { context.getExternalContext().log(e.getMessage(), e); _MessageUtils.addErrorMessage(context, this, UPDATE_MESSAGE_ID, new Object[]{_MessageUtils.getLabel(context,this)}); setValid(false); /* we are not allowed to throw exceptions here - we still need the full stack-trace later on * to process it later in our error-handler */ queueExceptionInRequest(context, expression, e); } }