Add Signatures, Voice Memos and more to your MV App with SB/XA | A How To

SB/XA 6.5.1 includes exciting new functionality where you can use a data entry custom control for entering and displaying data in a form instead of using the standard SB/XA controls (Text, Combo Box, Toggle etc). The advantage is that binary data such as an image or an audio file can not only be displayed but can also be edited within a field. Also, please note this applies not just to single value but also to MultiValue fields.

Why do I want to do this?

Traditionally, items such as signatures, images and audio files are stored by an SB application via a link to the file, rather than in the database itself. This means that each time this data is accessed the user must shell out from the SB application and in to another. It also means that the data is stored outside the MV database – with possible negative implications for both security and performance.

How do I do this?

First you create an XAML control style that sets the templates and any other properties required for the control when accessed within SB/XA. The “SBXA Documentation.chm” file, shipped with the SB/XA product, now contains a new section “Data Entry Custom Control” that describes how to create these types of control. Note that not only do you need to create a .NET control that wraps the new functionality so it can interact correctly with SB/XA but you must also create new SB/XA field styles to replace the standard styles to use the new control in a form. These tasks require knowledge of building .NET assemblies, Windows Presentation Foundation (WPF), and XAML styling.

To help developers make use of the new functionality, we have included an example control with the product, a Visual Studio C# project called “SBXAInkControlExample”. This project creates a custom control that can be used in a Rich Client SB/XA form. The control allows you to use a Microsoft InkCanvas class on a form so users can make drawings on a field with the mouse – to capture, for example, a signature. The product also provides four new styles, that you can use on single and MultiValue screens, for display and for editing. The control itself, as well as documentation on how to implement it, is included in the shipped product, under the ‘Extra’ folder.

What can I achieve?

In our example control, which allows you to use an InkCanvas on a form, the field captures, stores and displays a signature i.e., drawings to be made on a field with the mouse:

If you’re running SB/XA 6.5.1, I encourage you to consider how this new functionality can enhance the usability of your application. If you’re not yet on SB/XA 6.5.1, I encourage you to upgrade soon!

0 Comments

Leave a Comment

Your email address will not be published.