本文整理匯總了Java中javax.faces.component.UIComponent.setValueExpression方法的典型用法代碼示例。如果您正苦於以下問題:Java UIComponent.setValueExpression方法的具體用法?Java UIComponent.setValueExpression怎麽用?Java UIComponent.setValueExpression使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.faces.component.UIComponent
的用法示例。
在下文中一共展示了UIComponent.setValueExpression方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: changeComponent
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
@SuppressWarnings("deprecation")
public void changeComponent(UIComponent uiComponent)
{
Map<String, Object> attributeMap = uiComponent.getAttributes();
// if the attributevalue is a ValueExpression or ValueBinding, use the
// appropriate setValueExpression/setValueBinding call and remove the
// current attribute value, if any, so that the ValueExpression/ValueBinding
// can take precedence
if (_attributeValue instanceof ValueExpression)
{
uiComponent.setValueExpression(_attributeName, (ValueExpression)_attributeValue);
attributeMap.remove(_attributeName);
}
else if (_attributeValue instanceof ValueBinding)
{
uiComponent.setValueBinding(_attributeName, (ValueBinding)_attributeValue);
attributeMap.remove(_attributeName);
}
else
{
attributeMap.put(_attributeName, _attributeValue);
}
}
示例2: updateColumns
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
* Called as preprocessor to export (after clicking Excel icon) to capture
* the table component and call upon createDynamicColumns()
*
* @since 2.7.5
*/
public void updateColumns() {
//reset table state
UIComponent table = FacesContext.getCurrentInstance().getViewRoot().findComponent(":customerExportForm:customerTable");
table.setValueExpression("sortBy", null);
//update columns
createDynamicColumns();
}
示例3: changeComponent
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@Override
@SuppressWarnings("deprecation")
public void changeComponent(UIComponent component)
{
Map<String, Object> attributeMap = component.getAttributes();
Object newAttributeValue = getAttributeValue();
String attrName = getAttributeName();
if ((newAttributeValue instanceof RowKeySet) || (newAttributeValue == null))
{
// Specially handle RowKeySet case by replacing the contents of the RowKeySet in-place
// rather than replacing the entire object. This keeps the mutable object instance from
// changing
_updateRowKeySetInPlace(component, attrName, (RowKeySet)newAttributeValue);
}
else if (newAttributeValue instanceof ValueExpression)
{
// if the new attribute value is a ValueExpession, set it and remove the old value
// so that the ValueExpression takes precedence
component.setValueExpression(attrName, (ValueExpression)newAttributeValue);
attributeMap.remove(attrName);
}
else if (newAttributeValue instanceof ValueBinding)
{
// if the new attribute value is a ValueBinding, set it and remove the old value
// so that the ValueBinding takes precedence
component.setValueBinding(attrName, (ValueBinding)newAttributeValue);
attributeMap.remove(attrName);
}
else
{
// perform the default behavior
attributeMap.put(attrName, newAttributeValue);
}
}