Used for data submissions and web pages to display data. A single object consisting of a key and a value. Has similar structure as the MAP object of JAVA.
Created under DataCollection. Divided into Key Info that defines the data structure and Data that stores the initial data.
Key Info part (source: <w2:keyInfo>) contains key information. Define the name of the key in the id property of the key.
Data part (source: <w2:data>) defines the initial data. Select the use data option (source: <w2:data use="true">) to use the defined initial data.
Created under DataCollection. Divided into Key Info that defines the data structure and Data that stores the initial data.
Key Info part (source: <w2:keyInfo>) contains key information. Define the name of the key in the id property of the key.
Data part (source: <w2:data>) defines the initial data. Select the use data option (source: <w2:data use="true">) to use the defined initial data.
Type
- uiplugin
Property Summary
- attributeMap
- Relevant only when the DataType is XML. Name of the DataMap to define an additional attribute in the rootNode. The key and the value of the DataMap will be defined as the attribute name and the attribute value of the rootNode.
- baseNode
- [default:map] Valid only when DataType is XML. Specifies the XPath that will serve as the root node for data conversion into XML.
- defaultValue
- Default key value
- firstSet
- Whether to set the first value set by a method (such as setValue) or the end user's input as the initial data of the DataMap if no initial data has been defined.
- firstSetSubmission
- Sets the data updated by setJSON or setXML API or by a submission in the DataMap.
- id
- DataMap ID.
- idAttribute
- Valid only when DataType is XML. Uses the ID of the DataMap as another attribute (to be defined here) other than ID.
- length
- Data length in the column
- userData1
- User-defined property
- userData2
- User-defined property
- userData3
- User-defined property
- valueAttribute
- Relevant only when the DataType is XML. Allocates the actual data to the attribute.
Event Summary
- onmodelchange
- Triggered when a value of a certain key is changed.
- onsetdata
- Triggered when data is set by setJSON or setXML or when the result of data submission is set in the target of the DataCollection.
Method Summary
- bind( eventType , function )
- Dynamically allocates the DataMap event.
- get( key )
- Gets the key ID defined in Key Info.
- getArray( )
- Returns the entire DataMap as an array in an order as defined in Key Info.
- getCount( )
- Returns the number of the keys defined in the DataMap.
- getID( )
- Returns the ID of a DataMap object that is same as the object ID.
- getIndex( keyID )
- Returns the key index of the corresponding key ID as defined in Key Info.
- getInfo( )
- Gets the details of the DataMap.
- getJSON( )
- Returns the entire data of the DataMap as JSON data.
- getKey( keyIndex )
- Returns the ID of the corresponding key index.
- getKeyInfo( key )
- Gets details of a certain key in the DataMap.
- getModifiedArray( )
- Returns the key array and the value array of the modified data (the data changed from the original data in the DataMap) as JSON.
- getModifiedData( )
- Returns the key value of the modified data (the data changed from the original data in the DataMap) as an array.
- getModifiedIndex( )
- Returns the key indices of the modified data (the data changed from the original data in the DataMap) as an array.
- getModifiedJSON( )
- Returns the keys of the modified data (the data changed from the original data in the DataMap) as JSON.
- getModifiedKey( )
- Returns the keys of the modified data as an array.
- getModifiedXML( )
- Returns the keys of the modified data (the data changed from the original data in the DataMap) as XML.
- getName( keyID )
- Returns the name of the corresponding key ID defined in Key Info.
- getObjectType( )
- Returns the type of the DataCollection.
- getOption( attr )
- Returns the value of the corresponding attribute defined in the DataMap.
- getOriginal( KeyID )
- Returns the initial value allocated to the key ID defined in Key Info.
- getScope( )
- Returns the parent WFrame object when the component is a child of the WFrame which uses the scope feature (scope=true). Returns null if not the child of the scoping-enabled (scope=true) WFrame.
- getScopeWindow( )
- Returns the scope object of the parent when the component is a child of the WFrame which uses the scope feature (scope=true). Returns the window object if not a child of the scoping-enabled (scope=true) WFrame.
- getType( KeyID )
- Returns the dataType of the corresponding key ID defined in Key Info.
- getXML( )
- Returns the entire data of the DataMap as XML.
- initRowStatus( )
- Initializes the dataMap status.
- modifyKeyStatus( key , isModified )
- Changes the status as true (modified) or false (not modified.)
- redo( )
- Goes back to the previous change.
- reform( )
- Initializes the key data of the DataMap and changes the original value into the present key data.
- restore( )
- Returns the data to the previous stage.
- set( KeyID , KeyValue )
- Sets the specified value in the corresponding key ID.
- setArray( arrayData )
- Sets the entire data of the DataMap as an array.
- setEmptyValue( )
- Checks the key values, and sets an empty value. In case a default is defined, the default will be set.
- setJSON( jsonData )
- Sets the entire data of the DataMap as an JSON.
- setXML( xmlData )
- Sets the entire data of the DataMap as XML.
- trigger( eventType , paramArray )
- Directly triggers the specified event registered in the DataMap.
- unbind( eventType , function )
- Unbinds the event from the DataMap.
- undo( )
- Converts the key value of the DataMap into the original data.
Property Detail
- attributeMap
-
Relevant only when the DataType is XML. Name of the DataMap to define an additional attribute in the rootNode. The key and the value of the DataMap will be defined as the attribute name and the attribute value of the rootNode.
- baseNode
-
[default:map] Valid only when DataType is XML. Specifies the XPath that will serve as the root node for data conversion into XML.
- defaultValue
-
Default key value
- firstSet
-
Whether to set the first value set by a method (such as setValue) or the end user's input as the initial data of the DataMap if no initial data has been defined.
When true, an empty value (" ") will be set. In case of "false", the the first value set by a method (such as setValue) or entered by the end user will be set as the initial value. - firstSetSubmission
-
Sets the data updated by setJSON or setXML API or by a submission in the DataMap.
When set true, each submission will set the updated dated in the DataMap. - id
-
DataMap ID.
Allocated as a global object. Used as a key to identify data in submissions and APIs. - idAttribute
-
Valid only when DataType is XML. Uses the ID of the DataMap as another attribute (to be defined here) other than ID.
- length
-
Data length in the column.
- userData1
-
User-defined property. Use getUserData("userData3") to get the data.
// Example getUserData("userData1"); - userData2
-
User-defined property. Use getUserData("userData2") to get the data.
// Example getUserData("userData2"); - userData3
-
User-defined property. Use getUserData("userData3") to get the data.
// Example getUserData("userData3"); - valueAttribute
-
Valid only when DataType is XML. Allocates the actual data to the attribute. (Default: textNode)
Event Detail
- onmodelchange
-
Triggered when a value of a certain key is changed.
Parameter name type description info Object Object containing key, oldValue, and newValue. Sample - onsetdata
-
Triggered when data is set by setJSON or setXML or when the result of data submission is set in the target of the DataCollection.
When bound with a component, triggered before a value is set in the component.
Method Detail
- bind( eventType , function )
-
Dynamically allocates the DataMap event.
Parameter name type required description eventType String Y Name of the event function Function Y Handler function of the event to dynamically allocate Sample// DataMap ID is "dataMap1". dataMap1.bind("onsetdata", function(e){ alert("date setting");}); // The event function is commObj.fn_dcDataSet. dataMap1.bind("onsetdata", commObj.fn_dcDataSet ); - get( key )
-
Gets the key ID defined in Key Info. The initial value is ""(empty string).
Parameter name type required description key String Y Key ID. Return type description Object ID of the key (In most cases, the return type is string and the data is returned in the initially defined data type.) - getArray( )
-
Returns the entire DataMap as an array in an order as defined in Key Info.
Return type description Array One-dimensional array that contains the entire data of the DataMap Sample// DataMap Example WebSquare - getCount( )
-
Returns the number of the keys defined in the DataMap.
Return type description Number Number of the keys defined in the DataMap - getID( )
-
Returns the ID of a DataMap object that is same as the object ID. Same as the object ID.
Return type description String ID of the DataMap object - getIndex( keyID )
-
Returns the key index of the corresponding key ID as defined in Key Info.
Parameter name type required description keyID String Y ID defined in Key Info Return type description Number Index of the key ID - getInfo( )
-
Gets the details of the DataMap.
Return type description JSON {dataMapInfo : attributes, keyInfo : Object of the key attributes} JSON object Sample// dataMap1.getInfo(); - getJSON( )
-
Returns the entire data of the DataMap as JSON data.Sample
// DataMap Example WebSquare - getKey( keyIndex )
-
Returns the ID of the corresponding key index.
Parameter name type required description keyIndex Number Y Key index defined in Key Info Return type description String Key ID. Sample// DataMap Example WebSquare - getKeyInfo( key )
-
Gets details of a certain key in the DataMap.
Parameter name type required description key String Y Key to get the details Return type description JSON JSON object of the corresponding key attributes Sample// dataList1.getKeyInfo("key1"); - getModifiedArray( )
-
Returns the key array and the value array of the modified data (the data changed from the original data in the DataMap) as JSON. Related with firstSet attribute of the DataMap.
Return type description JSON SON containing arrays of keys and values of the data modified from the original data. Sample// Change the name to "Inswave". var modJsonArray = dataMap1.getModifiedArray(); // (Return Example) - (Converted into string. ) { key : ["name"] , value : ["Inswave"] } - getModifiedData( )
-
Returns the key value of the modified data (the data changed from the original data in the DataMap) as an array. Related with firstSet attribute of the DataMap.
Return type description Array An array containing the key values of the data modified from the original data. Sample// Change the name to "Inswave". var modArray = dataMap1.getModifiedData(); // (Return Example) [ "Inswave" ] - getModifiedIndex( )
-
Returns the key indices of the modified data (the data changed from the original data in the DataMap) as an array. Related with firstSet attribute of the DataMap.
Return type description Array Array of the key indices of the data modified from the original data Sample// Change the name to "Inswave". var modArray = dataMap1.getModifiedIndex(); // (Return Example) [0] - getModifiedJSON( )
-
Returns the keys of the modified data (the data changed from the original data in the DataMap) as JSON. Related with firstSet attribute of the DataMap.
Return type description JSON JSON containing keys of the data modified from the original data Sample// Change the name to "Inswave". var modJSON = dataMap1.getModifiedJSON(); // (Return Example) - (Converted into string.) { name: "Inswave" } - getModifiedKey( )
-
Returns the keys of the modified data as an array. Related with firstSet attribute of the DataMap.
Return type description Array An array of the keys with data different from the original data Sample// Change the name to "Inswave". var modKeyArr = dataMap1.getModifiedKey(); // (Return Example) ["name"] - getModifiedXML( )
-
Returns the keys of the modified data (the data changed from the original data in the DataMap) as XML. Related with firstSet attribute of the DataMap.
Return type description XML XML containing the keys of the data modified from the original data. Sample// Change the name to "Inswave". var modXML = dataMap1.getModifiedXML(); // (Return Example) - (Converted into string.) - getName( keyID )
-
Returns the name of the corresponding key ID defined in Key Info.
Parameter name type required description keyID String Y Key ID defined in Key Info Return type description String Key name defined in Key Info Sample// DataMap Example - getObjectType( )
-
Returns the type of the DataCollection.
Return type description String [dataMap, dataList, linkedDataList] Returns the type of the DataCollection. Samplevar dataCollectionType = dataMap1.getObjectType(); // Get the type of the dataMap1. (Return Example) "dataMap" - getOption( attr )
-
Returns the value of the corresponding attribute defined in the DataMap.
Parameter name type required description attr String Y Name of the attribute Return type description String Attribute defined in the DataMap Sample// DataMap Example - getOriginal( KeyID )
-
Returns the initial value allocated to the key ID defined in Key Info.
Parameter name type required description KeyID String Y Key ID. Return type description Object Initial value allocated to the Key ID (In most cases, the return type is string, and the data is returned in the initially defined data type.) Sample// DataMap Example WebSquare - getScope( )
-
Returns the parent WFrame object when the component is a child of the WFrame which uses the scope feature (scope=true).
Returns null when the component is not a child of the WFrame using the scope feature (scope=true). Return type description Object wframe object or null Sample// The main page contains wframe1 which contains wframe11 that is bound with dataMap1. dataMap1.getScope(); // Returns wframe11 object. - getScopeWindow( )
-
Returns the scope object of the parent when the component is a child of the WFrame which uses the scope feature (scope=true).
Returns a global window object when the component is not a child of the WFrame using the scope feature (scope=true. Return type description Object Scope object of the wframe object, or a global window object Sample// The main page contains wframe1 which contains wframe11 that is bound with dataMap1. var scope = dataMap1.getScopeWindow(); scope.wframe11 === dataMap1.getScope(); // true - getType( KeyID )
-
Returns the dataType of the corresponding key ID defined in Key Info.
Parameter name type required description KeyID String Y Key ID. Return type description String dataType of the key Sample// DataMap Example - getXML( )
-
Returns the entire data of the DataMap as XML.
Return type description XML Entire data in XML format Sample// DataMap Example WebSquare - initRowStatus( )
-
Initializes the dataMap status.SampledataMap1.initRowStatus(); // Set the dataMap1 status as initial status. Hence, calling dataMap1.getModifiedJSON() will return an empty object.
- modifyKeyStatus( key , isModified )
-
Changes the status as true (modified) or false (not modified.)
Parameter name type required description key String Y Key to change the status isModified Boolean Y New status to set. True is for modified, and false is for not modified. SampledataMap1.modifyKeyStatus("key1", false); // Sets key1 as unmodified. Results of calling dataMap1.getModifiedJSON will not include key1. dataMap1.modifyKeyStatus("key1", true); // Sets key1 as modified. Result of calling dataMap1.getModifiedJSON will include key1. - redo( )
-
Goes back to the previous change.
- reform( )
-
Initializes the key data of the DataMap and changes the original value into the present key data.
- restore( )
-
Returns the data to the previous stage.
- set( KeyID , KeyValue )
-
Sets the specified value in the corresponding key ID.
Parameter name type required description KeyID String Y Key ID. KeyValue String Y Value to allocate to the key Sample// DataMap Example - setArray( arrayData )
-
Sets the entire data of the DataMap as an array. The value index of the array must be same with the key index defined in the DataMap.
Parameter name type required description arrayData Array Y An array of the key values in the same key sequence and quantity as those defined in the KeyInfo. Sample// DataMap Example - setEmptyValue( )
-
Checks the key values, and sets an empty value. In case a default is defined, the default will be set.
(Both the OriginalData and the current data are set with empty values.) - setJSON( jsonData )
-
Sets the entire data of the DataMap as JSON. Not the entire keys are necessary. Instead, the keys defined in the DataMap will be set.
Parameter name type required description jsonData JSON Y Entire data of the DataMap in JSON format Sample// DataMap Example - setXML( xmlData )
-
Sets the entire data of the DataMap as XML. Not the entire keys are necessary. Instead, the keys defined in the DataMap will be set.
Parameter name type required description xmlData XML Y Entire data in XML format Sample// DataMap Example - trigger( eventType , paramArray )
-
Directly triggers the specified event registered in the DataMap.
Parameter name type required description eventType String Y Name of the event to trigger paramArray Array N Parameter array for the event handler Sample// Trigger onmodelcahnge event in dataMap1, and call the handler function with {key: "name", oldValue: "WebSquare", newValue: "Inswave"}. dataMap1.trigger( "onmodelchange" , [ {key: "name", oldValue: "WebSquare", newValue: "Inswave"} ] ); - unbind( eventType , function )
-
Unbinds the event from the DataMap.
Parameter name type required description eventType String N Name of the event to remove. If not specified, all events will be deleted. function Function N Event handler function to unbind when the function has been dynamically allocated to the event. If not specified, all handler functions of the corresponding event type will be unbound. Sample// Unbind the onmodelchange event in dataMap1. dataMap1.unbind("onmodelchange"); //dataMap1.bind("onmodelchange", fn_dataMapChage) is to dynamically allocate an event and the event handler. Unbind the event handler from the event as shown below. dataMap1.unbind("onmodelchange", fn_dataMapChage); // Unbind fn_dataMapChage among the onmodelchange event handler functions. - undo( )
-
Converts the key value of the DataMap into the original data.