I have programing theory question. I need to develop the editor widget, to fill out input boxes automatically with webmapID, date, ect. I'm trying to follow the widget's techniques, but i'm unsuccesfull.
So here i want to get the webmapid in widget.js, but probably it's already not good, because i don't have 'map' in that scope. In the widget.js's startup function i call this method "this.getWebMapId(); And it returns the value.
My big problem,(except that i'm really new in programming) is how to call this method in the RelatedRecordsEditor.js's "_init" function. Should i declare it like the Clazz object's property? What should i do with the _editWidget object in RelatedRecordsEditor?
What i have done:
widget.js:
/*******************************
* Public methods
* *****************************/
getWebMapId: function() {
var webMapID = this.map.itemInfo.item.id;
console.log("webmapid: "+ webMapID);
return webMapID;
},
RelatedRecordsEditor.js:
dojo.connect(dijit.byId('dijit_form_ValidationTextBox_1'), 'onChange', function (webMapID) {
var mapid=dijit.byId("dijit_form_ValidationTextBox_1").attr("value");
console.log(mapid);
var webMapID;
webMapID = this._editWidget.getWebMapId();
var update = mapid.replace(mapid, webMapID);
console.log(update);
dojo.byId('dijit_form_ValidationTextBox_1').value = update;
});
(_editWidget is undefined here.)