Freitag, September 03, 2004

 

ADF POJO Binding

I was wondering why the native POJO binding doesn't allow creation of new objects (insert). After a look I found out there is not creation supported in the default DataControl implementation class (DCGenericDataControl) of POJO. To suppot the insert operation you must create and register your own DataControl in the DataBinding.cpx file and overwrite the createRowData(DCRowContext) method. To implement the method you can use the TopLink example found under: ../jdev/BC4J/scrc/adfmsrc.zip/oracle.adf.model/generic/toplink/TopLinkDataControl.java

Afterward you must also overwrite the isOperationSupported(...) in your DataControl to enable the MenuBar buttons (check byte parameter with DCDataControl static DCDataControl.OPER_DATA_ROW... ).

Ist not allowed to use only the new operator and insert the bean into the collection!!!

The same requirement exist for the DeleteOperation. You must also overwrite the removeRowData() Methode as above described.

A BUG in the ADF code prevent JClient to refershe automaticly the iterators and show the new data. You can fix it for your own: Unpack ../jdev/BC4J/scrc/adfmsrc.zip and uncomment the if(!containsRow(row)) in the methode insertRow(Row) and insertRowAtRangeIndex(int, Row) of oracle/adf/model/generic/DCRowSetIteratorImpl.java






<< Home

This page is powered by Blogger. Isn't yours?