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

Provide a channel to communicate between client and server with ZK composer

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: 8.0.0
    • Fix Version/s: 8.0.0
    • Component/s: Container
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 8.0.1

      Description

      The idea is simular to the feature of ZK 8 provided that developer can use client side API to trigger a command to MVVM ViewModel. In this feature we would like to have a client side API to trigger a command to ZK Composer.

      For example,

      public class MyComposer extends SelectorComposer<Window> {
      
      	public void doAfterCompose(Window comp) throws Exception {
      		super.doAfterCompose(comp);
      	}
      
      	public static class MyFoo {
      		private String foo;
      		public void setFoo(String foo) { this.foo = foo;}
      		public String getFoo() { return this.foo;}
      	}
      
      	public static class MyBar {
      		// omitted
      	}
      	@Command
      	public void clientCommand(MyFoo foo, MyBar bar) {
      
      	}
      }
      

      In JS

      zkservice.$('$win').command('clientCommand', [{foo: "myfoo"}, {bar: "mybar"}]); // the arguments should be in order within an array.
      

        Activity

        Hide
        jumperchen jumperchen added a comment -

        Ready since 7/16/2015.
        Please have a look at the usage documentation

        Show
        jumperchen jumperchen added a comment - Ready since 7/16/2015. Please have a look at the usage documentation
        Show
        jumperchen jumperchen added a comment - here is a json converter setting - http://books.zkoss.org/wiki/ZK_Configuration_Reference/zk.xml/The_Library_Properties/org.zkoss.zk.ui.jsonServiceParamConverter.class

          People

          • Assignee:
            jumperchen jumperchen
            Reporter:
            jumperchen jumperchen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 5 hours
              5h

                Agile