8 Replies Latest reply: Feb 19, 2013 11:27 AM by 730040 RSS

    ADF Mobile > Refreshing a view using a button

    730040
      hi ADF Mobile gurus,

      i have a requirement where in there is a button at the top of the view and a list item. the view displays some data in list item.

      i want the list item to get refreshed when clicking the button in other words something similar to refresh functionality in the browser.

      how to achieve that?

      thanks,
      ad
        • 1. Re: ADF Mobile > Refreshing a view using a button
          Frank Nimphius-Oracle
          Hi,

          you don't mention where the data is populated from that you display in the list. If the button refreshes this data source then the list will refresh (e.g. re-execute the iterator or method in the binding layer). ADF mobile has a different lifecycle than the web based ADF versions

          Frank
          • 2. Re: ADF Mobile > Refreshing a view using a button
            730040
            hi Frank,

            sorry about that.

            data in the list is coming from a DC.
            and i am refreshing the data source through this button. my only challenge is to refresh the data in the list.

            i was reading the following (go to end)..
            http://docs.oracle.com/cd/E23549_01/web.1111/e16272/using_bind_model.htm

            see: To use a button to reexecute the iterator:

            i didn't find the "execute" method for the iterator.

            how to execute the iterator?
            please help.


            thanks,
            ad
            • 3. Re: ADF Mobile > Refreshing a view using a button
              user404
              Is the data from your DC coming directly from a webservice call?
              If so, just use the button to execute it again.
              If not, use DataChangeEvent as described here:
              http://docs.oracle.com/cd/E35521_01/doc.111230/e24475/amxbinding.htm#CHDHFGAF
              • 4. Re: ADF Mobile > Refreshing a view using a button
                730040
                i did as per "Example 9-28 ProviderChangeSupport Code" Example in that link and called RefreshNotes in the actionListener of my button, but the list is not getting refreshed.

                actually here is what i am doing,

                1. when the mobile app opens the list item has no data; so no data is displayed.
                2. button is clicked > it populates the data source
                3. then i call the Refresh... method in the actionlistner of the same button

                i am expecting the data now to be shown in the list item.

                is the call to Refresh...would show the data in the list item?

                regards,
                ad
                • 5. Re: ADF Mobile > Refreshing a view using a button
                  Shay Shmeltzer-Oracle
                  Can you clarify what your data source is?
                  Is it a local Java class? Is that Java class exposed as a data control?
                  Is it a data control based on a Web service?
                  Is it a data control based on REST service?
                  • 6. Re: ADF Mobile > Refreshing a view using a button
                    730040
                    hi Shay,

                    please find the details-

                    Can you clarify what your data source is? This is coming through a Data control

                    Is it a local Java class? Yes. it's a local java class.

                    Is that Java class exposed as a data control? Yes.
                    Is it a data control based on a Web service? No. the DC (call it DC1) is based on a POJO > POJO returns the array of complex type (list of employees; call it EMPLOYEES; this is populated by another method;)
                    Is it a data control based on REST service? Not sure about this.

                    my ADF Mobile UI has a button at top (name:Refresh) and a list view source of which is DC1.
                    so when i first open the APP, the list view will be empty.
                    clicking the Refresh button should refresh the data in the list view and show the data.

                    here is what i have done-
                    Refresh button has an action listener (AL) > AL calls a managed bean method > this method invokes a Web service based DC (call it DC2) > reads the data from DC2 and populates the EMPLOYEES list above

                    i am expecting the list view to get refreshed when Refresh button is clicked. but it's not happening. the list view does not show data after clicking the refresh button.

                    please let me know if i am missing anything here.

                    regards,
                    ad

                    Edited by: user12111278 on Feb 19, 2013 12:17 AM
                    • 7. Re: ADF Mobile > Refreshing a view using a button
                      user404
                      This should help you :
                      http://adf4beginners.blogspot.be/2013/02/adf-mobile-refreshing-your-precious-data.html
                      It also has an sample app.
                      • 8. Re: ADF Mobile > Refreshing a view using a button
                        730040
                        thank you so much for that.

                        let me try that in my app and will update you.

                        regards,
                        ad