My mobile part of ExtLib in XPages not working - mobile

Have problem with mobile part of ExtLib. I now reinstalled all to latest server 9.0.1 and do my first test.
ALl other ExtLib function work, in which case the features I tested. Have also tried ExtLib application and where it works as it should except Mobile.
If I use the solutions for mobile that I built in the past they do not work or if I build new. XPages/ExtLib/Mobile shows a blank page and no errors but if I check in the code, the following message.
Same error regardless of application, feels like something is missing. I have also installed the latest version from OpenNTF but the error persists.
<script type="text/javascript">
XSP.addOnLoad(function() {XSP.attachPartial("view:_id1:appPage3_content:_id9","view:_id1:appPage3_content:button2","view:_id1:appPage3_content", "onclick", function(){}, 2, "view:_id1:appPage3_content");
XSP.attachPartial("view:_id1:appPage3_content:_id10", "view:_id1:appPage3_content:tabBarButtonCancel", "view:_id1:appPage3_content", "onclick", function(){}, 0, "view:_id1:appPage3_content");
XSP.attachPartial("view:_id1:appPage3_content:_id12", "view:_id1:appPage3_content:tabBarButtonSave", "view:_id1:appPage3_content", "onclick", function(){}, 2, "view:_id1:appPage3_content");
XSP.attachValidator("view:_id1:appPage3_content:inputTextSubject",new XSP.RequiredValidator("Validation Error: Value is required."),null);
XSP.attachValidator("view:_id1:appPage3_content:inputTextCategory1",new XSP.RequiredValidator("Validation Error: Value is required."),null);
XSP.attachValidator("view:_id1:appPage3_content:inputText2",new XSP.RequiredValidator("Validation Error: Value is required."),null);
XSP.attachPartial("view:_id1:appPage4_content:_id31", "view:_id1:appPage4_content:saveButtoninActionFacet", "view:_id1:appPage4_content", "onclick", function(){}, 2, "view:_id1:appPage4_content");
XSP.attachPartial("view:_id1:appPage4_content:_id32", "view:_id1:appPage4_content:tabBarButtonSubmit", "view:_id1:appPage4_content", "onClick", function(){}, 2, "view:_id1:appPage4_content");
XSP.attachValidator("view:_id1:appPage4_content:inputTextSubject2",new XSP.RequiredValidator("Validation Error: Value is required."),null);
XSP.attachValidator("view:_id1:appPage4_content:inputTextCategory2",new XSP.RequiredValidator("Validation Error: Value is required."),null);
XSP.attachValidator("view:_id1:appPage4_content:inputText1",new XSP.RequiredValidator("Validation Error: Value is required."),null);
});
</script>

Not sure if this is your issue or not, but in the Xsp Properties on the General tab. Ensure the "Use mobile theme for XPages with the prefix:" is checked and then define a mobile prefix (i.e. "m_"). Then your xpage should be named "*m_*something". Also ensure the "Mobile theme" is set to "Mobile default".
The code you pasted into your question isn't reporting an error but is defining the client side events on your xpage.

Related

React and core-js can't polyfill for IE10

Problem
For some reason my React app runs in document mode IE 10 as a standard when published to the company's DNS. Weird admin settings I have no control over.
Any way, support for IE 10 was needed. In IE 11 it worked fine, using the suggested react-app-polyfills:
import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';
And then, trying with ie9 instead of ie11. No success, the app crashed. Did the polyfill not work? I had a lot of error messages such as:
Unhandled promise rejection Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%7D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
"Unhandled promise rejection"
{
[functions]: ,
description: "Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%7D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.",
message: "Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%7D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.",
name: "Error",
stack: "Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%7D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at _o (https://the-company's-domain.com/static/js/2.517170ee.chunk.js:2:559477)
at Anonymous function (https://the-company's-domain.com/static/js/2.517170ee.chunk.js:2:564365)
at Ra (https://the-company's-domain.com/static/js/2.517170ee.chunk.js:2:573836)
at gs (https://the-company's-domain.com/static/js/2.517170ee.chunk.js:2:614144)
at cu (https://the-company's-domain.com/static/js/2.517170ee.chunk.js:2:604884)
at su (https://the-company's-domain.com/static/js/2.517170ee.chunk.js:2:604812)
at Zs (https://the-company's-domain.com/static/js/2.517170ee.chunk.js:2:601824)
at Anonymous function (https://the-company's-domain.com/static/js/2.517170ee.chunk.js:2:553207)
at t.unsta",
Symbol()_a.ycgs6yczz5z: undefined,
Symbol()_m.ycgs6yczz5z: undefined,
Symbol(extensions)_16.ycgs6yczzi: undefined,
Symbol(foo)_1a.ycgs6yczzi: undefined,
Symbol(foo)_17.ycgs6yczzi: undefined,
Symbol(foo)_18.ycgs6yczzi: undefined,
Symbol(foo)_19.ycgs6yczzi: undefined,
Symbol(meta)_2.ycgs6yczz8v: { },
Symbol(nodejs.util.inspect.custom)_15.ycgs6yczzi: undefined,
Symbol(react.async_mode)_11.ycgs6yczzi: undefined,
Symbol(react.block)_10.ycgs6yczzi: undefined,
Symbol(react.concurrent_mode)_y.ycgs6yczziy: undefined,
Symbol(react.context)_t.ycgs6yczz5z: undefined,
Symbol(react.element)_n.ycgs6yczz5z: undefined,
Symbol(react.forward_ref)_u.ycgs6yczz5z: undefined,
Symbol(react.fragment)_p.ycgs6yczz5z: undefined,
Symbol(react.fundamental)_12.ycgs6yczzi: undefined,
Symbol(react.lazy)_x.ycgs6yczziy: undefined,
Symbol(react.memo)_w.ycgs6yczziy: undefined,
Symbol(react.portal)_o.ycgs6yczz5z: undefined,
Symbol(react.profiler)_r.ycgs6yczz5z: undefined,
Symbol(react.provider)_s.ycgs6yczz5z: undefined,
Symbol(react.responder)_13.ycgs6yczzi: undefined,
Symbol(react.scope)_14.ycgs6yczzi: undefined,
Symbol(react.strict_mode)_q.ycgs6yczz5z: undefined,
Symbol(react.suspense)_v.ycgs6yczz5z: undefined,
Symbol(react.suspense_list)_z.ycgs6yczziy: undefined
}
Very hard to understand the minified bundle, since I could only replicate this problem LIVE, not in dev (some dependencies in create-react-app doesn't work with polyfill + hot-reload). This link https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%7D&args[]= led to this:
Objects are not valid as a React child (found: object with keys {}). If you meant to render a collection of children, use an array instead.
Which made me believe it had something to do with an unsuccessful polyfill on Object.... (I was wrong, read answer below)
Solution
8 hours later... (thank god I'm getting paid for this)
Turns out, the polyfill on Object added an element to the object, which completely messed with my code when I iterated over it, like this...
Object.entries(queryData.data.time).map((day) => {
... did stuff
Weird stuff, no problem in IE11 or any other browser.
Take away
Apparently some polyfills add a __proto__ element to the object. Be aware!

CefSharp ist not performing the button action to start a local exe

I want to show a local html with a button which should call a custom protocol to open a local app - by using a registry setting in 'HKEY_CLASSES_ROOT' (see here). The html looks like
<!DOCTYPE html>
...
<body>
<input type="button" onclick="location.href='xyz:OpenApp?id=123';" value="Open App" />
</body>
</html>
This works from within Chrome, IE and Edge, and no matter if I load the html as file directly or start it by calling http://localhost from tiny web server.
But unfortunately I have no luck when this page is shown either way by CefSharp (Wpf, Version 79.1.360 on Win10 64Bit, 1909, .NET 4.6.1) - instead (after clicking the button ) the html page flips to a blank page and the action is not performed.
I am loading the html as follows:
Browser.Address = #"http://localhost/"; // or
Browser.Address = #"D:\TestButton.html";
I also tried applying CefSettings, e.g. to set LogLevel to Verbose, but the debug.log (at the moment of clicking) contains nothing I would understand:
[0505/083914.727:ERROR:paint_controller.cc(548)] PaintController::FinishCycle() completed
[0505/083914.817:INFO:cpu_info.cc(53)] Available number of cores: 4
[0505/083914.841:VERBOSE1:v8_context_snapshot.cc(153)] A context is created from snapshot for main world
[0505/083914.859:VERBOSE1:script_context.cc(117)] Created context:
extension id: (none)
frame: 00000E926B822498
URL:
context_type: WEB_PAGE
effective extension id: (none)
effective context type: WEB_PAGE
[0505/083914.859:VERBOSE1:script_context.cc(117)] Created context:
extension id: (none)
frame: 0000000000000000
URL:
context_type: UNSPECIFIED
effective extension id: (none)
effective context type: UNSPECIFIED
[0505/083914.859:VERBOSE1:dispatcher.cc(362)] Num tracked contexts: 1
[0505/083914.865:ERROR:paint_controller.cc(548)] PaintController::FinishCycle() completed
[0505/083914.869:VERBOSE1:dispatcher.cc(539)] Num tracked contexts: 0
[0505/083914.870:VERBOSE1:script_context.cc(124)] Destroyed context for extension
extension id:
effective extension id:
[0505/083914.870:VERBOSE1:script_context.cc(124)] Destroyed context for extension
extension id:
effective extension id:
I have no clue which other setting could affect this and I am aware that this problem is maybe related to CEF and not to CefSharp in particular, but I am not able to find this out.
Any idea someone?

Parsley js remote config. Error browser dev console

I followed the Custom remote validators documentation
I have <script href="parsley.remote.js"></script> before <script href="parsley.js"></script> just before the end of html body and I'm seeing the following message on the console of Chrome Developer Tools:
Uncaught TypeError: Cannot read property 'on' of undefined(anonymous function) # parsley.remote.js:267(anonymous function) # parsley.remote.js:271
Part of paryley.remote.js code :
window.Parsley.on('form:submit', function () {
this._remoteCache = {};
});
On Firebug the error console message is
TypeError: window.Parsley is undefined
window.Parsley.on('form:submit', function () {
A small lab just a test html page with source dist js parsley
If I invert file reference parsley.remote.js and parsley.js, the error disappears, but according to the documentation, it's not the right way.
It's was bug, fixed in 2.1.3+.
Only include the remote version (assuming you need it).

Esri bootstrap-map-js and Invalid argument error on IE 7/8

I'm using this awesome project called bootstrap-map-js.
A simple framework for building responsive mapping apps with ArcGIS
and Bootstrap.
Since Esri ArcGIS JavaScript API states that they support IE7+ I thought the amazing bootstrap-map-js project would also be compatible with IE 7. Maybe it is and the problem is in my code...
I'm getting an Invalid Argument error with no further info on IE 11 Developer Tools console window when simulating the page on IE 7/8 document modes. IE 9 onwards works great. All other browsers work great too! :) Only finicky IE refuses to work as always...
Looks like dojo.require is barking somewhere. See this related question: Dojo nested requires on IE7 and IE8 causes Invalid Argument Exception
If I remove the reference to bootstrapmap.js and the var map = ... declaration, then the code works and I see hey Leniel! otherwise the code breaks and I see the Invalid argument. The code breaks in the call to BootstrapMap.create.
Can anyone shed some light on what's going on with finicky IE? Is there anything I can do to see more from the error? As you see in the image, there's no message, description, etc. :(
Here's the minimum code I had to assemble to get to what was causing the error:
<!-- ArcGIS JavaScript API v3.8 -->
<script type="text/javascript" src="http://localhost/arcgis_js_api/library/3.8/3.8/init.js"></script>
<script type="text/javascript">
function init()
{
require([
"esri/map",
"/myproject/Scripts/bootstrapmap.js",
"esri/layers/FeatureLayer"
], function(
Map,
BootstrapMap,
FeatureLayer
)
{
// Get a reference to the ArcGIS Map class
var map = BootstrapMap.create("mapDiv", {
basemap: "oceans",
center: [-117.789, 33.543],
zoom: 12
});
alert('hey Leniel!');
});
}
dojo.addOnLoad(init);
</script>
I made some progress on this issue as you can read here.
I read Configuring Dojo with dojoConfig and then added this before ArcGIS JS API script tag:
<!-- set Dojo configuration, load Dojo -->
<script>
dojoConfig = {
has: {
"dojo-firebug": true
},
parseOnLoad: true,
async: true
};
</script>
Now I get a more descriptive error instead of only Invalid argument as before. IE Dev Tools shows this:
SCRIPT87: Invalid argument.
File: init.js, Line: 136, Column: 65
This is line 136 in init.js when I click on the link provided by IE Dev Tools:
b;b=d[b]?"cssFloat"in f.style?"cssFloat":"styleFloat":b;if(3==k)return q?g(f,e):f.style[b]=e;for(var r in b)l.set(a,r,b[r]);return l.getComputedStyle(f)};return l})},"dojo/dom-geometry":function(){define(["./sniff","./_base/window","./dom","./dom-style"],function(b,n,k,m){function l(a,b,d,c,h,f){f=f||"px";a=a.style;isNaN(b)||(a.left=b+f);isNaN(d)||(a.top=d+f);0<=c&&(a.width=c+f);0<=h&&(a.height=h+f)}function r(a){return"button"==a.tagName.toLowerCase()||"input"==a.tagName.toLowerCase()&&"button"==
Sounds like IE 7/8 is barking about some crazy CSS manipulation done by ArcGIS JS API.
Fixed it connecting the dots...
Searched for NaNpx e's value as I had never seen that before. Found this jQuery ticket.
Followed the advice given there and changed that return in line 136,
from:
return q?g(f,e):f.style[b]=e;
to:
return q?g(f,e):f.style[b]=(e=='NaNpx'?'0px':e);
Note: I'm using jQuery 1.11.0 which supports IE 7.

AngularDart on Firefox fails with "receiver.webkitCreateShadowRoot is undefined"

I have an AngularDart application that is working fine on Chromium and Chrome with Javascript. But in Firefox and IE, I get the following error:
[14:36:14.648] "NullError: receiver.webkitCreateShadowRoot is undefined
STACKTRACE:
.Element.createShadowRoot$0#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:84445
J.createShadowRoot$0$x#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:153659
._ComponentFactory.call$6#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:11337
.BlockFactory__instantiateDirectives__closure2.call$1#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:11097
.Primitives_applyFunction#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:5148
._FactoryProvider.get$2#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:125034
J.get$2$x#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:153716
.DynamicInjector__getInstanceBySymbol_closure.call$0#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:124806
._defaultCreationStrategy#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:125162
.Binding.creationStrategy$3#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:125271
.DynamicInjector._getInstanceBySymbol$2#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:124652
.DynamicInjector.get$1#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:124694
J.get$1$x#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:153713
.BlockFactory__instantiateDirectives_closure3.call$1#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:11183
.IterableMixinWorkaround_forEach#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:22126
.JSArray.forEach$1#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:1995
J.forEach$1$ax#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:153707
.BlockFactory._instantiateDirectives$5#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10887
.BlockFactory._dom$_link$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10816
.BlockFactory._dom$_link$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10818
.BlockFactory._dom$_link$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10818
.BlockFactory._dom$_link$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10818
.BlockFactory.call$2#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10776
.ngBootstrap_closure0.call$0#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:7661
._rootRun#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:27183
._ZoneDelegate.run$2#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:34652
.NgZone__onRun_closure.call$0#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10306
.NgZone._onRunBase$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10162
.NgZone._onRun$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:10181
$$.BoundClosure$4<.call$4#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:424
._ZoneDelegate.run$2#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:34652
._CustomizedZone.run$1#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:35046
.ngBootstrap#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:7485
.main#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:130170
._IsolateContext.eval$1#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:3635
.startRootIsolate#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:3301
#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:161315
#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:161295
#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:161309
#http://127.0.0.1:3030/foobarUI/web/foobarui.dart.js:9
"
Here is my foobarUI/pubspec.yaml:
name: foobarUI
description: A sample web application
dependencies:
angular: 0.9.3
browser: any
json_object: any
petitparser: any
unittest: any
foobar:
path: ../foobarLib
I tried to add the js, shadow_dom and web_ui modules but it made no difference.
I tried to add "useShadowDom = true;" (and false) to the main dart file, no difference.
From the error, it seems obvious that the webkit support for DOM shadow root is missing but why is this module not handling this ?
The same error occurs with angular.dart.tutorial chapter_03 sample. This is clearly an issue with Angular.Dart. Bug filed as: https://code.google.com/p/dart/issues/detail?id=15752
The Dart bug for issue is at: https://code.google.com/p/dart/issues/detail?id=15144
It has been fixed in Dart bug has not been pushed to AngularDart yet. That work is blocked by https://github.com/angular/angular.dart/issues/366.

Resources