Showing posts with label ppr. Show all posts
Showing posts with label ppr. Show all posts

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 oracle.adf.view.rich.component.rich.data.RichTable; 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; } }
Related Posts with Thumbnails