2 Replies Latest reply on Jan 12, 2018 1:51 PM by fac586

    Refresh data in form based on LOV

    AnnelizeF

      Hi

       

      Apex 5.1.3

      DbaaS 12.1

       

      I have created an online application (details below) to illustrate the problem I'm having.

       

      I have a one to one relationship between a table EMPLOYEE and EMPLOYEE_INDICATORS.

      On my form, I have 2 regions:

      Employee (LOV)

      Employee Indicators is a Form based on EMPLOYEE_INDICATORS, that is dependent on the value selected in Employee. The table is already populated with a row for each employee.

       

      Every time I change the LOV for employee, I submit the page in a dynamic action and then use a process to get the appropriate Employee Indicators row. This works well, although I would have preferred not to submit the page and let the user see a refresh every time they change the LOV.

       

      So I have two questions:

      1. Is it possible to retrieve this result without Submitting the Page (You can't just refresh the region)?
      2. I need to default a value in the Employee region: P15_SELECT_EMPLOYEE_ID  This can be demonstrated by changing the Default property on P15_SELECT_EMPLOYEE_ID to a Static value = 1.  When I set the default, the change event doesn't fire on the LOV, and therefore the Employee Indicators region will not refresh. Any ideas how to accomplish this?

       

      APEX online example

      Workspace: AF_PLAY

      Application: Play

      Page: 15

      Login: af /afaf

       

      Thanks

      Annelize

        • 1. Re: Refresh data in form based on LOV
          fac586

          AnnelizeF wrote:

           

          Apex 5.1.3

          DbaaS 12.1

           

          I have created an online application (details below) to illustrate the problem I'm having.

           

          I have a one to one relationship between a table EMPLOYEE and EMPLOYEE_INDICATORS.

          On my form, I have 2 regions:

          Employee (LOV)

          Employee Indicators is a Form based on EMPLOYEE_INDICATORS, that is dependent on the value selected in Employee. The table is already populated with a row for each employee.

           

          Every time I change the LOV for employee, I submit the page in a dynamic action and then use a process to get the appropriate Employee Indicators row. This works well, although I would have preferred not to submit the page and let the user see a refresh every time they change the LOV.

           

          So I have two questions:

          1. Is it possible to retrieve this result without Submitting the Page (You can't just refresh the region)?

          No, form regions are not automatically refreshable. It's possible to use a Set Value DA or Execute JavaScript Code DA/AJAX Callback combination, but this involves individually mapping all of the page items to data sources, which gets cumbersome for large forms. It also introduces additional complexity in order to handle refresh requests when the form contains modified data.

          2. I need to default a value in the Employee region: P15_SELECT_EMPLOYEE_ID This can be demonstrated by changing the Default property on P15_SELECT_EMPLOYEE_ID to a Static value = 1. When I set the default, the change event doesn't fire on the LOV, and therefore the Employee Indicators region will not refresh. Any ideas how to accomplish this?

          You can't set the Fire on Initialization property on the existing DA as it causes an endless loop. One way to achieve this is to use two DAs: the existing Change one plus a Set Value action with an Item is Null Client Side Condition on P15_SELECT_EMPLOYEE_ID.

          • 2. Re: Refresh data in form based on LOV
            AnnelizeF
            No, form regions are not automatically refreshable. It's possible to use a Set Value DA or Execute JavaScript Code DA/AJAX Callback combination, but this involves individually mapping all of the page items to data sources, which gets cumbersome for large forms. It also introduces additional complexity in order to handle refresh requests when the form contains modified data.

            Thank you, that's what I thought. Submit it is.

            One way to achieve this is to use two DAs: the existing Change one plus a Set Value action with an Item is Null Server Side Condition on P15_SELECT_EMPLOYEE_ID.

            This works really well, thank you.