CODE IN CO
OATableBean table = (OATableBean)webBean.findChildRecursive("LineTable"); int numOfRowsDisplay = table.getNumberOfRowsDisplayed(); Serializable[] param01 = { new Number(numOfRowsDisplay) }; Class[] classType = new Class[] { Number.class, }; am.invokeMethod("addPlanLines", param01, classType);
CODE IN AM
public void addPlanLines(Number numOfDisplay) { OADBTransaction tsn = this.getOADBTransaction(); CuxPosAuditPlanLinesFullVOImpl lineVO = getCuxPosAuditPlanLinesFullVO(); Number planId = getPlanId(); lineVO.setMaxFetchSize(0); if (!lineVO.isPreparedForExecution()) { lineVO.setWhereClause(null); lineVO.executeQuery(); } RowSet localRowSet = lineVO.getRowSet(); int i = 1; int j = numOfDisplay.intValue(); int rangeStart = localRowSet.getRangeStart(); int rangeSize = localRowSet.getRangeSize(); int rowCountInRange = localRowSet.getRowCountInRange(); int i1; if (rowCountInRange + i <= j) i1 = rowCountInRange; else { i1 = j - i; } CuxPosAuditPlanLinesFullVORowImpl row = (CuxPosAuditPlanLinesFullVORowImpl)lineVO.createRow(); if (rangeSize < i1) { rangeSize++; localRowSet.setRangeSize(rangeSize); localRowSet.setRangeStart(rangeStart); } row.setPlanId(planId); Number pk = getSequenceValue("CUX_POS_AUDIT_PLAN_LINES_S"); row.setLineId(pk); row.setOrgId(new Number(tsn.getOrgId())); row.setOrgName(getOrgName(tsn.getOrgId())); localRowSet.insertRowAtRangeIndex(i1, row); localRowSet.setCurrentRowAtRangeIndex(i1); }
方法二:
/** * This method is for use with UI Table addRows buttons that require the * addition of multiple rows; given a RowIterator (such as a VO) and the * number of rows the caller needs to add, this method figures out where * the caller should start adding rows in order to comply with the BLAF * standard that newly added rows should go into the bottom of the current * table range (which is the same as the RowIterator range if things are * set up properly), pushing rows into the next range if necessary * * Returns: range-based (not absolute) index within the current range */ public static int getStartIndexForMultiInsert(RowIterator rowIt, int numRowsToAdd) { int numRowsInRange = rowIt.getRowCountInRange(); int rangeSize = rowIt.getRangeSize(); int firstIndexAtWhichToAdd = 0; int numOpenSlotsInRange = (rangeSize - numRowsInRange); if (rowIt.getRangeSize() < rangeSize) { rowIt.setRangeSize(rangeSize); } if (numOpenSlotsInRange < numRowsToAdd) { firstIndexAtWhichToAdd = rangeSize - numRowsToAdd; } else { firstIndexAtWhichToAdd = numRowsInRange; } return firstIndexAtWhichToAdd; } 调用: int indexForRowInserts = getStartIndexForMultiInsert(vo, 1); vo.insertRowAtRangeIndex(indexForRowInserts,row);
方法三:
这种方法有点小问题:
仅仅在第一页有效,应该可以再修改修改,懒得改了
calculVO.insertRow(row); int fetched = calculVO.getFetchedRowCount(); fetched = fetched > 9 ? 9 : fetched; if (fetched > 0) { int current = fetched % 10; if (current == 0) { fetched = 9; } else { fetched = current > 9 ? 9 : current; } } calculVO.insertRowAtRangeIndex(fetched, row);
分类:
OAF开发
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
· Apache Tomcat RCE漏洞复现(CVE-2025-24813)