I've added an extension project as per the examples, have added an event handler in Pos.Extension.ts for a Blank operation, and now clicking on my new button will take me to the correct OperationHandler class. My POS solution looks like this:
I'd like to navigate to a new screen, so I have copied the html and Typescript files from InventoryLookupView and sorted out the references so that it all builds. However, I'm having major difficulty actually getting to my new view.
If I call this then I can go to the original one:
Commerce.ViewModelAdapter.navigate("InventoryLookupView");
I'd like to do the same with my new view.
I've added these pieces into my Pos.Extension.ts to try to create the necessary event handlers for my new view:
var navigation: Commerce.IView[] = [ { title: "Transfers and Wastage View", page: "ProductTransferWastageView", phonePage: "ProductTransferWastageView", path: "../../Pos.Extension.K3.ProductWastage/Views", viewController: Custom.ViewControllers.ProductTransferWastageViewController } ]; document.addEventListener('DOMContentLoaded', (event: Event) => { // operations Commerce.Operations.BlankOperationHandler.registerBlankOperationHandler("ProductTransfer", new Custom.Operations.ProductWastageOperationHandler()); //deal with navigate event navigation.forEach((viewConfiguration: Commerce.IView) => { // Register regular view if (Commerce.StringExtensions.isNullOrWhitespace(viewConfiguration.page) || Commerce.StringExtensions.isNullOrWhitespace(viewConfiguration.path) || Commerce.ObjectExtensions.isNullOrUndefined(viewConfiguration.viewController)) { return; } Commerce.ViewModelAdapterWinJS.define(new Commerce.ViewConfiguration(viewConfiguration)); }); });
However, the path is not resolving correctly.
I'm left with the questions:
1. Am I correct in putting my views into the same new project as my Operation logic?
2. How should I wire up the event handlers so that I can actually navigate to this view?
3. Are there any examples for the Modern POS to show the current recommended way of doing these things (the only examples I've found are old and involve modifying Pos.App and SharedApp code, which I'm sure is now deprecated)? I've done a lot of hunting around on the web looking for guidance on this, but I've not had much joy.
Thanks for any advice you can provide
Duncan