Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2155

@NotifyChange should be read from interface

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 6.5.1
    • Databind 2
    • None

      This is related to http://tracker.zkoss.org/browse/ZK-1201 but I think yet another way should be supported:

      I would like to extract interface over view models for them to implement.
      I want methods in this interface be methods used as data bind and command methods.
      I want to add @Command and @NotifyChange on the methods on the interface without the need of repeating them in the View Model class.
      this does not work - ZK probably only reads annotations from the View Model class itself.

      My example:
      interface VMContract {

      SkillSupport getSkillSupport();

      @Command
      @NotifyChange("skillSupport")
      void editSkill(@BindingParam("skill") Skill skill);

      @Command
      @NotifyChange("skillSupport")
      void confirmEdit();
      }

      and I want VM to be able to declare:

      @Override
      public SkillSupport getSkillSupport()

      { return skillSupport; }

      @Override
      public void editSkill(@BindingParam("skill") Skill skill)

      { skillSupport.editSkill(skill); }

      @Override
      public void confirmEdit()

      { skillSupport.confirmEdit(); }

      without any of those @Command and @NotifyChange

      I don't want to add @NotifyChange(superclass=true) on each of the methods, acceptable solution would be to configure it on a VM class level.

            Unassigned Unassigned
            kretes kretes
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: