Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
APPX HTML Client 5.4.6 & Higher | ||||||||
Line: 126 to 126 | ||||||||
There are various reasons why you would want to do this:
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
By default the installer will install a server connector on port 3014 and a mongo connector on port 3015. The installer accepts the following arguments: node appxConnector-install [appx | mongo] [appxport] [mongoport] | ||||||||
Line: 281 to 281 | ||||||||
Logging in as a specific user: http://<html client server>?requireLogin=false&specific=true&user=anon&password=password&host=<host name>&port=<port number> | ||||||||
Added: | ||||||||
> > | Designer Defined WidgetsStarting in Release 6.0, you can extend the function of the HTML client by adding your own widgets. This assumes some familiarity with HTML and jQuery. To start, in the web server folder copy or rename the appx-client-customTemplate.js to appx-client-custom.js. This file is in the 'js' subdirectory. For example:[root@localhost]# cd js [root@localhost js]# mv appx-client-customTemplate.js appx-client-custom.jsIn this example we'll add a signature widget to an input process. First we add one of the standard APPX widgets to an input process, then we override it with our custom widget. The widget you choose to override must accept the input you are going to supply it with. For example, a picture widget doesn’t accept user input and so is not a good choice for the signature pad since it returns a file name. In APPX:
appx_session.createWidgetTag[999] = function widget_signature(widget, $tag) { $tag = $("<canvas>").addClass("signaturepad"); $(function () { /*Need a little delay to let canvas get placed on screen*/ setTimeout(function () { /*Creating global so button clicks have access to signature pad*/ appx_session.signaturePad = new SignaturePad($(".signaturepad")[0]); const data = appx_session.signaturePad.toData(); setTimeout(function () { var ratio = Math.max(window.devicePixelRatio || 1, 1); $(".signaturepad")[0].width = $(".signaturepad")[0].offsetWidth * ratio; $(".signaturepad")[0].height = $(".signaturepad")[0].offsetHeight * ratio; $(".signaturepad")[0].getContext("2d").scale(ratio, ratio); appx_session.signaturePad.clear(); }, 0); appx_session.signaturePad.onEnd = function () { var fileBlob; appx_session.signaturePadID = $(".signaturepad").attr("id"); if (HTMLCanvasElement.prototype.toBlob !== undefined) { /*toBlob for all browsers except IE/Edge... Microsoft likes to create their own standards.*/ $(".signaturepad")[0].toBlob(function (blob) { fileBlob = blob; }); } else { /*IE/Edge version*/ fileBlob = $(".signaturepad")[0].msToBlob(); } /*Need slight delay to let blob get built.*/ setTimeout(function () { var fileName = "signature.png" + Date.now(); uploadFileToMongo(fileBlob, fileName, function () { $("#" + appx_session.signaturePadID).val("$(sendFile)\\" + fileName); $("#" + appx_session.signaturePadID).addClass("appxitem dirty"); }); }, 50); } }, 50); }); return $tag; } }The function defines the signature box and clears it. When the user exits the box, the graphic is converted to a blob & uploaded to the Mongo database. The URL to the file is returned to the APPX process. | |||||||
Troubleshooting
|