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:
RelatedRecordsEditor.js:
(_editWidget is undefined here.)
Solved! Go to Solution.
Dávid,
You need to get a reference to the edit widget in the RelatedRecordsEditor.js file. The normal way to do this is to use the WidgetManager.js class to get the widget reference.
require(["jimu/WidgetManager"], function(WidgetManager) {
var _editWidget = WidgetManager.getInstance().getWidgetsByName('Edit');
var webMapID = _editWidget[0].getWebMapId();
});
Dávid,
You need to get a reference to the edit widget in the RelatedRecordsEditor.js file. The normal way to do this is to use the WidgetManager.js class to get the widget reference.
require(["jimu/WidgetManager"], function(WidgetManager) {
var _editWidget = WidgetManager.getInstance().getWidgetsByName('Edit');
var webMapID = _editWidget[0].getWebMapId();
});
I was trying to understand the file's communication rather. And some minutes ago a solved it like this, but i will use your answer in the future for sure.
Unfortunately, i realised that it fills the inputbox, but if the user doesn't modify the string, it doesn't save the string what is inside the dijit_form_ValidationTextBox_1 so i need to figure out how to pass this value to the system.
But a thousand thanks for your help!