Here is a requirement to display all the rows of a database table (around 50 rows) in an ADF table without the scrolling of the table in the UI. We can achieve this functionality by rendering the data in two different ADF tables side by side, the first table renders the first half of the rows and the second table renders the remaining half.
I take an example data to display 52 weeks of a sales table, the first table rendering the 26 weeks and second one rendering the remaining half.
As a best practice, fetch all the records at one go from database using a single ViewObject query and build two different RowSets holding the two sets of data 26 rows each.
Set the Fetch_Mode as all to fetch all the rows at once.
Create two View Criteria's to filter the ViewObject rows in to two sets with 26 rows each.
Create two public methods in ViewObjectImpl of the VO, returning the respective RowSets with 26 rows each. And also expose these public method as client interfaces.
With the above steps we are done with the model and we will start building UI for rendering these two RowSets as ADF tables.
Create two method iterators in the executable section of the ADF page definition as below.
Create two method actions from those exposed public interface methods of the ViewObjectImpl.
Now we are ready to create ADF tables in UI from these RowSets being returned from the above method actions but if we drop the 'return' of the public interface methods, we would not get the proper Tree binding created in PageDef as we would have got when we drop a ViewObject.
So for that reason, first the same ViewObject as ADF table twice in the UI (may be inside a ShowDetailHeader layout or what ever is your layout) for two tables side by side.
Once you get the Tree binding created with all the 'AttrNames' required, just have to change the IteratorBinding property to point to the respective Method Iterator we created earlier. Do the same for both the Tree bindings and we are done with UI development too.
Finally the UI page looks like this,
Hope it helps.
I take an example data to display 52 weeks of a sales table, the first table rendering the 26 weeks and second one rendering the remaining half.
As a best practice, fetch all the records at one go from database using a single ViewObject query and build two different RowSets holding the two sets of data 26 rows each.
Set the Fetch_Mode as all to fetch all the rows at once.
Create two View Criteria's to filter the ViewObject rows in to two sets with 26 rows each.
Create two public methods in ViewObjectImpl of the VO, returning the respective RowSets with 26 rows each. And also expose these public method as client interfaces.
With the above steps we are done with the model and we will start building UI for rendering these two RowSets as ADF tables.
Create two method iterators in the executable section of the ADF page definition as below.
Create two method actions from those exposed public interface methods of the ViewObjectImpl.
Now we are ready to create ADF tables in UI from these RowSets being returned from the above method actions but if we drop the 'return' of the public interface methods, we would not get the proper Tree binding created in PageDef as we would have got when we drop a ViewObject.
So for that reason, first the same ViewObject as ADF table twice in the UI (may be inside a ShowDetailHeader layout or what ever is your layout) for two tables side by side.
Once you get the Tree binding created with all the 'AttrNames' required, just have to change the IteratorBinding property to point to the respective Method Iterator we created earlier. Do the same for both the Tree bindings and we are done with UI development too.
Finally the UI page looks like this,
Hope it helps.