public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
OAApplicationModule am=(OAApplicationModule)pageContext.getApplicationModule(webBean);
OAViewObject vo = (OAViewObject)am.findViewObject(“XXAddRowVO1″);
String refpono=””;
if(“AddRowEvent”.equals(pageContext.getParameter(“event”)))
{
int rs=0;
String rowRef1 = pageContext.getParameter(“evtSrcRowRef”);
OARow Porowref = (OARow)am.findRowByRef(rowRef1);
refpono=Porowref.getAttribute(“Segment1”).toString();
if(vo!=null)
{
vo.setRangeSize(vo.getFetchedRowCount());
vo.setRangeStart(0);
Row[] rows=vo.getAllRowsInRange();
if(rows.length==1)
{
Row row=vo.createRow();
vo.setCurrentRow(vo.last());
vo.next();
vo.insertRow(row);
}
else
{
for(XXAddRowVORowImpl ForAddrow=(XXAddRowVORowImpl)vo.first(); ForAddrow!=null; ForAddrow=(XXAddRowVORowImpl)vo.next())
{
String ForPonum=(new StringBuilder()).append(ForAddrow.getSegment1()).append(“”).toString();
if(!ForPonum.equals(refpono)) {
rs=rs+1;
}
else if(ForPonum.equals(refpono))
{
if(rs==0)
{
Row row=vo.createRow();
vo.next();
vo.insertRow(row);
}else
{
if(rs==rows.length)
{
Row row=vo.createRow();
vo.next();
vo.insertRow(row);
}
else {
Row row=vo.createRow();
vo.insertRowAtRangeIndex((rs+1),row);
}
}
}
}
}
}
}
}