Mass Updating of Selected Rows
cloakedMar 2 2007 — edited Mar 5 2007(As you can see from my low number of posts I'm new to ApEx, so any information you can provide is appreciated.)
Hi,
I've been asked to include what I consider a heavy duty feature on a report. It has been requested that there is a form region above a report region. The form will have some fields on it to be used to mass update selected rows.
For instance, let's say the report is a list of employees and their dept and the form has a dropdown dept field that contains a list of depts. They want to be able to select certain employees on the report, then select a dept from the form and then click an Update Rows button. They want the selected rows to be updated with the selected dept. * Also, they don't want the report to be editable. * The only way to update any rows is thru the Update Row button.
I'm new to ApEx and can code in JavaScript, but am not an expert in either. And, I'm still trying to figure out what JavaScript syntax works in Element Attributes, etc. fields. But, I digress.
I have looked over several threads, and went to several demo pages, and have learned some things. Hopefully they are correct. If not, please correct me.
- Using the Row Selector is tricky.
- You can get the Row Selector on a regular SQL report by changing it to Updateable SQL, adding the Row Selector type, and changing it back.
- You can only see row information on a column if the column is editable.
I now have a report that is NOT editable and has NO editable columns. And the report has the Row Selector. Also, the ID (key) of each row is the first column of each row. (It's a link field that populates another page.) With the ID I can populate the correct record. I'm thinking I need to populate the ID again in another column into a text field and then be able to access that value on the selected rows.
Here's my dilemma. (That is, if I'm on the right track.) I need to know which rows are selected and then access the ID (key value) of that row. After that I can let my PL/SQL do the work.
- - 1. How does the 2nd ID need to be defined such that people can't edit it, but the value can be retrieved? And, how is this done? I assume something can be put in the Element Attributes. If so, will you please provide the code?
- - 2. What is the trick to knowing which rows are selected? An example snippet of code would be great here too.
- - 3. Also, tell me if I'm on the wrong track and need to provide a solution in a different way.
Sorry for the novel, but I wanted you to have a good idea of what I'm trying to accomplish so you may provide appropriate answers.
Thanks much, Tony