I want to use a dojo button icon on one of my buttons on my Xpage.
According to an example seen on the net I should add "dijit.form.Button" to the Dojo Type and then add a dojo attribute "iconClass" with value of my button; "dijitEditorIcon dijitEditorIconDelete".
When I view the debug console in Chrome/Firefox I see an error:
dojo/parser::parse() error Error {} xspClientDojo.js:5
(anonymous function) xspClientDojo.js:5
_450 dojo.js:15
then._45d.then dojo.js:15
$DDLG_ dojo.js:15
$DDUV_ xspClientDojo.js:5
(anonymous function) dojo.js:15
$DDJq_ dojo.js:15
$DDJr_ dojo.js:15
$DDJq_ dojo.js:15
$DDJr_ dojo.js:15
$DDJq_ dojo.js:15
$DDJr_ dojo.js:15
$DDJq_ dojo.js:15
$DDJr_ dojo.js:15
$DDJq_ dojo.js:15
$DDJr_ dojo.js:15
$DDJq_ dojo.js:15
$DDJr_ dojo.js:15
$DDJq_ dojo.js:15
$DDJr_ dojo.js:15
$DDJq_ dojo.js:15
$DDJr_ dojo.js:15
$DDJq_ dojo.js:15
$DDJr_ dojo.js:15
$DDJq_ dojo.js:15
$DDJr_ dojo.js:15
$DDJp_ dojo.js:15
$DDSM_ dojo.js:15
XHR finished loading: "http://localhost/xsp/.ibmxspres/dojoroot-
1.8.1/dijit/form/Button.js". dojo.js:15
XHR finished loading: "http://localhost/xsp/.ibmxspres/dojoroot-1.8.1/dijit/form/_ButtonMixin.js". dojo.js:15
XHR finished loading: "http://localhost/xsp/.ibmxspres/dojoroot-1.8.1/dijit/form/DropDownButton.js". dojo.js:15
XHR finished loading: "http://localhost/xsp/.ibmxspres/dojoroot-1.8.1/dijit/_HasDropDown.js". dojo.js:15
XHR finished loading: "http://localhost/xsp/.ibmxspres/dojoroot-1.8.1/dijit/form/ComboButton.js". dojo.js:15
XHR finished loading: "http://localhost/xsp/.ibmxspres/dojoroot-1.8.1/dijit/form/ToggleButton.js". dojo.js:15
XHR finished loading: "http://localhost/xsp/.ibmxspres/dojoroot-1.8.1/dijit/form/_ToggleButtonMixin.js".
edit: xp:button
<xp:button id="button1" value="Delete"
dojoType="dijit.form.Button">
<xp:this.dojoAttributes>
<xp:dojoAttribute name="iconClass"
value="dijitEditorIcon dijitEditorIconDelete">
</xp:dojoAttribute>
</xp:this.dojoAttributes>
</xp:button>
I have djConfig set to parseOnLoad: true.
I have set the property of the Xpage to "Trigger dojo parse on load".
I also have a onClientLoad event with dojo.require("dijit.form.Button");
Using ND9 if that could be the case...
You should not add dojo.require("dijit.form.Button") in onClientLoad event. It serves a different purpose. Remove that code and add dijit.form.Button as Dojo Module in Resources tab of your XPages properties. In source it should come like this:
<xp:this.resources>
<xp:dojoModule name="dijit.form.Button"></xp:dojoModule>
</xp:this.resources>
Related
Generating browser application bundles (phase: setup)...Processing legacy "View Engine" libraries:
ngx-bootstrap/utils [es2015/esm2015] (git+ssh://git#github.com/valor-software/ngx-bootstrap.git)
ngx-bootstrap/positioning [es2015/esm2015] (git+ssh://git#github.com/valor-software/ngx-bootstrap.git)
ngx-bootstrap/chronos [es2015/esm2015] (git+ssh://git#github.com/valor-software/ngx-bootstrap.git)
ngx-bootstrap/component-loader [es2015/esm2015] (git+ssh://git#github.com/valor-software/ngx-bootstrap.git)
ngx-bootstrap/mini-ngrx [es2015/esm2015] (git+ssh://git#github.com/valor-software/ngx-bootstrap.git)
ag-grid-angular [main/commonjs] (git+https://github.com/ag-grid/ag-grid-angular.git)
ngx-bootstrap/modal [es2015/esm2015] (git+ssh://git#github.com/valor-software/ngx-bootstrap.git)
angular2-multiselect-dropdown [es2015/esm2015] (git+https://github.com/CuppaLabs/angular2-multiselect-dropdown.git)
Warning: Unable to fully load C:/4214_IOSM/Accenture.CIO.Inspire/Inspire_Client/node_modules/ag-grid-angular/main.js for source-map flattening: ENOENT: no such file or directory, open 'C:/4214_IOSM/Accenture.CIO.Inspire/Inspire_Client/node_modules/ag-grid-angular/exports.js.map'
Warning: Unable to fully load C:/4214_IOSM/Accenture.CIO.Inspire/Inspire_Client/node_modules/ag-grid-angular/main.js for source-map flattening: ENOENT: no such file or directory, open 'C:/4214_IOSM/Accenture.CIO.Inspire/Inspire_Client/node_modules/ag-grid-angular/exports.js.map'
ngx-pagination [module/esm5] (git+https://github.com/michaelbromley/ngx-pagination.git)
ngx-bootstrap/datepicker [es2015/esm2015] (git+ssh://git#github.com/valor-software/ngx-bootstrap.git)
angular-oauth2-oidc [es2015/esm2015] (git+https://github.com/manfredsteyer/angular-oauth2-oidc.git)
ngx-bootstrap/alert [es2015/esm2015] (git+ssh://git#github.com/valor-software/ngx-bootstrap.git)
ng2-search-filter [es2015/esm2015] (git+https://github.com/solodynamo/ng2-search-filter.git)
Encourage the library authors to publish an Ivy distribution.
⠋ Generating browser application bundles (phase: building)...C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\util\path.js:85
const c0 = p.charCodeAt(0);
^
TypeError: p.charCodeAt is not a function
at getType (C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\util\path.js:85:15)
at Resolver.isPrivate (C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\Resolver.js:480:10)
at Resolver.parse (C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\Resolver.js:464:25)
at C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\ParsePlugin.js:33:29
at Hook.eval [as callAsync] (eval at create (C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\tapable\lib\HookCodeFactory.js:33:10), :7:1)
at Resolver.doResolve (C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\Resolver.js:432:16)
at C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\AliasFieldPlugin.js:80:14
at Hook.eval [as callAsync] (eval at create (C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\tapable\lib\HookCodeFactory.js:33:10), :22:1)
at Resolver.doResolve (C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\Resolver.js:432:16)
at C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\NextPlugin.js:30:14
at _next0 (eval at create (C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\tapable\lib\HookCodeFactory.js:33:10), :23:1)
at eval (eval at create (C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\tapable\lib\HookCodeFactory.js:33:10), :45:1)
at C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules#ngtools\webpack\src\paths-plugin.js:115:17
at Hook.eval [as callAsync] (eval at create (C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\tapable\lib\HookCodeFactory.js:33:10), :37:1)
at Resolver.doResolve (C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\Resolver.js:432:16)
at C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\DescriptionFilePlugin.js:74:17
at C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\DescriptionFileUtils.js:118:13
at C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\forEachBail.js:16:12
at onJson (C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\DescriptionFileUtils.js:108:6)
at C:\4214_IOSM\Accenture.CIO.Inspire\Inspire_Client\node_modules\enhanced-resolve\lib\DescriptionFileUtils.js:68:7
at processTicksAndRejections (internal/process/task_queues.js:82:21)
How to fix the above error
Hi all I am using ImageMagick to convert image. But while running the server I am getting the following Error. Anyone have the answer for this? The error is below>
Invalid Parameter - 150
ImageMagick Error:
Error: write EOF
events.js:377
throw er; // Unhandled 'error' event
^
Error: write EOF
at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16)
Emitted 'error' event on ImageMagick instance at:
at onwriteError (E:\git_clone\nuron_core_ns\node_modules\readable-
stream\lib\_stream_writable.js:449:12)
at onwrite (E:\git_clone\nuron_core_ns\node_modules\readable-
stream\lib\_stream_writable.js:470:11)
at WritableState.onwrite (E:\git_clone\nuron_core_ns\node_modules\readable-
stream\lib\_stream_writable.js:180:5)
at ImageMagick.Duplexify._destroy
(E:\git_clone\nuron_core_ns\node_modules\duplexify\index.js:190:18)
at E:\git_clone\nuron_core_ns\node_modules\duplexify\index.js:182:10
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
errno: -4095,
code: 'EOF',
syscall: 'write'
i have a http request in a variable queryData = qs.parse(requestBody);
when i try to parse through winston
logger.log("info","requestbody",+queryData);
even tried
logger.log("info","requestbody %s", queryData);
logger.log("info","requestbody",{queryData});
didn't worked
am getting error like:
{ TypeError: Cannot create property 'Symbol(level)' on string 'Registering Device typeac'
at DerivedLogger.log (/home/grl/www/node_modules/winston/lib/winston/logger.js:130:20)
at createOcfRes (/home/aol/www/iot-node-server.js:285:10)
at IncomingMessage.<anonymous> (/home/aol/www/iot-node-server.js:115:9)
at emitNone (events.js:86:13)
at IncomingMessage.emit (events.js:186:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9) level: 'error', timestamp: '19-07-2018 20:20:19' }
Stacktrace is not having the reference to actual file name from where the error is triggered for the protractor.
Spec reporter configuration:
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true,}}));
Sample spec:
it('Protractor stacktrce issue', async () =>
{
const helper = new SearchHelper();
await helper.doSearch('test');
});
search-helper.ts:
async doSearch(text) {
await browser.get('http://google.com');
await browser.wait(EC.visibilityOf(element(by.name('q1'))), 10000, 'No Element found');
await element(by.name('q1')).click(); //invalid locator
}
1. Stack Trace with browser.wait
✗ Protractor stack trace issue
-Failed: No Element found Wait timed out after 10007ms
Wait timed out after 10007ms
at WebDriverError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)
at TimeoutError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:238:5)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2107:17
at process._tickCallback (internal/process/next_tick.js:109:7)
From asynchronous test: Error at Suite.<anonymous> (/Users/e2e/sample-spec.ts:27:3)
at Object.<anonymous> (/Users/e2e/sample-spec.ts:15:1)
at Module._compile (module.js:570:32) at Module.m._compile (/Users/node_modules/ts-node/src/index.ts:392:23)
at Module._extensions..js (module.js:579:10)
at Object.require.extensions.(anonymous function) [as .ts] (/Users/node_modules/ts-node/src/index.ts:395:12)
2. If we comment browser.wait statement then the stacktrace is
✗ Protractor stack trace issue
Failed: No element found using locator: By(css selector, *[name="q1"])
at WebDriverError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:27:5)
at NoSuchElementError (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:168:5)
at elementArrayFinder.getWebElements.then (/usr/local/lib/node_modules/protractor/lib/element.ts:851:17)
at process._tickCallback (internal/process/next_tick.js:109:7)Error
at ElementArrayFinder.applyAction_ (/usr/local/lib/node_modules/protractor/lib/element.ts:482:23)
at ElementArrayFinder.(anonymous function) [as click] (/usr/local/lib/node_modules/protractor/lib/element.ts:96:21)
at ElementFinder.(anonymous function) [as click] (/usr/local/lib/node_modules/protractor/lib/element.ts:873:14)
at SearchHelper.<anonymous> (/Users/e2e/search-helper.ts:14:34) **at step (/Users/e2e/search-helper.ts:32:23)
at Object.next (/Users/e2e/search-heper.ts:13:53)
at fulfilled (/Users/e2e/search-helper.ts:4:58)**
at process._tickCallback (internal/process/next_tick.js:109:7)
From asynchronous test: Error at Suite.<anonymous> (/Users/e2e/sample-spec.ts:27:3)
at Object.<anonymous> (/Users/e2e/sample-spec.ts:15:1) at Module._compile (module.js:570:32)
at Module.m._compile (/Users/node_modules/ts-node/src/index.ts:392:23)
at Module._extensions..js (module.js:579:10)
at Object.require.extensions.(anonymous function) [as .ts] (/Users/node_modules/ts-node/src/index.ts:395:12)
Observe the 2nd stack trace, it has references to search-helper file but it's not there in the first stack trace. It's very important to have this reference in stack trace for debugging.
I am very dummy on ElasticSearch and I have little experience with NodeJs. I have created few cruds using NodeJs + MongoDb. I have to change from MongoDb to ElasticSearch (this is mandatory). Please, I don't want to compare MOngoDb with ElasticSearch so don't try that.
I am following the example found here
https://blog.raananweber.com/2015/11/24/simple-autocomplete-with-elasticsearch-and-node-js/
I have started succesfully ElasticSearch. I can see:
nodejs express.js-elasticsearch-autocomplete-demo-master # curl --noproxy -XGET 'http://127.0.0.1:9200/?pretty'
{
"name" : "-em7X-s",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "cqJUaPcFREe4wX_YyYWoFg",
"version" : {
"number" : "5.2.1",
"build_hash" : "db0d481",
"build_date" : "2017-02-09T22:05:32.386Z",
"build_snapshot" : false,
"lucene_version" : "6.4.1"
},
"tagline" : "You Know, for Search"
}
However, when I try to start the sample above or access I get the error bellow respectvely:
/dev/samples/express.js-elasticsearch-autocomplete-demo-master $ npm start
> autocompleter#0.0.0 start /home/demetrio/dev/samples/express.js-elasticsearch-autocomplete-demo-master
> node ./bin/www
Elasticsearch INFO: 2017-02-16T20:00:48Z
Adding connection to http://localhost:9200/
Unhandled rejection Error: Bad Request
at respond (/home/demetrio/dev/samples/express.js-elasticsearch-autocomplete-demo-master/node_modules/elasticsearch/src/lib/transport.js:264:15)
at checkRespForFailure (/home/demetrio/dev/samples/express.js-elasticsearch-autocomplete-demo-master/node_modules/elasticsearch/src/lib/transport.js:223:7)
at HttpConnector.<anonymous> (/home/demetrio/dev/samples/express.js-elasticsearch-autocomplete-demo-master/node_modules/elasticsearch/src/lib/connectors/http.js:155:7)
at IncomingMessage.wrapper (/home/demetrio/dev/samples/express.js-elasticsearch-autocomplete-demo-master/node_modules/lodash/index.js:3095:19)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at nextTickCallbackWith2Args (node.js:441:9)
at process._tickCallback (node.js:355:17)
Unhandled rejection Error: [illegal_argument_exception] request [/randomindex/_suggest] contains unrecognized parameter: [type]
at respond (/home/demetrio/dev/samples/express.js-elasticsearch-autocomplete-demo-master/node_modules/elasticsearch/src/lib/transport.js:264:15)
at checkRespForFailure (/home/demetrio/dev/samples/express.js-elasticsearch-autocomplete-demo-master/node_modules/elasticsearch/src/lib/transport.js:223:7)
at HttpConnector.<anonymous> (/home/demetrio/dev/samples/express.js-elasticsearch-autocomplete-demo-master/node_modules/elasticsearch/src/lib/connectors/http.js:155:7)
at IncomingMessage.wrapper (/home/demetrio/dev/samples/express.js-elasticsearch-autocomplete-demo-master/node_modules/lodash/index.js:3095:19)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at nextTickCallbackWith2Args (node.js:441:9)
at process._tickCallback (node.js:355:17)
Unhandled rejection Error: [illegal_argument_exception] request [/randomindex/_suggest] contains unrecognized parameter: [type]
at respond (/home/demetrio/dev/samples/express.js-elasticsearch-autocomplete-demo-master/node_modules/elasticsearch/src/lib/transport.js:264:15)
at checkRespForFailure (/home/demetrio/dev/samples/express.js-elasticsearch-autocomplete-demo-master/node_modules/elasticsearch/src/lib/transport.js:223:7)
at HttpConnector.<anonymous> (/home/demetrio/dev/samples/express.js-elasticsearch-autocomplete-demo-master/node_modules/elasticsearch/src/lib/connectors/http.js:155:7)
at IncomingMessage.wrapper (/home/demetrio/dev/samples/express.js-elasticsearch-autocomplete-demo-master/node_modules/lodash/index.js:3095:19)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at nextTickCallbackWith2Args (node.js:441:9)
at process._tickCallback (node.js:355:17)
I am very confused what to check. Any suggestion will be appreciated. My final target is to understand how to connect to ElasticSearch from NodeJs application