我正在开发一个mater-detail页面,我可以在详细信息表(AstAssetReturnsVO)中插入一个新行并将其引用键设置为主表的ID(AstAssetsVO) 。代码在我进入JSFF调用之前作为方法调用活动的一部分运行。在adf中使用getCurrentRow时发生java.lang.NullPointerException
由于某种原因,我得到NullPointerException,当它到达下面的标记行,我不知道为什么getCurrentRow返回一个空指针。我检查了文档here,它应该返回与数据控件的当前行对应的迭代器的当前行。
请让我知道我可能做错了什么。
此致
public void assetReturnInitialization(){
getAstAssetReturnsVO().clearCache();
getAstAssetReturnsVO().executeEmptyRowSet();
Row row = getAstAssetReturnsVO().createRow();
row.setAttribute("Stat", 99);
row.setAttribute("AsrtDate", "1396/12/31");
getAstAssetsVO().executeQuery();
Row assetRow = getAstAssetsVO().getCurrentRow(); <<<<<<< ERROR OCCURS HERE
row.setAttribute("AsetId", assetRow.getAttribute("Id"));
getAstAssetsVO().getCurrentRow().setAttribute("Status", "Returned".toUpperCase());
getAstAssetReturnsVO().insertRow(row);
getAstAssetReturnsVO().setCurrentRow(row);
return ;
}
检查getAstAssetsVO()是否在那里返回null。 –
已检查...不是这种情况。 –