2013-05-07 45 views
0

我想使用ADF mobile中的迭代器以编程方式读取数据。我的代码是:使用Oracle中的迭代器以编程方式检索数据ADF Mobile

try { 
    ValueExpression vex = AdfmfJavaUtilities.getValueExpression("#{bindings.WeatherDescriptionIterator}", Object.class); 
    AmxIteratorBinding iter = (AmxIteratorBinding)vex.getValue(AdfmfJavaUtilities.getAdfELContext()); 
    GenericType row = null; 
    BasicIterator bIter = iter.getIterator(); 
    iter.getIterator().first(); 
    ArrayList employees = new ArrayList(); 
    for(int i = 0; i < iter.getIterator().getTotalRowCount(); i++) { 
     row = (GenericType)iter.getCurrentRow(); 
     String phone = ""; 
     String email = ""; 
     if(row.getAttribute("Description") != null) 
      phone = row.getAttribute("Description").toString(); 
     if(row.getAttribute("WeatherID") != null) 
      email = row.getAttribute("WeatherID").toString(); 

     setTempValue(phone + " " + email); 

     iter.getIterator().next(); 

    } 
} 
catch(Exception e1) { 
    AdfException ex = new AdfException(""+e1.getLocalizedMessage(), AdfException.ERROR); 
    throw ex; 
} 

我得到错误: - >不能找不到属性绑定

回答

0

的表达应该是: ValueExpression VEX = AdfmfJavaUtilities.getValueExpression( “#bindings.WeatherDescriptionIterator.iteratorBinding}”,对象。类);