public void encodeEnd(FacesContext context, UIComponent component) throws IOException { super.encodeEnd(context, component); if (isTextSet) { UICommand command = (UICommand)component; command.setValue(null); isTextSet = false; } if (isStyleSet) { String styleClass = (String) component.getAttributes().get(STYLE_CLASS_PROP); component.getAttributes().put(STYLE_CLASS_PROP, removeStyleClass(styleClass, UNINITITIALIZED_STYLE_CLASS)); isStyleSet = false; } }
public void encodeBegin(FacesContext context, UIComponent component) throws IOException { if (UICommand.class.isAssignableFrom(component.getClass())) { ValueBinding valueBinding = component.getValueBinding(VALUE_PROP); //NOI18N UICommand command = (UICommand) component; Object value = command.getValue(); if (valueBinding != null && (value == null || value.toString().length() == 0)) { Object dummyValue = getDummyData(context, valueBinding); command.setValue(dummyValue); isTextSet = true; } else if (needsShadowText(command)) { command.setValue(getShadowText()); String styleClass = (String) component.getAttributes().get(STYLE_CLASS_PROP); component.getAttributes().put(STYLE_CLASS_PROP, addStyleClass(styleClass, UNINITITIALIZED_STYLE_CLASS)); isTextSet = true; isStyleSet = true; } } super.encodeBegin(context, component); }
((UICommand)component).setValue(value);
((UICommand) component).setValue(value);
((UICommand)component).setValue(value);
((UICommand)component).setValue(value);
((UICommand)component).setValue(value);
((UICommand)component).setValue(value);
((UICommand) component).setValue(value);
( (UICommand) component ).setValue( metawidget.getLabelString( attributes ) );
( (UICommand) component ).setValue( metawidget.getLabelString( attributes ) );
protected void setValueProperty(UIComponent component, ValueExpression expression) { if (expression != null) { String value = expression.getExpressionString(); if (!expression.isLiteralText()) { component.setValueExpression("value", expression); } else if (component instanceof UICommand) { ((UICommand) component).setValue(value); } else if (component instanceof UIParameter) { ((UIParameter) component).setValue(value); } else if (component instanceof UISelectBoolean) { ((UISelectBoolean) component).setValue(Boolean.valueOf(value)); } else if (component instanceof UIGraphic) { ((UIGraphic) component).setValue(value); } // Since many input components are ValueHolders the special // components // must come first, ValueHolder is the last resort. else if (component instanceof ValueHolder) { ((ValueHolder) component).setValue(value); } else { component.getAttributes().put("value", value); } } }
((UICommand) component).setValue(value.getExpressionString());
((UICommand)component).setValue(value.getExpressionString());
((UICommand)component).setValue(value);
((UICommand)component).setValue(value.getExpressionString());
((UICommand)component).setValue(value.getExpressionString());
((UICommand) component).setValue(value.getExpressionString());