Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-14993

User preferences do not get loaded into the frontend widget after refresh

    Details

      Description

      When the gadget loads, the user preferences are successfully retrieved from the server.
      Then the gadget refreshes after updating the preferences object on the frontend.
      But it seems the refresh sometimes happens before updating the preferences in the widget object.
      I tried to debug it, it must be some kind of race condition problem but it all looked a bit rocked science to me.

      It's hard to simulate aswell. I had the most luck in chrome and opera.

      I found a workaround though to wait one second before refreshing the gadget:

      _syncPrefs: function(prefs) {
      var instance = this;

      instance.set(
      'userPrefs',
      prefs,

      { SYNC: true }

      );

      window.setTimeout( function ()

      { instance.refresh(); }

      , 1000);
      },

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            kdejaeger Koen De Jaeger (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              11 years, 1 week, 3 days ago

                Packages

                Version Package