Pages

Tuesday, November 6, 2007

How to refresh a region in jdeveloper 11g

In jdeveloper 11g you can (re) use page regions which it's great but you have to do some coding when you want to make it refresh with a specific key when you for example click on the next record in the other part of the jsf page.

If you choose for a fusion web application (adf) project you can use regions in your jsf pages. A region is bounded task flow with a page fragment for example you can use a employee form in many pages and only design it ones.

the first step is to make a bounded taskflow with page fragmentsNow you can drop a view from the component palette on this bound task flow. Give the view a meaningfull name and then click the right button when you select the view and create this region

Now you can drop from the data control the employee view on this region. I use a form layout. Nothing special. Now we make a backing bean for this region to store the key of the wanted employee number which we want to show in the region.

We define this session backing bean in the faces-config.xml. The next step is that we make in the region pagedef a setCurrentRowWithKeyValue action and an invokeaction to automaticaly refresh the page


now we only have to define a parameter param1 in the region bounded taskflow definition which fills the backing bean.
We finally can go to the jsf page where we want to use the region. First we drop the bounded task flow to the jsf page and now we see the employee form region and jdeveloper create in the page def the following taskflow code

The last action is that we have to add param1 to the taskflow and we fills it with the wanted employee number. Now we can run the page and if we fill param1 of the taskflow with a employee number the region automatically show the wanted employee.

2 comments:

  1. Hi
    it was a good tuto, but when i run my jspx i don't find from where to change the empno

    ReplyDelete
  2. Hi , in the page emp when you do next record ,the region refreshes itself with the same employee

    or go to the department page and click on a item of the tree , then a department of employees region is displayed

    ReplyDelete