Class

WebBarcode


Description

Uses the device's camera to read any bar code types supported by the device.

Properties

Name

Type

Read-Only

Shared

ControlID

String

Enabled

Boolean

FullScreen

Boolean

Name

String

Page

WebPage

PanelIndex

Integer

Parent

WebView

Methods

Name

Parameters

Returns

Shared

Close

ExecuteJavaScript

script As String

FromImage

image As Picture

String()

GoToURL

url As String, inNewWindow As Boolean = False

Image

value As String, width As Integer, height As Integer, type As Barcode.Types = Barcode.Types

Picture

StartScan

StopScan

UpdateBrowser

Events

Name

Parameters

Returns

Closed

Opening

ScanCancelled

ScanCompleted

value As String

ScanFailed

Property descriptions


WebBarcode.ControlID

ControlID As String

Identifies the control on a per session basis.

This property is read-only.


WebBarcode.Enabled

Enabled As Boolean

When True the WebControl is drawn enabled and responds to user action. When False, the control appears as disabled and does not respond to user actions.

In the case of WebTimer, when set to False this disables and stops the WebTimer. When set to True, it starts the WebTimer.

Disable a button when a check box value changes:

If AllowSaveCheckBox.Value Then
  SaveButton.Enabled = True
Else
  AllowSaveButton.Enabled = False
End If

WebBarcode.FullScreen

FullScreen As Boolean

If True the barcode scanner will appear full screen.

This can be changed even while the barcode scanner is already displayed.


WebBarcode.Name

Name As String

The name of the control.

This property is read-only.


WebBarcode.Page

Page As WebPage

Identifies the web page that contains the control.

This property is read-only.


WebBarcode.PanelIndex

PanelIndex As Integer

If the control has been placed on a WebTabPanel or WebPagePanel control, this is the panel (page/tab) that the control is on. If the control is not on a panel, it returns -1.

The first panel is numbered zero. If the control has been placed on a panel of a WebTabPanel or WebPagePanel control, it returns the panel number. If the control is not on a WebPagePanel or WebTabPanel, it returns -1. If you change the PanelIndex to a nonexistent panel, the control will disappear until you give it a PanelIndex value that corresponds to a panel that exists.

If you are looking to change the currently selected panel (page/tab), use SelectedPanelIndex.

This code displays the panel index of the control that is on the page.

MessageBox(Me.SelectedPanelIndex.ToString)

WebBarcode.Parent

Parent As WebView

Used to get the control's parent control or page. If the parent control is a WebContainer, then it returns the WebContainer. If it is on a WebPage, it returns the WebPage.

This property is read-only.

Method descriptions


WebBarcode.Close

Close

Removes the control from the page.


WebBarcode.ExecuteJavaScript

ExecuteJavaScript(script As String)

Executes the JavaScript passed. The JavaScript passed can call a JavaScript function in a WebPageSource control.

The Xojo web framework uses EcmaScript 6 which is more strict than previous versions of JavaScript. For more details, see the EcmaScript 6 documentation.

This code in the Pressed event of a Button displays an alert using JavaScript:

Me.ExecuteJavaScript("alert('Hello!');")

This code will select the text in a WebTextField (or WebTextArea):

WebTextField1.ExecuteJavascript("document.getElementById('" + _
WebTextField1.ControlID + "_inner').select();")

WebBarcode.FromImage

FromImage(image As Picture) As String()

Returns an array of the unique identifiers from all detected barcodes in the image provided.

This method is shared.


WebBarcode.GoToURL

GoToURL(url As String, inNewWindow As Boolean = False)

Opens the passed url in place of the current web page or downloads a file. If inNewWindow is True, the browser is asked to open the url in a new window.

If the browser has popup windows disabled and inNewWindow is True, the method silently fails and the page is not shown.

If inNewWindow is False, the running web app is replaced with the specified url. If you want to display an external web site within your web app, use the WebHTMLViewer control.

Display a web site in a new popup window:

Me.GoToURL("http://www.wikipedia.org", True)

WebBarcode.Image

Image(value As String, width As Integer, height As Integer, type As Barcode.Types = Barcode.Types) As Picture

Returns an image with the value encoded as the specified type of barcode.

This method is shared.


WebBarcode.StartScan

StartScan

Opens the scanning user interface provided by the device to scan a barcode. The device will auto-detect the type of barcode.


WebBarcode.StopScan

StopScan

Stops the process of scanning barcodes and closes the scanning user interface on the device.


WebBarcode.UpdateBrowser

UpdateBrowser

Forces the current values of the control to be sent to the browser.

This method is useful when you are computing values in a loop and wish to update the browser immediately rather than wait until the current method ends.

This code iterates through a RowSet of database rows, updates a ProgressBar and then forces the updated ProgressBar to be sent to the browser via UpdateBrowser.

ProgressBar1.MaximumValue = SalesData.RowCount

For Each row As DatabaseRow in SalesData
  AnalyzeSales(row)
  ProgressBar1.Value = ProgressBar1.Value + 1
  ProgressBar1.UpdateBrowser
Next

Event descriptions


WebBarcode.Closed

Closed

The control has been removed from the page either because the page has closed or the control's Close method was called.


WebBarcode.Opening

Opening

The control has been created and the page is opening but has not been sent to the browser yet.

The Opening event handler can be used to initialize non-visual properties and settings for controls.


WebBarcode.ScanCancelled

ScanCancelled

The user canceled the scan.


WebBarcode.ScanCompleted

ScanCompleted(value As String)

A barcode was successfully scanned. The value is the unique identifier scanned.


WebBarcode.ScanFailed

ScanFailed

The scan was not able to complete.

Notes

Supported barcode types

The following types of barcodes are supported:

Type

Description

Aztec

Two-dimensional Barcodes and has a characteristic square pattern in the middle. This Code is widely used by railway companies in their ticketing systems.

Codabar

Codabar can encode the digits 0-9, several special characters (- $ : / . +), as well as special start and stop characters (A, B, C, D). These start and stop characters are required to clearly mark the beginning and end of the code.

Code39

Widely used in a variety of industries and is part of of many governmental specifications. It encodes a set of alphanumeric symbols.

Code93

Encodes numerical input, as well as capital letters and some special characters. It used by Canada Post for additional delivery information.

Code128

Universal barcode with excellent data density. It is used, for example, in shipping and packaging.

Data Matrix

Two-dimensional Code that may contain text, numbers or binary data. It is widely used for labeling small electronic components or in food production, but also on mail labels.

EAN8

Derived from the longer European Article Number (EAN-13) code. It was introduced for use on small packages where an EAN-13 barcode would be too large.

EAN13

Codes are widely used in retail across Europe. There are several versions of EAN encoding 2, 5, 7 or 12 digits.

Interleaved2of5

Developed on the basis of Industrial Code 2 of 5 and only encodes an even number of digits. It is used in warehousing and industrial applications.

ITF14

Also called SCC-14 is used to mark shipping containers. It is also placed on cartons and pallets and signifies the type of products transported.

PDF417

Suitable for storing large amounts of data due to its two-dimensional structure. It is widely used for labeling electronic equipment or hazardous materials, but also on personal IDs.

QR

Applications include product tracking, item identification, time tracking, document management, and general marketing.

UPC-A

Contains 12 digits, no letters or other characters. The UPC-A barcode is by far the most common and well-known symbology, especially in the United States.

UPC-E

Only has 8 digits and is used instead of UPC-A on smaller products. It is similarly used in retail and warehousing, especially in the USA and Canada.

Compatibility

Project Types

Web

Operating Systems

All

See also

WebControl parent class; Barcode class