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

resolve References in binding EL similar to ReferenceBinding

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Databind 2
    • Labels:
      None

      Description

      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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated: