/**
* 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仿京东分类菜单之UICollectionView内容

    在上<iOS仿京东分类菜单实例实现>已经实现了大部分主体的功能,本文是针对右边集合列表进行修改扩展,使它达到分组的效果,本文涉及到的主要是UICollectionView的知识内容,左边列 ...

  2. IOS 友盟使用详解

    IOS 友盟使用详解 这篇博客将会详细介绍友盟的使用,希望对博友们有所帮助. 首先我们在浏览器上搜索友盟. 在这里我们选择官网这个,进去友盟官网后我们按照下图进行选择. 接下来选择如下图 Next 这 ...

  3. IOS 网络浅析-(三 NSURLConnection代理)

    对于现在的iOS开发,用法简单,最古老最经典最直接的NSURLConnection的作用不是很大,但是作为一名ios开发者,我们应该拥有一颗热爱学习的心,下面通过代码的实现简单介绍一下NSURLCon ...

  4. Mac上的软件使用介绍

    目录大纲: Drop to GIF Parallels Desktop 1.Drop to GIF 功能:将视频文件可以生产动态图gif文件 网址在github上:https://github.com ...

  5. java获取时间戳的方法

    JAVA 获取当前月的初始时间的时间戳 public static long getMonthFirstDay() { Calendar calendar = Calendar.getInstance ...

  6. Jmeter代理录制脚本

    录制的原理: 1.LR/Jmeter录制是针对网络通讯协议层面的,它只关心客户端与服务器端的通讯包2.LR/Jmeter的并发测试实际上就是并发客户端与服务器端的通讯过程3.压力是通过多进程/多线程方 ...

  7. session实现购物系统的简例和application实现统计页面访问次数的简例

    login.jsp <body>  <form action="checkLogin.jsp">  <table>  <tr>< ...

  8. Linux之存储及文件系统管理

    一.存储管理 1.各种存储设备在Linux系统中对应的文件名 2.硬盘结构及分区 1).硬盘结构 2) .为什么要进行硬盘分区: a) 更容易管理和控制系统,因为相关的文件和目录都放在一个分区中. b ...

  9. 第一次wubi安装Ubuntu的经历及所走的弯路

    #安装目标:利用xp存储剩余空间安装ubuntu, 形成双系统. 整理出待安装的磁盘空间 #需要无损磁盘工具, 用了"傲梅分区助手", 偷懒没有选其他高大上的英文软件. XP下硬盘 ...

  10. 认识与学习 BASH

    2015-08-03摘自鸟哥 什么是变量? 那么,什么是『变量』呢?简单的说,就是让某一个特定字符串代表不固定的内容就是了.举个大家在国中都会学到的数学例子, 那就是:『 y = ax + b 』这东 ...