Thursday, July 06, 2006

Refreshing Master-Detail JSF page after inserting
or deleting row from Detail table (JDeveloper 10.1.3)

Pick up as a sample jpauser schema from [1].
Add one more view to jpauser schema :-

create view OrderView as select * from order_table;

Add method findOrderView(Double) to JPRSFacade Session EJB based
on same TopLink POJOS as in [1] plus

Create Master-Detail page step by step:-

Add code generated by "findOrderView" to code generated by"removeEntity" button.

Save new code for"removeEntity" button into JSF managed bean
for current page.

Now we are done with refresh after delete.

Create page for data entry and bind "persistEntity" at this page.

Then implement refreshing of main page after inserting new record into detail table:

1.Open the browse page and right click in the visual editor. Choose Go To Page Definition.

2.In the Structure window, expand the highest level node. Right click the executables node and choose

Insert inside executables -> invokeAction

3.In the Common Properties tab, specify "tableRefresh" as the Id for the action and choose your detail-table query method name : findOrderView in the Binds dropdown list.

4.Click the Advanced Properties tab

Choose ifNeeded as the Refresh property and to ensure the action is called each time the page is rendered.

Enter ${!adfFacesContext.postback} as the RefreshCondition and click OK.

Project has been deployed to standalone OC4J instance

and behaved as expected