嗨,我正在使用Jdeveloper的oracle-adf。我試圖用valuechangelisteroracle adf Valuechangelistener空指針異常
<af:inputText label="#{bindings.CurrentOwner.hints.label}" id="it9"
value="#{bindings.CurrentOwner.inputValue}"
required="#{bindings.CurrentOwner.hints.mandatory}"
columns="#{bindings.CurrentOwner.hints.displayWidth}"
maximumLength="#{bindings.CurrentOwner.hints.precision}"
valueChangeListener="#{bindings.createNewRow1.execute}">
<f:validator binding="#{bindings.CurrentOwner.validator}"/>
</af:inputText>
但當我讀它,它的對象E返回空指針異常。
public void createNewRow(ValueChangeEvent e){
//get he EmployeeViewImpl class instance
AssetHistoryVOImpl vo=this.getAssetHistory1();
AssetsUserVOImpl assets=this.getAssetsUser1();
System.out.println("one");
// Create new row to insert data
oracle.jbo.Row r_history=vo.createRow();;
oracle.jbo.Row r_assets=assets.getCurrentRow();
System.out.println("two");
String newValue;
newValue = e.getNewValue().toString();// null pointer exception happens here
System.out.println("three");
String test = (String)r_assets.getAttribute("CurrentOwner");
System.out.println("this is test "+newValue);
我已經導入了javax.faces.event.ValueChangeEvent。我在網上查找了很多教程,這基本上是他們所做的,但由於某些原因,參數對象爲NULL。
任何人都可以提供一些見解嗎?
謝謝:)