Sunday, May 10, 2009

Questions on ADF and Middleware fusion technologies Part1

Q: How to group the Radio Buttons in a OAF page?
Answer:
Example:-
OAMessageRadioButtonBean amountBasedRBBean =
(OAMessageRadioButtonBean)
webBean.findIndexedChildRecursive("AmountBasedRB");
OAMessageRadioButtonBean rateBasedRBBean =
(OAMessageRadioButtonBean)
webBean.findIndexedChildRecursive("RateBasedRB");
amountBasedRBBean.setName("AmountRadioGroup");
amountBasedRBBean.setValue("A");
rateBasedRBBean.setName("AmountRadioGroup");
rateBasedRBBean.setValue("R");
Q: After clicking submit button in OAF page,processFormRequest doesn’t get called. How do I correct this? Answer:
Possible Solution:-Go to Tools--Preferences--Embedded
OC4J--> and confirm that the "Default Local IP Address"
option is selected.
Q: Clicking "Add another Row" button in a table results to “state loss” error on the page. How should I resolve this? (Classic and Advanced)
Answer:
This happens when you have not executed the view object
associated with the table. For any successful table event,
the underlying table view object query must have been
executed before a table event is caused. In the case where
you don't want to display any rows when the page comes up,
yet want to select on "Add Another Row" to add rows into
the table, then before you add rows to the table, you must
properly initialize the view object.
Q: One of the most common errors we all face in OAF is "oracle.apps.fnd.framework.OAException:java.lang.NullPointerException". How should I resolve this?
Answer:
The primary cause of this error is beacuse of you are
trying to fetch the data from the VO, which
does't contains any data.
For example:-
1)XXWRP_ServiceRegVORowImpl
serviceRegVORow=(XXWRP_ServiceRegVORowImpl)getXXWRP_Service
RegVO1().getCurrentRow();
2)Date value=serviceRegVORow.getCompletionDate();
Now if the XXWRP_ServiceRegVO1 is not executed, then above
code will throw error at line number 2.To avoid this,
either handle NullPointerException or check if the
serviceRegVORow is null or not.
Q: How do find out the selected view object rows using the table selector? (Classic and Advanced)? Answer: - Place this logic in your view object and invoke
it with invokeMethod from AM.
int fetchedRowCount = getFetchedRowCount();
if (fetchedRowCount > 0)
{
// Save the original range size and range start.
int savedRangeSize = getRangeSize();
int savedRangeStart = getRangeStart();
/* Alter the range size and start in this order to
prevent any accidental row fault-in from the
database. */
setRangeStart(0);
setRangeSize(fetchedRowCount);
Row[] rows = getAllRowsInRange();
for (int i = 0; i < fetchedRowCount; i++) { if(rows[i]!=null && "Y".equals(rows[i].getAttribute("SelectFlag"))) { /*operation to be performed on row*/ } } }

/*Restore the range size and start. Do in the following order to prevent any accidental row fault-in. Reverse order upon restoring to a potentially smaller range size.*/ setRangeSize(savedRangeSize); setRangeStart(savedRangeStart);

0 comments: