Saturday, October 30, 2010

ADF UI - Refreshing page or region programmatically (instead of partialTriggers) for PPR

To programmatic refresh a component or region in a JSF page,

1. Create a binding for that component. Let's take af:table for example.
<af:table value="#{bindings.DeptVO.collectionModel}" var="row" rows="#{bindings.DeptVO.rangeSize}" emptyText="#{bindings.DeptVO.viewable ? 'No data to display.' : 'Access Denied.'}" fetchSize="#{bindings.DeptVO.rangeSize}" rowBandingInterval="0" selectedRowKeys="#{bindings.DeptVO.collectionModel.selectedRow}" rowSelection="single" id="t1" width="100%" columnStretching="last" contentDelivery="immediate" autoHeightRows="10" binding="#{pageFlowScope.ExampleBean.tableBinding}" selectionListener="#{bindings.DeptVO.collectionModel.makeCurrent}"> </af:table>

2. In the java bean code, use the below code to refresh the component or region (in our case af:table).
import; public class ExampleBean { private RichTable tableBinding; public void sampleMethod(ActionEvent actionEvent) { //Refresh the table AdfFacesContext.getCurrentInstance().addPartialTarget(tableBinding); } public void setTableBinding(RichTable tableBinding) { this.tableBinding = tableBinding; } public RichTable getTableBinding() { return tableBinding; } }


  1. hi
    i have a refresh problem in my screen .ihave apage and it has one resuble taskflow in needs to initialise the taskflow from the constructor of the consuming page and fill the data in the re-usable taskflow, the data is coming properly but the data is not displaying on the screen

    i tried with partial triggers by keeping one button in the consuming page it is working file but i need to load the page from constructor it self.plz help me

  2. To refresh the task flow, you can try changing one of the input parameters of the task flow, it'll automatically reload the task flow from the default activity. For e.g., check out

  3. Hi murali ,
    Thanks for ur reply
    with respect to above post i gone through the link u provided ,in my case there is no button in the consuming page to invoke the taskflow and the input parameter is a Helperclass .using the helper class i am invoking one method in the taskflow in the constructor of the consuming backing bean.i specified the refresh if needed also but didnt worked for me

  4. Great!

    Thanks for your post.


  5. great post, thanks

  6. hi murali in my case i am using one jsf page and inside i have two regions i am conrolling regions activities and other activities related to main page in the same backing bean,
    i am in session scope now its working fine and if i try to put this application in pageFlowScope at the runtime ,regions bindings are showing null values whenever i am trying to invoke regions and it is throwing nullpointer exception i am not passing any input paramters to invoke region

  7. Hi i have a drop down in adf page which retrieves value from the DB and it is used as a search criteria field in the filter.when nothing is given and when i click search it shows no data to display. But in the drop down only select is available and the other values from DB is getting vanished. Kindly suggest some solution.

  8. Hi,
    I need to refresh the region using ADS.
    I am creating jsff which contains dynamic tables rendering. This jsff is bound to a task flow (having input parameter and refresh property set to "ifNeeded). The bounded task flow is dropped on a jspx as a region.
    Now in order to refresh the region, I need to pass the updated param value, which would cause the region refresh.

    I am able to do so on a button click from jspx page. But I have to make it auto refresh using ADS as per app requirement.
    The issue is "AdfFacesContext.getCurrentInstance return null..if I am using it in startActive Data or changeData Update (where I am using ActiveDataUpdateEvent)".

  9. hi,
    when I commit data throgh AM the data commit successfully but when I commit data through UI it commit but null values goes in database.

    (Only those field are get null values which have LOV and View Criteria rest of data is saved succssfully)


  10. Thanks for sharing this great information I am impressed by the information that you have on this blog. Same as your blog i found another one Oracle ADF . Actually I was looking for the same information on internet for Oracle ADF and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject, you can learn more aboutOracle ADF . By attending Oracle ADF Training .


Related Posts with Thumbnails