Forum Stats

  • 3,874,076 Users
  • 2,266,673 Discussions


List of values not refreshed for a Parent-Child Table



<b>Table Service</b>

<b>Entries example</b>
1 NULL Consulting
2 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Modeling
3 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Research & Development

ADF has created my entity object and my view object. I wanted to help the user whenever he is adding/editing services. If he is creating a service as a subservice of a particular one, I want to list him the services which have ParentId set to NULL.

<b>My screen will look like this</b>

Parent : List of values of services which are parents
Service Name : The user will have to enter the name of the service he wants to add/edit

What I did, is I have created a new view Object called ServiceParentsView. This view object use the Service entity object. Here is what the query looks like : SELECT fields names FROM Services WHERE PARENT_ID IS NULL
This query is only giving me parent services.

Now in my Service view object, I created a list of values for the field ParentId, pointing to my view object ServiceParentsView.

Everything works great when you load you page for the first time (in create/edit mode [ADF Form], I do get my list of values).

Where all of this falls apart is when I just inserted a new subservice (a service who has a parent). If I am going back to add a new service, the list of values not only list the parents only but my new child entry is in the dropdown list.

It is like the list of value is not refreshed properly. I didn't have any problems so far with List of Values pointing to a different table, but I am having one right now using this strategy.

Anyone as a clue how can I deal with this issue?
This discussion has been closed.