EWD allows you to very simply map a Javascript Object back into an EWD Session Object using the EWD.utils.putObjectToSession() method.

For example, within your page you could add a button that saves the person Object:

  <input type="button" id="a" value="Save person" 

When the button is clicked, the Javascript Object named person will be mapped to a JSON string and a corresponding EWD Session Object named person will be automatically instantiated.

For example, you could subsequently access the person object from within your pre-page scripts using the standard API methods, eg:

  s postCode=$$getSessionValue^%zewdAPI("person.Address.PostCode",sessid)

Note: For security reasons, you can only write back to a Session Object or Array that has been explicitly registered as writeable via JSON. You must do this in a pre-page script:

  d allowJSONAccess^zewdAPI(objectName,"rw",sessid)


  d allowJSONAccess^zewdAPI("person","rw",sessid)

Also for security reasons, it is not possible to write to the ewd Session Object. Additionally, note that once set, access permissions will remain in place for an array/object throughout the user's session unless explicitly revoked using (from within a pre-page script):

  d disallowJSONAccess^zewdAPI(objectName,sessid)


  d disallowJSONAccess^zewdAPI("person",sessid)