Create row on a clickToEdit table

Generally developers use 'createInsert' operations associated with the iterator binding to insert a new row. Works perfectly! However, when you use the same technique on a clickToEdit table to create new rows, all goes well, but the newly create record does not become the 'active row'. So the end user can by pass the validation and can create multiple records without key in the mandatory fields for the newly created ones, by clicking the 'Create' button multiple times.

A possible work around solution for this scenario is to customize the record creation, and programatically set the ActiveRowKey, as shown below.

Comments

Hi, we are trying to use this workaround, but we cannot find the setActiveRowKey() method for the RichTable class! Although it is in the class' API, it does not compile in our JDeveloper (version 11.1.1.2.0).

Do you know why is this happening? I think we are using the same version as you. Thank you very much

I have a case where I have a adf cliktoedit table in a popup (table in a jsff fragement in a bounded taskflow which is invoked as a popup). In the popup i do createinsert rows. however, the next time i open the popup the empty rows are still existent. How do remove those empty rows from the table on popup open ?

Sunil,I didn't quite understand the question fully. If you use ADF BC, createInsert will add new entry in EO cache, so what you are seeing is expected. An example may help me to understand it better.That said,however you can use popupfetchListener for perfroming all initialization logic(keep the content delivery as lazyUncached)

I have a condition where my adf table based on a VO (filtered rows for a particular location). However, there might be a case where the user creates a new row and wants to assign a location (and modify) the row in the table. But this row may not be unique and may be already present in the db. That means i create the row with parameters, and try to commit, if it already exists i update else insert. however, now i get uniqueness constraint since its creating new row. Do you know how we can create a vo row that will update if exists else create ?

otherwise i can fetch the row independently and put it up in the iterator if it already exists. but i guess i will face the uniquenss error

Hi Jobinesh,I have tried your approach. But the problem I'm facing is that a new row is getting created, but it does not appear on the af:table. When I click the save button, I get a error messages about empty attribute values.

AnoojIf your task flow is not invoked by a caller which has initiated a transaction, then ideally you may need to start a transaction from the taskflow if it involves data update. So it looks OK for me.

Hi Jobinesh,I have a similar problem.I'm using Jdev 11.1.2.3.0. I have a simple table with a createInsert operation button.When i click the button, a new row is created and appear in the table.The problem is that if, after creation of a new row a change the selected row and then re-select the newly created row i have the following error in the console: ADFv: No row found for rowKey: [oracle.jbo.Key[1 ], oracle.jbo.Key[312 ]]. (where 312 for ex is the key of the newly added row).The problem doesn't appear if the editingMode is edit all. it only appears if it is click to edit.Any hint?