/**
* 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的更多相关文章

  1. .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 ...

  2. Index was out of range

    Index was out of range. Must be non-negative and less than the size of the collection. Parameter nam ...

  3. 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 ...

  4. 【C#】【MySQL】【GridView】删除出现Parameter index is out of range

    [编程语言]C# [数据库]MySQL [控件]GridView [问题描述]GridView控件中自带[删除],[编辑],[选择],三个按钮[编辑],[选择]正常使用,但是在使用删除时,却报错Par ...

  5. 关于 NPOI 报 Invalid column index (256). Allowable column range for BIFF8 is (0..255) or ('A'..'IV') 错误的解决办法

    当看到这个错误的时候,网上搜索可以会有些说列数有限制之类的说法,这个说法是相对于 Office 2003 的,在 Office 2007 之前,最多只可以创建  列:在 Office 2007 之后, ...

  6. 向多页TABLE中插入数据时,新增行总是在当前页的最后一行

    CODE IN CO OATableBean table = (OATableBean)webBean.findChildRecursive("LineTable"); int n ...

  7. python文件读书笔记

    一.打开文件 1 f=open('text.txt',r)  二.读取文件 print(f.read) 三.关闭文件 f.close() 比较好用的是运用with with open('text.tx ...

  8. 吴裕雄 python神经网络 水果图片识别(3)

    import osimport kerasimport timeimport numpy as npimport tensorflow as tffrom random import shufflef ...

  9. 吴裕雄 python神经网络 水果图片识别(1)

    import osimport numpy as npimport matplotlib.pyplot as pltfrom skimage import color,data,transform,i ...

随机推荐

  1. 【读书笔记】iOS-Objective-C对C的扩展基础知识

    一,Xcode的.m扩展名表示文件含有Objective-C代码,应由Objective-C编译器处理.C编译器处理名称以.c结尾的文件,而C++编译器处理.cpp文件.在Xcode中,所有这些编译工 ...

  2. [转]android访问网络:java.net.ConnectException: localhost/127.0.0.1:8888 - Connection refused

    这对刚学会向tomcat模拟的本地服务器发送请求的同学非常重要! 转自:http://wing123.iteye.com/blog/1873763 描述:在做注册功能的时候,向本地服务器:127.0. ...

  3. Office 2013 激活工具

    早上装机,顺便装了下Office 2013,界面还是不错的.网上找了下相关的激活工具. 发现还是独木成林做的最好呀,直接把别人的链接给拿过来好了,下载地址 http://pan.baidu.com/s ...

  4. Visual Studio发布Web项目报错:Unable to add 'xxx' to the Web site. Unable to add file 'xxx'. The specified file could not be encrypted.

    背景 Visual Studio下的Web项目 现象 发布时遇到Unable to add 'xxx' to the Web site.  Unable to add file 'xxx'. The ...

  5. Erlang 程序引发共享内存 bug 的一个例子

    虽然 Erlang 的广告说得非常好,functional.share-nothing.消息传递,blah blah 的,好像用 Erlang 写并发程序就高枕无忧了,但是由于 Erlang 信奉高度 ...

  6. HDU 4049 Tourism Planning(动态规划)

    Tourism Planning Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  7. JDK自带工具一览表。妈妈再也不用担心你到处去下载小软件了~~

    原来JDK早早就给我准备好了要用到的工具..反编译,JVM性能监视.诊断. JDK(Java Development Kit)是Java程序员最核心的开发工具,没有之一. JDK是一个功能强大的Jav ...

  8. fis自动化部署

    1,自动部署到远程服务器 (1),参考:https://github.com/fex-team/receiver (2),接收服务代码目录:/var/www/html/fis/receiver-mas ...

  9. 虚拟机Linux----Ubuntu1204----退格键方向键无法使用

    修改 /etc/vim/vimrc.tiny,如下: set compatible #修改为 set nocompatible #控制方向键set backspace=2 #控制退格键

  10. Linux 系统常用命令汇总(七) 安全设置

     安全设置 分类 命令 选项 注解 安全策略 selinux setenforce number(0,1) 设置selinux状态,0关闭,1开启 getenforce 显示当前selinux状态,e ...