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

resolve References in binding EL similar to ReferenceBinding

XMLWordPrintable

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

      currently ZK has @ref to shorten binding expressions

      it would enhance the VM programming if a similar concept was available at VM level

      in addition to providing a getter/setter to a VM property

      public String getTitle();
      public void setTitle(String title);
      

      it would be useful to have an additional level of indirection

      public Reference<String> getTitle() {}
      
      
      interface Reference<T> {
         T getValue();
         void setValue(T value);
      }
      

      for @bind(vm.title)
      instead of using setTitle/getTitle the binding should resolve to

      vm.title.getValue()
      vm.title.setValue(title)
      

      when encountering a Reference<?> implementation in an EL

      this allows to implement reusable and more sophisticated re/loading, saving, caching/lazy loading strategies when accessing viewModel properties without making the UI more complex

            Unassigned Unassigned
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: