This content has been marked as final. Show 4 replies
Thanks for creating an example, this has sure made this easier :-)
The error you are getting is because your column name is different from the column name in your query.
I changed your query to this (checkbox to "CHECKBOX")
Your checkbox also had no LOV definition so I wrote "Y,N" there
select "ROWID", "EMPNO", "ENAME", "JOB", "MGR", "HIREDATE", "SAL", "COMM", "DEPTNO", "CHECKBOX" from "#OWNER#"."EMP"
It seems to work now.
If you would want to implement an ajax call which updates a given record when you change the checkbox, that is easy enough. However, implementing it in the way that your example is set up will indeed lead to the problem you are encountering and for a good reason.
When the page is rendered a checksum is generated for each of your rows based on the current values in the database. When the page is submitted and it gets to the multi-row-update process, apex will again make a checksum of the current values in the database and compare this to the checksum of the submitted rows (which is still the checksum that was generated at the time of rendering). If these do not match it indicates the record has been changed between render and submit, and a submit is not possible because of that. This is the implementation of apex to prevent lost updates.
This means that when you implement an on-the-fly update of a value of a record in a tabular form (=altering the value in the database) and then submitting the form, this 'current version...' error will popup, because that is exactly what happened.
Your example application had the checkbox column in the sql. You then made a checkbox out of it with apex_item, and continued to set the display as "Simple Checkbox". Unnecessary: include the checkbox in the select and set the display as "Simple Checkbox", and provide the values in the "List of values definition" (Y,N). This will handle the checkbox values in your tabular form the standard way.
This still will not allow you to do changes to the value using ajax and then submit the rows. It will not break submitting however.
If all that you want to do is to change the value of a checkbox column on the database, then create a classic report and include a checkbox column and work from there: there is no functionality to break in that case.
Edit: @Joni: you and i were concurrently updating :) I must've just changed the checkbox column from the apex_item definition that was there to just 'checkbox', and then changed it to be displayed as a "Simple Checkbox". I got a current row identifier error when trying to change the values to "Y,N".
Edited by: Tom on Feb 4, 2013 10:19 AM