JSONPackage object – PB Docs 2017

JSONPackage object

The JSONPackage object provides the ability to merge data in a JSON
object or extract data from a JSON object. Merging and extracting can
occur at both the client side and the server side. The resulted JSON can
be posted from the client to the server via HTTPClient, or retrieved from
the server to the client via RESTClient.

The JSON string that can be loaded by the JSONPackage object must be
an object (cannot be an array) and the item must be a string, object, or
array.

Note

This object cannot be referenced in .NET Web Service and .NET
Assembly components, otherwise the component will fail to be
deployed.

Note

The data to be merged can be from DataWindow, DataStore,
DataWindowChild, or from an existing JSON. Composite, Crosstab, OLE 2.0,
and RichText DataWindows are unsupported.

Properties

JSONPackage property

Datatype

Description

IgnoreCase

Boolean

A boolean value that specifies whether to ignore
the case for key.

ClassDefinition

PowerObject

An object of type PowerObject containing
information about the class definition of the object or
control.

Events

JSONPackage event

Occurs

Constructor

When the object is created.

Destructor

When the object is destroyed.

Functions

JSONPackage function

Datatype returned

Description

ClassName

String

Returns the name assigned to the
object.

Clear

Integer

Deletes all of the keys.

ContainsKey

Boolean

Checks if the key name exists.

GetContextService

Integer

Creates a reference to a context-specific instance
of the specified service.

GetJSONBlob

Blob

Gets the JSON blob data.

GetJSONString

String

Gets the JSON string data.

GetKey

String

Gets the key name.

GetParent

PowerObject

Returns a reference to the name of the parent
object.

GetValue

String

Gets the value of the key.

KeyCount

Long

Gets the total number of keys.

LoadFile

String

Loads a JSON file.

LoadString

String

Loads a JSON string.

PostEvent

Boolean

Adds an event to the end of the message queue for
the object.

Remove

Integer

Removes a key.

SaveToFile

Integer

Saves the JSON data to the local
file.

SetValue

Boolean

Sets the value of the key.

TriggerEvent

Integer

Triggers a specific event in the object and
executes the script for the event.

TypeOf

Object

Returns the type of the object.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x