Hi,
On query region we can capture the Go button click and execute our own search along with Standard Search.
OAApplicationModule ap = (OAApplicationModule)pageContext.getApplicationModule(webBean);
OAQueryBean bean = (OAQueryBean)webBean.findIndexedChildRecursive("queryRN");
if(bean!=null)
{
String id = (String)bean.getGoButtonName();
if(pageContext.getParameter(id)!=null)
{
ap.invokeMethod("initsearch",params);
}
public void initsearch(String fromnum,String tonum,String fromdate,String todate)
{
String whereClause = null;
int whereClausecount = 0;
OAViewObject vo = (OAViewObject)getReprintInvoiceVO1();
vo.setWhereClause(null);
vo.setWhereClauseParams(null);
if(fromnum!=null&&!("".equals(fromnum.trim())))
{
whereClause = "INVOICE_NUMBER >= :1" ;
vo.setWhereClauseParam(whereClausecount,fromnum);
whereClausecount++;
}
if(tonum!=null&&!("".equals(tonum.trim())))
{
if(whereClause!=null)
{
whereClause = whereClause +" AND INVOICE_NUMBER <= :2";
vo.setWhereClauseParam(whereClausecount,tonum);
whereClausecount++;
}
else
{
whereClause = "INVOICE_NUMBER <= :1";
vo.setWhereClauseParam(whereClausecount,tonum);
whereClausecount++;
}
}
if(fromdate!=null&&!("".equals(fromdate.trim())))
{
if(whereClause!=null)
{
if((fromnum!=null&&!("".equals(fromnum.trim())))&&(tonum!=null&&!("".equals(tonum.trim()))))
{
whereClause = whereClause +" AND INVOICE_DATE > = :3";
vo.setWhereClauseParam(whereClausecount,fromdate);
whereClausecount++;
}
else
{
whereClause = whereClause +" AND INVOICE_DATE > = :2";
vo.setWhereClauseParam(whereClausecount,fromdate);
whereClausecount++;
}
}
else
{
whereClause = " INVOICE_DATE >= :1";
vo.setWhereClauseParam(whereClausecount,fromdate);
whereClausecount++;
}
}
if(todate!=null&&!("".equals(todate.trim())))
{
if(whereClause!=null)
{
if((fromnum!=null&&!("".equals(fromnum.trim())))&&(tonum!=null&&!("".equals(tonum.trim())))&&(fromdate!=null&&!("".equals(fromdate.trim()))))
{
whereClause = whereClause +" AND INVOICE_DATE < = :4";
vo.setWhereClauseParam(whereClausecount,todate);
whereClausecount++;
}
else
{
whereClause = whereClause +" AND INVOICE_DATE < = :3";
vo.setWhereClauseParam(whereClausecount,todate);
whereClausecount++;
}
}
else
{
whereClause = " INVOICE_DATE <= :1";
vo.setWhereClauseParam(whereClausecount,todate);
whereClausecount++;
}
}
vo.setWhereClause(whereClause);
}
Thank you so much this was very helpful. You really know what you are doing. Keep up the good work.
ReplyDeletethank you so much its very helpful>>>
ReplyDeleteis this the root element "OAQueryBean"
Hi,
ReplyDeleteCan you tell me how can we capture the value entered by user in LOV Window.
Thanks a lot for the excellent information. Could you please confirm the way you captured Go button and appended where condition...so does it mean these where conditions will be appeneded along with Standard search SQL.
ReplyDeleteThanks
Raj
Hi ,
ReplyDeleteCould you please tell me that how should i get handle of the buttons of advance table which we are creating in Advance table components --> table actions.
Ha ye kr lo pehle
ReplyDelete