|
POST
|
Yes! (this also made me go look/check and is helping me understand the various things I need to consider -- thanks!!!) define(['dojo/_base/declare',
'dijit/_WidgetsInTemplateMixin',
'jimu/BaseWidget',
'jimu/dijit/TabContainer',
'jimu/utils',
'dojo/_base/lang',
'dojo/on',
'dojo/Deferred',
'dojo/_base/Color',
'dojo/_base/array',
'dojo/dom-construct',
'dojo/dom-class',
'dojo/keys',
'jimu/dijit/LoadingIndicator',
'jimu/dijit/Popup',
'dijit/form/ValidationTextBox',
...
function(declare,
_WidgetsInTemplateMixin,
BaseWidget,
TabContainer,
utils,
lang,
on,
Deferred,
Color,
array,
domConstruct,
domClass,
keys,
LoadingIndicator,
Popup,
ValidationTextBox,
...
... View more
01-24-2018
08:24 AM
|
0
|
14
|
4755
|
|
POST
|
Attempting to build a new widget and having difficulty acquiring the value found in a textbox control in the widget.html and getting the error: "this.<name>.get is not a function". Hopefully I'm just missing the obvious. And thanks to Robert and this group for the jumpstart! Widget.html (line 5 has the appNoInput reference I'm trying to get the value from) <div>
<div data-dojo-attach-point="tabIdentify">
<div class="my-tab-node" data-dojo-attach-point="tabNode1">
<div class="main-div" data-dojo-attach-point='mainDiv'>
<label for="${id}_appNoInput">App No: </label><input type="text" class="appNoBox" id="${id}_appNoInput" data-dojo-type="dijit/form/ValidationTextBox" data-dojo-attach-point="appNoInput" data-dojo-attach-event="keypress:_onSearchKeyPress" />
<br/><br/>
<div class="jimu-btn" data-dojo-attach-point="queryButton" data-dojo-attach-event="click:_onQueryAppNo">Query App No.</div>
<br/><br/>
....and so forth Widget.js var appNo = this.appNoInput.get("value");
//generates the error "this.appNoInput.get is not a function"
... View more
01-24-2018
08:11 AM
|
0
|
17
|
10828
|
|
POST
|
That did it Robert. Thanks a million for taking the time on this.
... View more
01-23-2018
12:42 PM
|
0
|
0
|
2412
|
|
POST
|
From Roberts excellent simplified example, I cannot seem to identify what I've done wrong. Getting error: "Unexpected token (" on the _initTabContainer: function() and running out of things to try. define(['dojo/_base/declare',
'dijit/_WidgetsInTemplateMixin',
'jimu/BaseWidget',
'jimu/dijit/TabContainer',
'jimu/utils',
'dojo/_base/lang',
'dojo/on'
],
function(declare,
_WidgetsInTemplateMixin,
BaseWidget,
TabContainer,
utils,
lang,
on) {
return declare([_WidgetsInTemplateMixin, BaseWidget]), {
postCreate: function() {
this._initTabContainer();
_initTabContainer: function() {
var tabs = [];
tabs.push({
title: 'Tab 1',
content: this.tabNode1
});
tabs.push({
title: 'Tab 2',
content: this.tabNode2
});
this.selTab = 'Tab 1';
this.tabContainer = new TabContainer({
tabs: tabs,
selected: this.selTab
}, this.tabIdentify);
this.tabContainer.startup();
this.own(on(this.tabContainer, 'tabChanged', lang.hitch(this, function(title) {
if (title !== 'Tab 1') {
//do something now that Tab 2 has been selected
}
})));
utils.setVerticalCenter(this.tabContainer.domNode);
};
};
}
});
... View more
01-23-2018
12:05 PM
|
0
|
3
|
2412
|
|
POST
|
define(['dojo/_base/declare',
'dijit/_WidgetsInTemplateMixin',
'jimu/BaseWidget',
'jimu/dijit/TabContainer',
'jimu/utils',
'dojo/_base/lang',
'dojo/on'
],
function(declare,
_WidgetsInTemplateMixin,
BaseWidget,
TabContainer,
utils,
lang,
on) {
return declare([_WidgetsInTemplateMixin, BaseWidget], {
postCreate: function() {
this._initTabContainer();
_initTabContainer: function() {
var tabs = [];
tabs.push({
title: 'Tab 1',
content: this.tabNode1
});
tabs.push({
title: 'Tab2',
content: this.tabNode2
});
this.selTab = 'Tab 1';
this.tabContainer = new TabContainer({
tabs: tabs,
selected: this.selTab
}, this.tabIdentify);
this.tabContainer.startup();
this.own(on(this.tabContainer, 'tabChanged', lang.hitch(this, function(title) {
if (title !== 'Tab 1') {
//do something now that Tab 2 has been selected
}
})));
utils.setVerticalCenter(this.tabContainer.domNode);
}
}
});
}
); I think the problem is improper "}" and ")" at the bottom. I can't see straight after trying to line these up. Among other errors, TypeError: clazz is not a constructor is at the top in dev tools. JSLint doesn't seem to be able to even get past the define at the top.
... View more
01-22-2018
02:09 PM
|
0
|
2
|
2754
|
|
POST
|
I've been able to screw up even this simple example. It's the squiglies and writing this in TextPad that has me in double-vision. I've got the exact html and css but here is the js: define(['dojo/_base/declare',
'dijit/_WidgetsInTemplateMixin',
'jimu/BaseWidget',
'jimu/dijit/TabContainer'],
function (declare,
_WidgetsInTemplateMixin,
BaseWidget,
TabContainer,
utils) {
return declare([_WidgetsInTemplateMixin, BaseWidget], {
postCreate: function () {
this._initTabContainer();
_initTabContainer: function () {
var tabs = [];
tabs.push({
title: 'Tab 1',
content: this.tabNode1
});
tabs.push({
title: 'Tab2',
content: this.tabNode2
});
this.selTab = 'Tab 1';
this.tabContainer = new TabContainer({
tabs: tabs,
selected: this.selTab
}, this.tabIdentify);
this.tabContainer.startup();
this.own(on(this.tabContainer,'tabChanged',lang.hitch(this,function(title){
if(title !== 'Tab 1'){
//do something now that Tab 2 has been selected
}
})));
utils.setVerticalCenter(this.tabContainer.domNode);
}
}
}
)
... View more
01-22-2018
01:10 PM
|
0
|
4
|
2754
|
|
POST
|
All of the nls references seem to cause errors even tho I've added everything into my strings.js that is found in your identify widget's strings.js but it cannot seem to resolve the issue. The whole replacing strings/labels/etc. is just too complex for what I hoped to find. A panel with two tabs that I can just plop in my set of controls and js code -- but I can't seem to quite squish it into anything already exists. thanks a bunch for your input! <div> <div data-dojo-attach-point="tabIdentify"> <div class="identify-tab-node" data-dojo-attach-point="tabNode1"> ...just plop in some new attach points on this tab and execute the js </div> <div class="identify-tab-node" data-dojo-attach-point="tabNode2"> ...just plop in some new attach points on this tab too and execute the js </div> </div> </div>
... View more
01-22-2018
12:33 PM
|
0
|
6
|
2754
|
|
POST
|
this.openCity(event, 'London') Now I am not sure where that should go. (can this type of development be spread out even more, my ADHD hasn't limited out yet )
... View more
01-22-2018
11:06 AM
|
0
|
0
|
2754
|
|
POST
|
Error: Uncaught ReferenceError: openCity is not defined which I guess the botton classes need to be "data-dojo-attach-event"? But not sure how to pass the arguments to the openCity function in the .js Widget.html: <div>
<div class="tab">
<button class="tablinks" data-dojo-attach-point='tablinksExhibit' onclick="openCity(event, 'London')">London</button>
<button class="tablinks" data-dojo-attach-point='tablinksExhibit' onclick="openCity(event, 'Paris')">Paris</button>
<button class="tablinks" data-dojo-attach-point='tablinksExhibit' onclick="openCity(event, 'Tokyo')">Tokyo</button>
</div>
<div id="London" class="tabcontent" data-dojo-attach-point='tabExibit'>
<h3>London</h3>
<p>London is the capital city of England.</p>
<div class="main-div" data-dojo-attach-point='mainDiv'></div>
</div>
<div id="Paris" class="tabcontent" data-dojo-attach-point='tabExibit'>
<h3>Paris</h3>
<p>Paris is the capital of France.</p>
</div>
<div id="Tokyo" class="tabcontent" data-dojo-attach-point='tabExibit'>
<h3>Tokyo</h3>
<p>Tokyo is the capital of Japan.</p>
</div>
</div> Widget.js (I didn't do anything with cityName yet): openCity: function(evt, cityName) {
// Declare all variables
var i, tabcontent, tablinks;
// Get all elements with class="tabcontent" and hide them
//tabcontent = document.getElementsByClassName("tabcontent");
tabcontent = domClass.add(this.tabExibit, 'tab');
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
// Get all elements with class="tablinks" and remove the class "active"
//tablinks = document.getElementsByClassName("tablinks");
tablinks = domClass.add(this.tablinksExibit, 'tab');
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
// Show the current tab, and add an "active" class to the button that opened the tab
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
},
... View more
01-22-2018
10:52 AM
|
0
|
11
|
3062
|
|
POST
|
I can't even get THIS to fully work. The entire widget.html needs to be encapsulated inside of a <div> .. </div> for the widget to open without error, but then the <script> section doesn't seem to fire and nothing appears when a tab is clicked. The code is pretty much exactly as found in the simple example. <div>
<div class="tab">
<button class="tablinks" onclick="openCity(event, 'London')">London</button>
<button class="tablinks" onclick="openCity(event, 'Paris')">Paris</button>
<button class="tablinks" onclick="openCity(event, 'Tokyo')">Tokyo</button>
</div>
<div id="London" class="tabcontent">
<h3>London</h3>
<p>London is the capital city of England.</p>
<div class="main-div" data-dojo-attach-point='mainDiv'></div>
</div>
<div id="Paris" class="tabcontent">
<h3>Paris</h3>
<p>Paris is the capital of France.</p>
</div>
<div id="Tokyo" class="tabcontent">
<h3>Tokyo</h3>
<p>Tokyo is the capital of Japan.</p>
</div>
<script>
function openCity(evt, cityName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}
</script>
</div>
... View more
01-22-2018
08:53 AM
|
0
|
14
|
3062
|
|
POST
|
As far as using the GP widget inside your widget that is a pretty daunting task Definitely -- I was only attempting to just use it as reference, I need something to go off of to try and implement a tabbed panel
... View more
01-22-2018
07:35 AM
|
0
|
16
|
3062
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-17-2020 10:47 AM | |
| 1 | 10-25-2022 11:46 AM | |
| 1 | 08-08-2022 01:40 PM | |
| 1 | 02-15-2019 08:21 AM | |
| 2 | 08-14-2023 07:14 AM |
| Online Status |
Offline
|
| Date Last Visited |
01-22-2025
02:28 PM
|