TinyWebDB Component


Properties

serviceURL
  Specifies the URL of the Web service. The default value is the demo service running on App Engine.
Data type: string
Designer Writable true <tinywebdb name="tinywebdbName" serviceURL="http://tinywebdb.appinventor.mit.edu">
Code Writeable true tinywebdbName.serviceURL = "http://tinywebdb.appinventor.mit.edu"
Code Readable true let variable = tinywebdbName.serviceURL

class
  The styling class of the the component
Data type: string
Designer Writable true <tinywebdb name="tinywebdbName" class="Test class">
Code Writeable false
Code Readable false

id
  The styling id of the the component
Data type: string
Designer Writable true <tinywebdb name="tinywebdbName" id="Test id">
Code Writeable false
Code Readable false

name
  The name of the component that will be used to refer to it in code.
Data type: string
Designer Writable true <tinywebdb name="tinywebdbName" name="testComponent">
Code Writeable false
Code Readable false

Methods

Method name Description Parameters
getWebValue GetValue asks the Web service to get the value stored under the given tag. It is up to the Web service what to return if there is no value stored under the tag. This component just accepts whatever is returned. The GotValue event will be run on completion.
tinywebdbName.getWebValue(tag)
tinywebdbName.getWebValue("Test tag")
tag string
storeWebValue Sends a request to the Web service to store the given valueToStore under the given tag. The ValueStored event will be run on completion.
tinywebdbName.storeWebValue(tag, valueToStore)
tinywebdbName.storeWebValue("Test tag", "any")
tag string
valueToStore any
addEventListener Method used to create event listeners.
See Events below for samples.
eventName string
eventCallbackFunction callback

Events

Event name Description Parameters
gotValue Indicates that a GetValue server request has succeeded.
tinywebdbName.addEventListener(
    "gotValue",
    function (tagFromWebDB, valueFromWebDB) {
        //Your code here
    }
)
tagFromWebDB string
valueFromWebDB any
valueStored Event indicating that a StoreValue server request has succeeded.
tinywebdbName.addEventListener(
    "valueStored",
    function () {
        //Your code here
    }
)
webServiceError Indicates that the communication with the Web service signaled an error.
tinywebdbName.addEventListener(
    "webServiceError",
    function (message) {
        //Your code here
    }
)
message string