microsoft / microsoft/Dynamics365Commerce.Solutions
NumPad support with CustomViewControllerBase
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 80
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
Extensibility request:
Provide support for adding NumPad and INumPadInputBroker to custom pos -views- that extend from CustomViewControllerBase.
Similar to how custom pos -dialogs- extend from ExtensionTemplatedDialogBase and thus get the NumPad and INumPadInputBroker brokers “for free” (without requiring extension code to initialize it).
Context:
In the legacy RetailSDK, when creating custom views, we extended the ExtensionViewControllerBase abstract class.
With the introduction of the CommerceSDK, ExtensionViewControllerBase is now deprecated.
This deprecated abstract class ExtensionViewControllerBase had some useful properties:
- Ability to embed an OOTB
NumPadto a custom view - An OOTB instance of
INumPadInputBrokerinherited from implementingINumPadContainerwhich allowed theNumPadto intercept keyboard (or scanner) input
With the new CommerceSDK, the requirement is to extend CustomViewControllerBase abstract class instead.
- We no longer have the ability to add an OOTB
NumPad(with OOTBINumPadInputBroker) to a custom view.
The official sample extension on GitHub for the InStore.BarcodeMsrDialogSample utilizes IAlphanumericNumPad but this is for a -dialog- (not a -view-).
- The dialog class in the BarcodeMsrDialogSample is called
BarcodeMsrDialog.ts - It extends from
ExtensionTemplatedDialogBasewhich provides the implementation of an input broker "for free" (no need for the extension code to initialize it) - This functionality is not available for custom pos views though
As a potential workaround, I've attempted the following:
Implement INumPadInputSubscriberEndpoint:
Instantiate the broker from the subscriber:
Initialize options and bind the NumPad:
The workaround described above allows the NumPad to render on the custom view.
But it's still not behaving fully as intended.
Below describes the main issue:
The screenshot below has been taken immediately upon loading of the custom view.
And I’m typing on the keyboard but none of the digits are rendering on the NumPad (it doesn’t recognize it).
Because of that, as a test, I decided to click the NumPad “input bar” – you can see the dotted lines:
Now when I enter keyboard input, the digits show up:
^ If I “click out” of the input bar (no more dotted lines) – then it goes back to the first screenshot behaviour (it does not recognize/update keyboard input).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing CustomViewControllerBase with ExtensionTemplatedDialogBase, then read the BarcodeMsrDialog.ts example at the stated sample path. Trace how NumPad and INumPadInputBroker are provided to dialogs and how the custom view workaround initializes them. Done means a custom view can use the OOTB NumPad and broker with keyboard or scanner input without requiring an input-bar focus workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100