You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Jezza <gi...@git.apache.org> on 2018/11/05 13:57:02 UTC

[GitHub] wicket issue #297: Improve AjaxLazyLoadPanel's functionality.

Github user Jezza commented on the issue:

    https://github.com/apache/wicket/pull/297
  
    Hm, while I can see the reasoning, it's rarely as simple as that.
    
    In my opinion, it's about not running code that doesn't need to be run.
    
    If there was only a boolean to represent the state, then you're left with checking at each step (`getLazyLoadComponent`/`onContentLoaded`) whether or not something properly loaded.
    
    That to me seems like extra work that doesn't need to be managed.
    If I have one place that checks all of the loading (`contentState`), I don't want to have to duplicate the state checking code.
    I could pull it out into a method, but isn't that entirely what `contentState` is for?
    To check the state of the content?
    
    It's to separate the concerns.
    You wouldn't be in favour of the other extreme, and want to get rid of `contentState` entire, and just return null from `getLazyLoadComponent` isn't ready.
    
    I say that not every one will end up using this functionality, but I dare say a lot of the people who are doing parallel stuff with this panel might find it easier to deal with things that can have a third state.


---