This content has been marked as final. Show 4 replies
RN wrote:Could you explain what you're doing when you pick a record?
When I pick a record from bottom report to edit
Code would be helpful if applicable.
Thanks Jorge for your reply.
The two LOVs on the form have source as : Database Column
And in the report, one of the column has Link that populates a hidden item with the primary key of the table , for that particular row. And that in turn populates LOVs with the value specified for that row.
So assume : per database
LOV skillset has : testing and emp name for that skillset is John, Scott
development and emp_name for that skillset is John, Jerry
And from the report I picked a row with Skillset as "testing" an emp_name as "John", so LOVs show focus on "testing" and "John"
But when I change skillset from "testing" to "development" , emp_name LOV is showing "Select an employee". I want it to still show John because John applies to "development" as well.
Ok, sorry, I misunderstood the initial explanation. I see now the report has nothing to do with the situation.
Unfortunately, the standard APEX Cascading LOV is just not able to do what you ask.
The main reason is that the dependent LOV entries get wiped out and repopulated when the parent item changes values. Even if it gets populated with the same values as before, this is brand new HTML that gets added to the select.
One way to solve this would be for you to code the cascading LOV code so that you can mark as "selected" the child value that matches the value form before. There are many examples out there of how to do cascading lov as this feature only came about on a later version of APEX. (Perhaps APEX 4, but not sure about that)
Here's one example that comes to mind:
I think you would just need to set the selected keyword on the options that get created by the application process.
The code could also be improved a little given the new DA features in APEX.
I just wanted to mention that Denes Kubicek just linked to a great example on this forum post:
Cascading LOV - Keep Existing Value
Here is how he accomplishes this:
As I said before, it takes some manual effort and some extra code. But it works.
Hope this helps