return true; Object actualValue = bindStatus.getActualValue(); if (actualValue != null && actualValue != boundValue && ObjectUtils.nullSafeEquals(actualValue, candidateValue)) {
return true; Object actualValue = bindStatus.getActualValue(); if (actualValue != null && actualValue != boundValue && ObjectUtils.nullSafeEquals(actualValue, candidateValue)) {
@Override public Object getActualValue() { return this.bindStatus.getActualValue(); }
public Object getValue(String field) { BindStatus status = getFieldStatus(field); if (status != null) { return status.getActualValue(); } return null; }
private boolean isSelected(Object resolvedValue) { BindStatus bindStatus = getBindStatus(); return bindStatus == null || bindStatus.getValue() == null || bindStatus.getActualValue() == null; }
return true; Object actualValue = bindStatus.getActualValue(); if (actualValue != null && actualValue != boundValue && ObjectUtils.nullSafeEquals(actualValue, candidateValue)) {
return bindStatus == null || bindStatus.getValue() == null || bindStatus.getActualValue() == null;
@Override protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final BindStatus bindStatus, final IElementTagStructureHandler structureHandler) { String name = bindStatus.getExpression(); name = (name == null? "" : name); final String id = computeId(context, tag, name, false); // Thanks to precedence, this should have already been computed final String type = tag.getAttributeValue(this.typeAttributeDefinition.getAttributeName()); // Apply the conversions (editor), depending on type (no conversion for "number" and "range" // Also, no escaping needed as attribute values are always escaped by default final String value = applyConversion(type)? ValueFormatterWrapper.getDisplayString(bindStatus.getValue(), bindStatus.getEditor(), true) : ValueFormatterWrapper.getDisplayString(bindStatus.getActualValue(), true); StandardProcessorUtils.setAttribute(structureHandler, this.idAttributeDefinition, ID_ATTR_NAME, id); // No need to escape: this comes from an existing 'id' or from a token StandardProcessorUtils.setAttribute(structureHandler, this.nameAttributeDefinition, NAME_ATTR_NAME, name); // No need to escape: this is a java-valid token StandardProcessorUtils.setAttribute( structureHandler, this.valueAttributeDefinition, VALUE_ATTR_NAME, RequestDataValueProcessorUtils.processFormFieldValue(context, name, value, type)); }
@Override protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final BindStatus bindStatus, final IElementTagStructureHandler structureHandler) { String name = bindStatus.getExpression(); name = (name == null? "" : name); final String id = computeId(context, tag, name, false); // Thanks to precedence, this should have already been computed final String type = tag.getAttributeValue(this.typeAttributeDefinition.getAttributeName()); // Apply the conversions (editor), depending on type (no conversion for "number" and "range" // Also, no escaping needed as attribute values are always escaped by default final String value = applyConversion(type)? ValueFormatterWrapper.getDisplayString(bindStatus.getValue(), bindStatus.getEditor(), true) : ValueFormatterWrapper.getDisplayString(bindStatus.getActualValue(), true); StandardProcessorUtils.setAttribute(structureHandler, this.idAttributeDefinition, ID_ATTR_NAME, id); // No need to escape: this comes from an existing 'id' or from a token StandardProcessorUtils.setAttribute(structureHandler, this.nameAttributeDefinition, NAME_ATTR_NAME, name); // No need to escape: this is a java-valid token StandardProcessorUtils.setAttribute( structureHandler, this.valueAttributeDefinition, VALUE_ATTR_NAME, RequestDataValueProcessorUtils.processFormFieldValue(context, name, value, type)); }
@Override protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final BindStatus bindStatus, final IElementTagStructureHandler structureHandler) { String name = bindStatus.getExpression(); name = (name == null? "" : name); final String id = computeId(context, tag, name, false); // Thanks to precedence, this should have already been computed final String type = tag.getAttributeValue(this.typeAttributeDefinition.getAttributeName()); // Apply the conversions (editor), depending on type (no conversion for "number" and "range" // Also, no escaping needed as attribute values are always escaped by default final String value = applyConversion(type)? ValueFormatterWrapper.getDisplayString(bindStatus.getValue(), bindStatus.getEditor(), true) : ValueFormatterWrapper.getDisplayString(bindStatus.getActualValue(), true); StandardProcessorUtils.setAttribute(structureHandler, this.idAttributeDefinition, ID_ATTR_NAME, id); // No need to escape: this comes from an existing 'id' or from a token StandardProcessorUtils.setAttribute(structureHandler, this.nameAttributeDefinition, NAME_ATTR_NAME, name); // No need to escape: this is a java-valid token StandardProcessorUtils.setAttribute( structureHandler, this.valueAttributeDefinition, VALUE_ATTR_NAME, RequestDataValueProcessorUtils.processFormFieldValue(context, name, value, type)); }
@Override protected void doProcess(final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final BindStatus bindStatus, final IElementTagStructureHandler structureHandler) { String name = bindStatus.getExpression(); name = (name == null? "" : name); final String id = computeId(context, tag, name, false); // Thanks to precedence, this should have already been computed final String type = tag.getAttributeValue(this.typeAttributeDefinition.getAttributeName()); // Apply the conversions (editor), depending on type (no conversion for "number" and "range" // Also, no escaping needed as attribute values are always escaped by default final String value = applyConversion(type)? ValueFormatterWrapper.getDisplayString(bindStatus.getValue(), bindStatus.getEditor(), true) : ValueFormatterWrapper.getDisplayString(bindStatus.getActualValue(), true); StandardProcessorUtils.setAttribute(structureHandler, this.idAttributeDefinition, ID_ATTR_NAME, id); // No need to escape: this comes from an existing 'id' or from a token StandardProcessorUtils.setAttribute(structureHandler, this.nameAttributeDefinition, NAME_ATTR_NAME, name); // No need to escape: this is a java-valid token StandardProcessorUtils.setAttribute( structureHandler, this.valueAttributeDefinition, VALUE_ATTR_NAME, RequestDataValueProcessorUtils.processFormFieldValue(context, name, value, type)); }