On binder BinderImpl line 333 change getDeclaredMethods for getMethods for MatchMedia inheritance

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Normal
    • 8.5.2
    • Affects Version/s: 8.5.1.1
    • Component/s: Databind 2
    • Security Level: Jimmy
    • None
    • Environment:

      zk framework

    • ZK 8.5.2 S1
    • None

      We want to use MatchMedia for fluid responsiveness, but the binder implementation scan the MatchMedia annotation on the final Methods of the View Model, this cause that the same code, must be repeated on every ViewModel of the application, Why just don't change .getDeclaredMethods for .getMethods in order to allow the reuse of code, for example:

      //Code must be repeated on every VM, why not allow to put it on a super class VM
      private String layoutTemplate;
      
          @MatchMedia("all and (max-width: 768px) and (min-width: 415px)")
          @NotifyChange("layoutTemplate")
          public void ipad(@ContextParam() {
              this.layoutTemplate = "iPad_layout";
          }
      
          @MatchMedia("all and (max-width: 414px)")
          @NotifyChange("layoutTemplate")
          public void mobile(@ContextParam() {
              this.layoutTemplate = "mobile_layout";
          }
      
          @MatchMedia("all and (min-width: 769px)")
          @NotifyChange("layoutTemplate")
          public void desktop() {
              this.layoutTemplate = "desktop_layout";
          }
      
      //getters and setters ......
      

            Assignee:
            CharlesQiu
            Reporter:
            dgofast
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 1 hour Remaining Estimate - 3 hours
                3h
                Logged:
                Time Spent - 1 hour Remaining Estimate - 3 hours
                1h