ICEfaces
  1. ICEfaces
  2. ICE-11552

ace:dataTable with icecore:loadBundle, values disappear on dynamic updates

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-4.3.0.GA_P04
    • Fix Version/s: EE-4.3.0.GA_P05
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Any
    • Support Case References:
      Support Case 14726
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Specify ace:ajax events for the type of events where this problem was observed and specify that the icecore:loadBundle should be executed in the request, e.g. <ace:ajax event="sort" execute="myLoadBundleID @this" /> in ace:dataTable.
      Show
      Specify ace:ajax events for the type of events where this problem was observed and specify that the icecore:loadBundle should be executed in the request, e.g. <ace:ajax event="sort" execute="myLoadBundleID @this" /> in ace:dataTable.

      Description

      If an ace:dataTable instance contains values from a bundle loaded via icecore:loadBundle, whenever there's a dynamic update on the table markup the values loaded from the bundle disappear. The dynamic updates can be either a change in sort order, a change in a filter string, page navigation via the paginator, etc. An easy way to reproduce the issue is to display the name of a header from a bundle message and trigger a dynamic update on the table.

      The messages from the bundle should be rendered normally, like any other text, when there are dynamic updates on the table.

        Activity

        Hide
        Arturo Zambrano added a comment - - edited

        Added a SystemEventListener to apply the bundle specified by icecore:loadBundle to the view even if the component doesn't get executed, as long as it's in the component tree.

        The problem was in icecore:loadBundle and not in ace:dataTable, although it wasn't exactly a bug, because icecore:loadBundle has a different design than f:loadBundle. The difference is that f:loadBundle is a tag handler, while icecore:loadBundle is a component. The advantage of icecore:loadBundle is that it's dynamic, meaning that its attributes can change dynamically, and the changes can be applied on the page dynamically as well, without having to reload the page. However, it gets treated like any other component. This means that it will only load the bundle if it gets executed or rendered in the view. The default behaviour of ace:dataTable ajax events is to only execute and render the table itself. That's why the bundle loaded by icecore:loadBundle wasn't actually loaded in those requests and the messages appeared empty.

        This was fixed in a rather unconventional way. When the icecore:loadBundle component object is created, it will subscribe a SystemEventListener to be called after the state has been restored. Then, when this listener is called, the bundle specified by this component instance will be loaded. So, as long as this component is in the component tree, it will load its bundle. After loading the bundle the listener will be removed, to avoid accumulating listeners. Other necessary checks are done before loading the bundle to make sure that it is only applied to the view where the component is declared.

        This fix should be tested more thoroughly before the next release, to make sure it works in all situations and doesn't create other bugs.

        For now, the workaround is to declare ace:ajax events (for the cases where this problem was seen) and specify the icecore:loadBundle component to be executed in the request.

        Show
        Arturo Zambrano added a comment - - edited Added a SystemEventListener to apply the bundle specified by icecore:loadBundle to the view even if the component doesn't get executed, as long as it's in the component tree. The problem was in icecore:loadBundle and not in ace:dataTable, although it wasn't exactly a bug, because icecore:loadBundle has a different design than f:loadBundle. The difference is that f:loadBundle is a tag handler, while icecore:loadBundle is a component. The advantage of icecore:loadBundle is that it's dynamic, meaning that its attributes can change dynamically, and the changes can be applied on the page dynamically as well, without having to reload the page. However, it gets treated like any other component. This means that it will only load the bundle if it gets executed or rendered in the view. The default behaviour of ace:dataTable ajax events is to only execute and render the table itself. That's why the bundle loaded by icecore:loadBundle wasn't actually loaded in those requests and the messages appeared empty. This was fixed in a rather unconventional way. When the icecore:loadBundle component object is created, it will subscribe a SystemEventListener to be called after the state has been restored. Then, when this listener is called, the bundle specified by this component instance will be loaded. So, as long as this component is in the component tree, it will load its bundle. After loading the bundle the listener will be removed, to avoid accumulating listeners. Other necessary checks are done before loading the bundle to make sure that it is only applied to the view where the component is declared. This fix should be tested more thoroughly before the next release, to make sure it works in all situations and doesn't create other bugs. For now, the workaround is to declare ace:ajax events (for the cases where this problem was seen) and specify the icecore:loadBundle component to be executed in the request.

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Arturo Zambrano
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: