Dear Experts,
I have the below java code as part of an application module java code which creates and inserts a new row.
The problem is that when call it, the required field error message pops up although the user hasn't commit the changes and he is supposed fill in the required fields.
I am looking for a way to suppress the validation until the next commit operation.
Any clue/suggestion is much appreciate it.
Jake
Attribute "receiving personnel" in Ast Exchange Items is required. |
| public String addNewEchangeItemRow(Object newExchangeId, String Id, String OwnerId) { |
| _logger.info("addNewEchangeItemRow start"); |
| |
| DCBindingContainer bindings = (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry(); |
| |
| ViewObjectImpl astExchangeItemsVO = getAstExchangeItemsVO(); | |
| RowSetIterator rsi = astExchangeItemsVO.findRowSetIterator("AstExchangeItemsVOIterator"); |
| |
| if (rsi == null) |
| rsi = astExchangeItemsVO.findRowSetIterator(null); |
| |
| //get handle to the last row |
| Row lastRow = rsi.last(); |
| |
| //obtain the index of the last row |
| int lastRowIndex = rsi.getRangeIndexOf(lastRow); |
| |
| //create a new row |
| Row newRow = rsi.createRow(); |
| |
| //initialize the row |
| newRow.setNewRowState(Row.STATUS_INITIALIZED); |
| |
| |
| // setup new attributes |
| newRow.setAttribute("AsetId", Id); |
| newRow.setAttribute("PrsnId", OwnerId); |
| newRow.setAttribute("Id", newExchangeId); |
| |
| //add row to last index + 1 so it becomes last in the range set |
| rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow); |
| |
| //make row the current row so it is displayed correctly |
| rsi.setCurrentRow(newRow); | |
| _logger.info("addNewEchangeItemRow end"); |
| return null; |
| } |