Contact : oafqueries@gmail.com (OAF/ADF Trainings and Customizations)

Friday, February 26

How to split rows in Table or Advance Table???

There has been a Requirement given that there is a split icon present against each row in an Advance Table.
As the user clicks on Split Icon...the parent row should get split into two and the new Row should be inserted right below the parent row.

As an OAF Standard New Row gets inserted at the top of the View Rows.

But we can insert it right below the parent row.

Invoke a method in AM as the User press Split Icon and pass the Id of the row to be splitted.
and loop through the VO rows and identify the row to be splitted.
Then set the current row and insert the new row.


for(xxinvoiceVORowImpl row = (xxinvoiceVORowImpl)vo1.first();
row != null;
row = (xxinvoiceVORowImpl)vo1.next())
{
if(row.getAttribute("InvoiceId")!=null)
{
String invoice = (String)row.getAttribute("InvoiceId").toString();
if(inv.equals(invoice))
{
vo1.setCurrentRow(row);
vo1.next();
xxinvoiceVORowImpl newrow = (xxinvoiceVORowImpl)vo1.createRow();
vo1.insertRow(newrow);
break;
}
}
}

This will insert the row right below the Row on which Split icon was clicked.

Thanks,
Gaurav

Wednesday, November 18

CSS Types

Hi,

Found a very good Document regarding the various CSS types used.

Would like to share..

http://www.oracle.com/technology/tech/blaf/specs/textStandards.html

Thanks,
Gaurav

How to Create Dependent LOV's

You have a requirement that based on dept in lov you need to show only employees for that dept in employee lov


You proceed this way:

Suppose Dept LOV is:

select dictinct dept from dept;



Employee Lov is:



select distinct dept,employee from emp where dept = :1;



Now in department LOV: Dept(messageLOV Input)

create a lov map:

1) LOV region item: department

2) return item : Dept

3) critirea item: Dept



Now in employee LOV: Employee(messageLOV Input):



create two lov maps:
1)

LOV region item: emp

return item:Employee

critirea item: Employee

2)

LOV region item: dept

return item:null

critirea item: Dept

Programatic Query : True



Now for employee LOV region create a new controller and write this code in PR



Dictionary passiveCriteria = (Dictionary)pageContext.getLovCriteriaItems();

String lov = (String)passiveCriteria.get("dept");//grab the department from critirea

System.out.println("Critirea item value is "+lov);

OAApplicationModule am = pageContext.getApplicationModule(webBean);

Serializable para[] = {lov};

am.invokeMethod("executelov",para);



Now in AM set the where clause of employee lov in executelov() method.



public void executelov(String critirea)

{

getemployeelovVO1().setWhereClauseParams(null);

getemployeelovVO1().setWhereClauseParam(0,critirea);

getemployeelovVO1().executeQuery();

}



also in pagelayout controller's process request you need to first execute the employee lov without any data.



like



public void initemployeelov()

{

String test = "";

getemployeelovVO1().setWhereClauseParams(null);

getemployeelovVO1().setWhereClauseParam(0,test);

getemployeelovVO1().executeQuery();

}





Thanks,

Gaurav Sharma