ADF- Updating Row - oracle-adf

We're trying to implement a very basic functionality in ADF 11g using Jdev(11.1.1.7). We have one table in database which is exposed to the UI layer using ADF BC.
The requirement is to update a table when user selects one of the row. It will open a popup and then user can update the value in that dialog box. This works well but along with the current row, ADF framework is also updating the first row with the previous value of the update.
To update a row, we're using the standard commit button from the data control and then overidiing the DoDml method in EO to update additional fields.
Can someone share the details why this happening with each update and any solution for this?
Thanks,
LG

First, remove the selectedRowKey value from the table properties otherwise this will always select first row.
After the commit refresh the page or relevant component to load updated data to UI.
If you are updating additional fields using doDML make sure to commit the data and refresh UI to load updated data.

Commit is transaction level, if the Status of EO row is changed that row will participate in transaction. Either you need to change the status of other row to un-modify or you can override beforeCommit in VOImpl .
Thank you,
TR

Related

Add or delete rows to Oracle Apex DB with cancel option

I would like to request help for design something in Oracle Apex.
Our Apex users can add or delete new row to tables in a page. Also after they making addition they got cancel button to the whole page.
The cancel button suppose to bring everything to it's previous state. E.g delete added rows, un-delete deleted rows, undo change of rows..
My solution now is adding another column (Hidden) to the database, which handles the row state, but it's not clean, and not working perfectly.
I'll be happy for new ideas, whether is DB related or Apex related, Thanks.
It is common practice to use APEX collections for this sort of thing. Before first showing the page, populate APEX collections with a copy of the existing data from the real tables. Let the user add, delete and update rows in the APEX collections. The Save button would then invoke a process to make the corresponding changes to the real tables, and Cancel would just leave without making any changes,

How to propagate changes from Entity row to View row

Normally, if we update an attribute in a View row, we can easily see the updated value in the Entity row as changes are propagated down the hierarchy.
My question is if we instead update an attribute on the Entity level, is there a way that we can get the new value on a current View row of a View object that was built using that Entity.
If you update an attribute on EO level, it will automatically update the VO attribute as well. It goes both ways.
Seeing you are asking this makes me think you tried it and it didn’t look like working. If that’s the case, you are probably having a Partial Refresh problem in your screen. You can try using a partialTrigger.

Sync up data in ADF table after update in DB table done outside ADF environment

I have a jsff page inside a bounded task flow. It displays a table. Each row of table has an edit icon. on click of which a new jsff page opens containing the information of the selected row ready to be edited.
Here user can update and save the information and check the information back on the first page by clicking a Done button on second page.Pretty much simple.
The problem is I have some complex implementation due to which I should not update the row information through ADF way. I take the information entered by the user and pass it to plane java file. There in the plane java file I instantiate an AM and update the information through this AM.
The problem with this approach is that when I click the Done button to come back on table page to check the saved data, the data on the table is stale.
This seems as If the table is being updated outside the ADF framework and so it is not aware of the underlying the data change hence the ADF UI table is not synced with physical table automatically.
JDev : 11.1.1.7.11
Options tried : Upon click of Done button I tried to requery the VO of ADF table by
1) Clearing the VO cache row and repopulating it
2) Re executing the iterator binding
3) Re executing the iterator binding programatically.
Thanks

Added row is not visible until scrolling

I've built a simple master - detail form consisting of a form for the master element and table for the details.
In the toolbar of panel collection around the table I placed a CreateInsert button which ads a row to the table. My problem is that I this row is invisible until after I move my cursor over to the table and scroll down. Then it appears.
Before that a small scrollbar appear after pressing the button which can't be pressed.
Related to this is the problem when I press the delete button in the details, the table gets cut in half. I suspect these two problems are related.
This is my table:
This is after I press CreateInsert. The table should add another row below this one, and it does, but it is not visible until after I scroll. This happens only for the first row.
I am using JDeveloper 12c with Oracle ADF Fusion Web Applications.
This is a late answer I know , but try to programmatically refresh the PanelCollection and its container.
AdfFacesContext.getCurrentInstance()
.addPartialTarget (getThePanelCollection());
AdfFacesContext.getCurrentInstance()
.addPartialTarget (getThePanelCollectioncontainerLayout());
I tried this myself and it solved the problem after trying many other solutions.
Did u check with the Size.?
Try giving Styles for Table and Panel Collection "StyleClass=AFStretchWidth"
Add Execute in binding side of the jspx page for the particular table
Add invoke action for the execute in executables
Change the properties to render model in refresh condition of the invoke action
It will automatically make the master table to trigger the new values
Thanks

Oracle ADF: How to filter out rows in RichTable?

I have following requirement.
Display data in a table
Clicking on checkbox filter out currently displayed rows by some condition
Clicking on checkbox once again return data appearance to it's previous state
To achieve this I've ovverided method rowQualifies in my ViewObject which is simple SQL based view object to apply my custom filter logic.
When user clicks on checkbox I refresh view object data to apply filter
viewObject.setDoFiltering(true);
viewObject.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
viewObject.executeQuery();
It works perfectly, data set updates without interacting with database and my custom filter logic applies as well.
But when I need to cancel filter it wouldn't work because iterator doesn't contain anymore previous rows, and I can only load them from database but it means that I can lose my changes already made to view object rows.
So, when I do
viewObject.setDoFiltering(false);
viewObject.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
viewObject.executeQuery();
It will return me those rows that were displayed previous time.
If I do
viewObject.setDoFiltering(true);
viewObject.setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES);
viewObject.executeQuery();
It will return me all rows, but I will lost my changes already made to view object rows.
My questions is how to avoid it? Maybe there is another way of doing this? Maybe it is possible to do something with RichTable to tell it how to filter rows in memory.
Any advices are warmly appricated!
I believe this can be done using ViewCriteria, to filter means to apply a ViewCriteria, and then disable it to view all your data

Resources