Returns: range-based (not absolute) index within the current range
/**
* 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);
Returns: range-based (not absolute) index within the current range的更多相关文章
- .NET中使用GridView控件输入数据时出现“ Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"的问题
在.NET中使用GridView控件的在线编辑数据时,出现了“ Index was out of range. Must be non-negative and less than the size ...
- Index was out of range
Index was out of range. Must be non-negative and less than the size of the collection. Parameter nam ...
- IUrlHelper ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of ...
- 【C#】【MySQL】【GridView】删除出现Parameter index is out of range
[编程语言]C# [数据库]MySQL [控件]GridView [问题描述]GridView控件中自带[删除],[编辑],[选择],三个按钮[编辑],[选择]正常使用,但是在使用删除时,却报错Par ...
- 关于 NPOI 报 Invalid column index (256). Allowable column range for BIFF8 is (0..255) or ('A'..'IV') 错误的解决办法
当看到这个错误的时候,网上搜索可以会有些说列数有限制之类的说法,这个说法是相对于 Office 2003 的,在 Office 2007 之前,最多只可以创建 列:在 Office 2007 之后, ...
- 向多页TABLE中插入数据时,新增行总是在当前页的最后一行
CODE IN CO OATableBean table = (OATableBean)webBean.findChildRecursive("LineTable"); int n ...
- python文件读书笔记
一.打开文件 1 f=open('text.txt',r) 二.读取文件 print(f.read) 三.关闭文件 f.close() 比较好用的是运用with with open('text.tx ...
- 吴裕雄 python神经网络 水果图片识别(3)
import osimport kerasimport timeimport numpy as npimport tensorflow as tffrom random import shufflef ...
- 吴裕雄 python神经网络 水果图片识别(1)
import osimport numpy as npimport matplotlib.pyplot as pltfrom skimage import color,data,transform,i ...
随机推荐
- 自定义控件--CircleImageView(类似于QQ、微信圆形头像自定义控件)
现在基本上所有的需要用户注册的APP都有一个需要用户上传头像的需求,上传的头像基本都是类似于QQ.微信等社交应用圆形头像.最近,正在做的一个社交应用多处需要用到这种圆形头像的处理,总不能每次都对图片做 ...
- UITabBarController QQ
AppDelegate.m #import "AppDelegate.h" #import "FirstViewController.h" #import &q ...
- Spring(四)Bean注入方试
一.构造方法注入 定义:通过构造函数来完成依赖关系的设定 优缺点: 在构造对象的同时,完成依赖关系的建立 如果关联的对象很多,那和不得不在构造方法上加入过多的参数 基中有index:如果指定索引从0开 ...
- .NET下Excel报表的打印
说明:这是一个实验的小例子,在实际项目中使用时,一般Object[,] 对象的数据来源于数据库. 1. 实验环境 开发平台:Visual Studio 2010 测试模板:JBtest Excel:O ...
- OC字符串的一些常用的函数。
)//获取字符串长度 NSUInteger len= str.length; () //通过指定索引返回对应的字符 unichar ch =[str characterAtIndex:]; ()//通 ...
- 网易新闻iOS版使用的18个开源组件
转载来自:http://www.jianshu.com/p/8952944f7566 原文最后编辑时间:2015.05.19 网易新闻iOS版在开发过程中曾经使用过的第三方开源类库.组件 1.AFN ...
- window平台下的MySQL快速安装。(不好意思,未完成待续,请飘过)
MySQL安装方式 MSI安装(Windows Installer) ZIP安装 最好选择ZIP安装,比较干净,也快速搞好. 下载链接:http://pan.baidu.com/s/1sjFZZul ...
- jquery获取复选框(checkbox)的选中值(一组和单个)
使用jquery获取一组或者单个checkbox的选中状态的值.下面通过一个示例进行说明,假设现有一页面有一组checkbox的name的值为id,那么获取这组name=id的checkbox的值的方 ...
- CANopen DS301协议中文翻译V03版
V0.1版PDF格式供下载参考,只是全面框架翻译,会有大量错误和不确定的地方,希望读者积极参与校对,提供修改意见,完善译文.下载 V0.2版校对提前完成,下载地址 V0.3版使用GitBook编辑(h ...
- (转)github设置添加SSH
很多朋友在用github管理项目的时候,都是直接使用https url克隆到本地,当然也有有些人使用 SSH url 克隆到本地.然而,为什么绝大多数人会使用https url克隆呢? 这是因为,使用 ...