Child pages
  • Uploading files

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

    • add a dataprovider type to the component spec, with 'pushToServer' support and 'ondatachange' callback:

      No Format
      "file": {"type": "dataprovider", "pushToServer": "allow", "ondatachange": { "onchange":"onDataChangeMethodID", "callback":"onDataChangeCallback"}}
    • add an  'ondatachange' handler to the component spec:

      No Format
      "onDataChangeMethodID" : {
      "returns": "Boolean", 
      
      "parameters":[
      {
      "name":"oldValue",
      "type":"${dataproviderType}"
      }, 
      {
      "name":"newValue",
      "type":"${dataproviderType}"
      }, 
      {
      "name":"event",
      "type":"JSEvent"
      } 
      ]
      }
    • add a 'multipart/form-data' 'form' element to the component markup, that will be used to post the files to the server;
      the action of the form must be :  "resources/upload/application_session_id/form_name/element_name/property_name", this can be build up in the component's controller code like : "resources/upload/" + $sabloApplication.getSessionId() + "/" + $scope.$parent.formname + "/" + $attrs.name + "/file" ("file" is the name of the dataprovider from the model ):
       

...