Posts

Showing posts from April, 2011

Deleting multi-selected rows from adf table

Image
In this example i will selected rows using 1)  CTRL or SHIFT with mouse click 2)  Checkbox at the row and press Delete button for ease of understanding i created 2 separate buttons in the examples. Before start i assumed you already setup a Application with EO,VO and AM also using HR Connection - Add a Transient Attribute to VO of Boolean type named "SelectedRow" We will use this to select row Here the layout looks like - Drag a Collection from DataControl as ADF Table to JSF page - Dont Check RowSelection Checkbox - Set the table RowSelection property to multiple - Set EditingMode property to clickToEdit - Surround your table with af:PanelCollection for look and feel give table a id "myTab" - Add a toolbar in toolbar facet of Panelcollection - Add 2 toolbar buttons to your toolbar - Add partial triggers to your table reference both buttons on toolbar - Create a backing bean - Add a RichTable object to your bean with getter and setter methods.

Another user has changed the row with primary key oracle.jbo.Key[12 ].

Image
Try these solutions:  make sure that you check "refresh after insert" and refresh after update" for the primary key column in you entity object. in the application module tab Click the Properties tab and select jbo.locking.mode. Double click the “pessimistic”value next to the property to open the field editor and type “optimistic” over the value.Press enter. if error still exist then you must set "refresh after insert" and refresh after update" as true for all attributes in the entity object another way is to execute the View Object after the commit operation to bring back updated data to ViewObject. For this we need to override the  afterCommit()  of ViewObject class as follows:                  public void afterCommit(TransactionEvent){                         executeQuery();                       }              5- another way to solve this error is to overide the lock() method of the EntityImpl class       public void lock() {    

Detail entity with row key null cannot find or invalidate its owning entity.

Image
in the model project go to the association. double click on the association and expand the behavior node under relationship tab. make sure that the primary key column is set to DBsequance, if you have a sequence on the database or a function that generate the db sequence from a trigger 3- check on composition association and cascade update key attribute 4- When an entity row is created it's row status is STATUS_NEW . This means row is added in the transaction's list of changes to be validated or posted or committed. This is fine and expected in most of the cases. However, during complex business objects like master-detail there comes the situation where you may want to turn off these validations until both master and detail are available. For such situations to remove the row from transactions's list of changes ADF exposes an api setNewRowStatus(ROW.STATUS_INITIALIZED). This is specifically helpful when master-detail association is a composite association