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

BindingParam annotation support converting from JSON to POJO automatically

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: 8.0.0
    • Fix Version/s: 8.0.0
    • Component/s: Databind 2
    • Labels:
      None

      Description

      For example,

      Client side:

      zkbind.$(someone).command('dataChange', {data:{title: "myData"}});
      

      Server side:

      public static class DataObject {
      	private String title;
      	public void setTitle(String title) {
      		this.title = title;
      	}
      	public String getTitle() {return title;}
      }
      @Command
      public void dataChange(@BindingParam("data") DataObject data) {
      	// do something here.
      }
      

        Issue Links

          Activity

          Hide
          jumperchen jumperchen added a comment - - edited

          Ready since 3/12/2015.

          You can implement your own JSON converter for non-EE version or use the built-in converter in EE version.
          In EE version, you can switch the implementation of the json converter in zk.xml

          For example,

          <library-property>
          	<name>org.zkoss.bind.jsonBindingParamConverter.class</name>
          	<value>org.zkoss.zkmax.bind.GsonConverter</value>
          </library-property>
          

          By default it will use "org.zkoss.zkmax.bind.JacksonConverter" implementation.

          Show
          jumperchen jumperchen added a comment - - edited Ready since 3/12/2015. You can implement your own JSON converter for non-EE version or use the built-in converter in EE version. In EE version, you can switch the implementation of the json converter in zk.xml For example, <library-property> <name>org.zkoss.bind.jsonBindingParamConverter.class</name> <value>org.zkoss.zkmax.bind.GsonConverter</value> </library-property> By default it will use "org.zkoss.zkmax.bind.JacksonConverter" implementation.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: