當前位置: 首頁>>代碼示例>>Java>>正文


Java UIComponent.setValueExpression方法代碼示例

本文整理匯總了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);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:29,代碼來源:AttributeComponentChange.java

示例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();
}
 
開發者ID:javaee-samples,項目名稱:javaee8-applications,代碼行數:15,代碼來源:ColumnModelController.java

示例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);
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:37,代碼來源:RowKeySetAttributeChange.java


注:本文中的javax.faces.component.UIComponent.setValueExpression方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。