How To Articles
How To articles on a variety of subjects.
- How to Add a Chart Control to a UX Component
The Chart Control can be used to create charts that display information, such as stock values or trend lines, in a UX Component.
- How to Add a Google Chart to a UX Component
The Google visualization libraries offer an alternative to creating and displaying charts in a UX Component.
- How to Use Chart Events to Add Effects
Pie slices can be "exploded" to add emphasis. Chart events can be used to dynamically explode pie slices in a Chart control when the chart is double-clicked. Events also be used to enhance a chart with effects such as popup help or additional details.
- How to Base a Chart on Cross-sectional Data
When a data series must be based on multiple fields in a record rather than a single field across multiple records, a Cross-Sectional data series can be created to map multiple columns in a table to one or more sub-series.
- How to Base a Chart on a Custom Series
An Xbasic function can be used to create a Custom data series that dynamically computes sub-series data from a SQL database.
- How to Customize the Chart Control Background and Labels
Several pre-configured themes are available for changing how a Chart control looks. Themes are great for many cases, however some effects can only be achieved by using CSS.
- How to Define Labels for Bars in Bar Charts
The default behavior of using the data value for a bar chart labels can be changed.
- How to Download a Google Chart as a bitmap
Some Google Charts can be downloaded as a bitmap image and embedded in a PDF or saved to disk. A button added to a UX Component can be used to download a chart created using the Google Chart API.
- How to Export Charts to PDF or RTF Format
- How to Plot Multiple Data Series on a Single Chart
Multiple data series can be plotted in one Chart control, either as one chart type or using several chart types.
- How to Plot Time Series
Alpha Anywhere's server-side charting controls will evenly distribute date and time series when plotting the data, even if the series is missing intermediate dates.
- How to Refresh a Data Series for One or More Chart Controls
Multiple Chart controls can reference the same data series. When a Data series is refreshed, all charts that reference the data series are also updated.
- How to Split a Series into Multiple Series
A Data Series can be split into multiple logical series using a sub-series. This technique is useful in situations where the data you would like to plot can easily be split into multiple series - such as sales information over multiple years by company.
- How to Use SQL Data in a Google Chart
Data used to populate a Google Chart can be dynamically created from a SQL database.
- How to Write a Charting Application For a Web Service
Charts can be created based on data from a Web Service. Using Xbasic callbacks, data from a web service such as Yahoo! Finance can be retrieved and used to populate a data series in a Chart control.
- How to call a SQL Server stored procedure from a Grid
Stored procedures can be called from a Grid component to get data from a database.
- How to Use User-Defined Scalar Functions in Oracle and SQL Server
User-defined scalar functions in Oracle and SQL Server can be called from Alpha Anywhere.
- How to Create a Database Snapshot and Store it in a SQLLocalDB Database
Having a way to create and share data in databases is desireable in some situations. Test databases, sample databases, or databases shipped with an app can be created using database snapshots.
- Creating a Grid Based on a Microsoft Access Table or View
Step by step instructions for creating and formatting a Microsoft Access table or view.
- Creating a Grid for Microsoft Access Using the SQL Builder
Step by step instructions for creating and formatting a grid for Microsoft Access using the SQL builder.
- How to Dynamically Connect to a Database Using an Encrypted Password
Connecting to databases using dynamic connection strings can be done securely.
- How to Dynamically Construct SQL Statements
This interactive session demonstrates how you can programmatically modify SQL statements from Xbasic.
- How to Export a SQL Query to Excel Using Xbasic
Excel files can be generated with data from Xbasic SQL queries in Alpha Anywhere.
- How to Export Tables from a Database
When sharing components or sending in a bug report, you need to include a backup of the table(s) referenced by the component. Otherwise, the component cannot be run. This article describes how to export data from tables in MySQL or SQL Server.
- How to Connect to SQL Server from 64-bit Windows
Alpha Anywhere SQL Server interface is a wrapper around Microsoft s SQL Server ODBC drivers (there are now three versions). If you are able to create a DSN with the Microsoft ODBC manager, then you will be able to connect with Alpha Anywhere as well.
- How to Import Mixed Format Columns from Excel
When you use AlphaDAO to import Excel spreadsheets, you are using the Microsoft (MDAC) ODBC driver. If you mix numbers and text in a column, the results may not be what you expect.
- How To Improve SQL Server Query Performance by Using Indexes
Performance of queries against SQL Server can be affected by string arguments due to an issue with the SQL Server optimizer.
- How to Mark Records Deleted Without Physically Deleting Them
In some applications, you may want to allow users to mark records as 'deleted' without physically deleting the record from the database. this can be done using a logical field to flag a record as deleted.
- How to Use Output Arguments with Stored Procedures in Xbasic
Most queries performed on a SQL database use Input arguments. However, Xbasic offers the ability to also use Output and InputOutput arguments return values from stored procedures.
- How to avoid write conflicts on datetime fields
If you choose a date/time format that does not include seconds for a grid text field, but store seconds in the DATETIME field in your database, you can encounter write conflicts if the stored values have non-zero seconds. For example, you might choose this as your date/time format:
- How to Base a Grid on a Stored Procedure
The Grid component does not allow you to base a Grid on a stored procedure prior to V11. You must specify a SQL Select statement. You can however work around this limitation to a limited degree if your Grid is readonly.
- How to Call a UX Component from a Grid and Pass Information from the UX Component Back into the Grid
Steps and examples on how to do this are described in this page.
- How to Collapse a Group in a Grid Component
Group breaks are a useful way to organize records in a Grid Component. You can add special directives that enable a user to expand or collapse records in a group in a Grid component.
- How to Create a Grid with a Form Layout
Records in a Grid component can be configured to display as "forms", similar to the type of layouts you can create in the UX Component.
- How to Define Dynamic Content for a Tab/Accordion Control Pane
- How to Disable Grid Input Controls when Update is not Allowed for the Current User
In a Grid component if you have the Security Framework enabled and the user does not have permission to update data, the input controls are still enabled even though the user will not be able to save any edits. It might be desirable to disable input controls when the user does not have update permission.
- How to Display a Fade Out Message When a Record is Saved
- How to Display a Three State Checkbox on a Grid Component
Logical values stored in a database can have three states: true, false, or NULL. Representing these three values can be done using checkboxes.
- Displaying Images from a Table
A field in a table may contain an image or the file location of an image (an image reference field). This example shows how to display these two types of images.
- How to Dynamically Show "Add Records" Link
- How to Export Selected Records to Excel in a Grid Component with a Checkbox Selector
Individual rows in a Grid Component can be exported to an Excel file using the Checkbox Selector Column to filter the Grid Component before performing the export.
- How to Export Records in a Grid Component to Excel or Ascii
- How to Filter a Grid on the Selected Rows in a List Control
Argument arrays, combined with the SQL IN clause, are a powerful way to filter records shown in a Grid component.
- How to Filter Records in a Grid Component Using Information from the Extended User Info Table
Learn how to filter records in a Grid component based on the currently logged in user using the "USERID" field from the Extended User Information table.
- How to Override Grid Component Settings in an .a5w page or OnGridExecute event
Properties of the Grid Component can be overridden at run-time when the Grid is being loaded on an .a5w page or in the Grid Component's onGridExecute server-side event.
- How to Import Data from an Excel or Ascii File into a Grid Component
Data in an Excel file or comma delimited Ascii file can be imported into a Grid Component based on a table in a database.
- How to Put Up a Wait Dialog While The Grid is Performing an Ajax Callback
If you Grid does a callback that takes some time (e.g. searching a large database), you might want to put up a custom 'working...' message.
- How to Set Default Component Property Values for a Grid
The default values for new Grid components can be configured. This is particularly useful if you are developing many Grid components that need to suppport multiple languages or are always making the same set of changes to every new Grid Component.
- How to Use Custom Controls in a Grid Component
This topic discusses an advanced use of a Custom Control in a Grid component.
- How to Create Right to Left Button Lists for Radio Button or Checkbox Controls
Learn how to configure Checkboxes or Radio Button controls rendered as button lists to render as right to left using a little CSS.
- How to Format Numbers Using Currency Symbols
You can format numbers in the Grid (both server side and client side formatting) using the currency symbol from every country in the world. The format expression uses the new formatCurrency() function. You can specify if the currency symbol should lead or trail the number.
- How to set Multiple Properties at Once Using Xbasic
Xbasic can be used to set one or more properties for multiple controls in a Grid or UX component. This is useful in certain situations, such as adding language tags to a large number of controls.
- How to Use Language Tags to Localize a Component
Language tags allow you to create 'replaceable' text based on the current active language for an Alpha Anywhere application.
- How to add Google Address Autocomplete to a Textbox Control
Adding address autocomplete to a textbox control can make it easier to lookup and enter addresses in applications.
- How to Animate Markers on a Map
Map markers can be animated when they are placed. Existing markers can also be animated to draw the user's attention.
- How to Display a Google Map in a List Row
You can add a Google Map to each row in a List control to display a locations stored in the current row as a map marker.
- How to Update the Location of a Marker When it is Moved
The latitude and longitude value in the current Grid row can be updated when the user drags the marker to a new position on the map.
- How to Build a Mobile Application with Persistent Login
Persistent login can be added to mobile applications, allowing users to log in to an application once and not requiring the user log in again, even if the application is closed.
- How to Capture Media Files in an Offline Mobile Application
Learn how to build an offline-capable PhoneGap application that can be used to capture images and audio in a disconnected environment.
- How to Display .pdf, .xlsx, .docx Files in a PhoneGap App
Build-in handlers for displaying .pdf, .xlsx, .docx and other file types are usually not available on mobile devices. If your mobile app is built using PhoneGap, you can use the Document Handler PhoneGap plugin to display these file types.
- How To Download Files to a Mobile Device
This topic discusses two different techniques for downloading files (such as PDF, Video, Audio, Excel, Image files) to a mobile device so that the files are stored in the filesytem on the device and can be viewer later on (presumably when the device no longer has an internet connection) using the Native app associated with the particular file type.
- How to Store Large Amounts of Data on a Mobile Device for Offline Use
Large amounts of data can be stored on a device's file system.
- How to Create a PhoneGap Shell Application
Creating a PhoneGap Shell application allows you to test changes quickly without needing to run the PhoneGap build service every time a change is made.
- How to Use SQLite to Store Database Records in Offline Applications
SQLite can be used in PhoneGap applications to store a large number of records, including images, on mobile devices.
- How to use the Next and Previous Buttons to Navigate the Controls in the Active Panel in an iOS Application
The native iOS keyboard has a next and previous button that can be used to navigate input controls on the screen. These buttons can be used with Alpha Anywhere application to navigate controls in the active Panel, however a little work is required to make sure the next or previous buttons do not try to navigate to a control that is on a panel that is not visible.
- How to use the File System for Photos in a PhoneGap Application
Media files (images, videos, and audio files) can be stored on a device's file system rather than Local Storage in PhoneGap applications, letting you provide access to media files when the application goes offline.
- How to Create a 'Conditional Object' in a Layout Table Report
When creating Free-form reports, the Conditional Object control is used to dynamically display content. When designing Layout Table reports, the same functionality can be created with Static HTML.
- How to Convert a Freeform Report to a Layout Table Report
A Freeform Report can be converted to a Layout Table Report.
- How to Display a QR Code in a Report
You can generate and display QR codes in reports using a variety of methods.
- How to Export a Report to Excel, Word, Ascii, or Custom Format
- How to Export a Layout Table Report with Live Forumlas to Excel
When exporting a Layout Table Report to Excel, calculated fields can be configured to export as Excel Formulas, instead of static data.
- How to Override the Field Definition to Display Images in a Report
Fields containing Ink or PNG data can be rendered as images in a Report. This is done by overriding the field definition.
- How to Place Borders Around Report Sections
The box object can be used in Layout Table reports to draw boxes and lines on the report, creating visual separation of data.
- How To Print a Report Containing the Currently Selected Records
- How to Suppress Blank Lines in Layout Table Reports
Learn how blank lines in static HTML elements and empty rows in a Layout Table report can be omitted when the report is generated.
- How to Apply Security Settings Client-Side
Security settings can be applied client-side to dynamically display controls in an application, such as in PhoneGap applications.
- How to Register New Users in a Web Application
An interface for adding new users to the security system in web applications can be created using the UX Component.
- How to Edit User Records in a Web Application
An interface for editing existing users in the Web Security Framework can be created using the UX Component.
- How to Test Page and Component Security
If your application has web security enabled, you can verify that security settings are properly configured by publishing your application locally and logging in using user accounts configured with different permissions.
- How to Annotate Data Bound Images
Images in a Data Bound UX Component can be annotated using the Ink control.
- How to Programmatically Set the Min and Max Value for a Slider Control
The minimum and maximum value for a two-value Slider Control can be set programmatically at run-time.
- How to Store Data in Local Storage Using Client-side Data Cache
Learn how to use the Client-side Data Cache to download and store data in Local Storage in PhoneGap applications.
- How to Create Your Own UX Component Template
You can create your own templates for the UX Component.
- How to Create Add-in Controls
Custom controls can be created and added to the Alpha Anywhere environment or the UX Component.
- How to Customize the Ink Overlay
The Ink control's "overlay" is used to display the tools in the Ink editor. You can add your own tools to this overlay for editing Ink.
- How to Define a Hyperlink in a Client-side Template
Client-side template syntax is used in Lists, FormView, and ViewBox controls to define the control's layout. If you want to include hyperlink in the template definition, you must stop the hyperlink HTML element's click event from bubbling up to the top-level control.
- How to Display a Wait Message While a Large App is Loading
Large apps can take a long time to load the first time the user opens the app. This can give the appearance to your users that the app has hung or is non-responsive. You can resolve this issue by displaying a loading message to the user.
- How to Populate a Dropdown Box Using the Client-side Data Cache in PhoneGap Applications
Dropdown boxes can be populated with data from the Client-side data cache at run-time.
- How to Find Controls in a Large UX Component
The Quick Find Genie is useful for finding controls in components with a large number of controls.
- How to Eliminate Vertical Space when Controls are Hidden in a UX Component
When a show/hide client-side expression hides a container in a UX Component, some vertical whitespace may still appear on the page. It can be eliminated by using the "Prevent container float" property.
- Manually Inserting UX Component Data into a DBF Using Xbasic
In this example we will save some UX Component contents to a DBF database record. First we will need to create a DBF table to store the data. Create a new DBF table in the control panel and add the following fields:
- Manually Inserting UX Component Data into a SQL Database Using Xbasic
Xbasic can be used to manually submit data collected using the UX Component to a SQL database. This example demonstrates how this can be done.
- How to set the Background of an Ink Control
You can set the background image shown in the ink control to anything you want - either by specifying the URL or the base64 encoded data for an image.
- How to Capture and Restore the List's Scroll Position
Refreshing data in a list can sometimes cause it also reset it's scroll position. You can restore the List's scroll position by capturing the position before refreshing or performing some operation on the List and restore the scroll position after the operation completes with a few lines of code.
- How to Consume Complex JSON Data in a List
Learn how to work with complex hierarchical JSON data in a List control.
- How to Convert a List Control Between a Static and SQL Data Source
Learn how a List Control based on static data can be quickly converted to use a SQL database.
- How to Dynamically Populate List Columns and Data
A List control can be dynamically repopulated with data from different tables.
- How to Export Data in a List Control to Excel or Ascii Format
- How to Handle Write Conflicts in a List Control Programmatically
When synchronizing a List control with a Detail View, write conflicts can be resolved programmatically instead of letting the user decide what should happen.
- How to Refresh List Data with "Pull-to-Refresh"
Pulling a page down past the top of the page is a common method for triggering a refresh of a web page or application. This action can be added to mobile applications to refresh data in a List Control.
- How to add Search Highlighting to the List Control
Search Highlighting can be added to the List Control, making it easier for users to see the fields that matched the search criteria.
- How to Search for multiple Logical values in a List Control
Adding checkboxes to search logical fields in a List control's Search Part may not behave as you expect. A better method is to use dropdownboxes.
- How to Use the FormView Control to Edit Large Records
If a List's Detail View has large number of fields, using individual controls to edit the data can cause a significant performance hit. Using the FormView control offers a faster alternative, capable of scaling to hundreds of fields with minimal impact on load times.
- How to Change the Background Image for a Panel Card at Run-time
The background image for a Panel Card can be changed dynamically at run-time.
- How to Add Custom Swipe Events to Panels
Adding swipe gestures to mobile applications can create a better user interface experience for users.
- How to Dynamically Add Panels to a Panel Navigator
Panels (Panel Cards, Panel Layouts, and child Panel Navigators) can be dynamically added to a Panel Navigator at run-time.
- How to Render a UX Control with Panels in a div
When a UX component that has Panels is rendered, it consumes the entire window. In certain cases you might want to constrain the UX component to a particular element.
- How to Prevent Panel Navigation when Controls are Dirty
In an application with multiple panel cards, navigation to other panel cards can be prevented if the controls on a panel have not been saved.
- How to Save and Restore Panel State in a UX Component
The active Panel can be saved and later restored in UX Components.
- How to Add Server-side Event Handlers to the Web2Cal Calendar to Respond to Event Changes
Event handlers can be added to the Web2Cal Calendar when an event is added, edited, moved, or deleted.
- Changing the Locations of the Parts of a Grid Component in an A5W Page
When you create a grid component with search and detail view parts and then place the grid onto an A5W page, you will see something like the following.
- How to Create and Read Cookies
Cookies can be created and read using the Context object.
- How to Create 'node' Folders in a Web Application
In order to call node services from your web application in server-side Xbasic, you must publish node services in a specific folder in your web project.
- How to optimize an A5W page for SEO
- How to Perform an Ajax Callback on an A5W Page
This document describes how you can do an Ajax callback from a hand-coded .a5w page in Alpha Anywhere.
- How to Install a Node Module and Call it from a Node Service in a Web Application
Node modules can be downloaded and used in Alpha Anywhere web applications.
- How to List All Cookies for a Web Application
Listing cookies in a web application can be done using the Context.Request.Cookies object.
- How to Make RESTful API Calls
Xbasic offers quite a number of functions and methods for using the HTTP protocol to make various requests from web servers. Sending a RESTful request to a web service is becoming increasingly popular, but is not always as straightforward a s requesting a simple resource from a web server.
- How to Send a POST Request with a Specific Content-type Header Using HTTP_FETCH()
The content type cannot be set when using HTTP_POST() to POST data to a server. If the server expects a different Content-type header, HTTP_FETCH() can be used instead.
- How to Omit HTML for Parts of a Component Embedded in an .a5w page
Individual portions of a component are emitted separately when embedded in an A5W page. You can omit portions of the component -- such as the Page Title for a UX Component or the Detail View for a Grid Component.
- How to Return Binary Data from a Node Service
A node service can return binary data to an Xbasic script using optional attachments sent using the sendResponse() callback function.
- How to Return Status Codes from Ajax Callbacks
You can manually set the status code in an Ajax response.
- How to Preserve State Information
Web applications are inherently stateless. In practical application, however, you need to preserve state.
- How to write a socket server in Xbasic
Below is a very basic server that you could expand to use multiple sockets and threads as required. It should give you a good starting point on how to use sockets in Xbasic. It does not implement any specific protocol on top of the sockets: that is left to you.
- How to Add a Class and Reference it in a Control
CSS classes can be used to add additional styling to an control in Alpha Anywhere.
- How to Add Local and Global Shared Styles
Shared styles are an easy way to create a cohesive look and feel across multiple applications.
- How to Set the Height of a Container to the Screen Height
Learn how to set the height of a container to the full height of the screen.
- How to add Animation Effects to Client-side Show/Hide Expressions
Client-side show/hide expressions can be defined to dynamically display controls in a component. An animation effect can be applied when the control's display changes.
- How to Close the Popup Window Displaying a Component Embedded in an a5w Page
- How to Configure an Amazon S3 Bucket
Amazon S3 Buckets can be used to store files, such as images or documents. S3 Buckets can also be used with AlphaLaunch to host application installation files.
- How To Configure Source Control to Ignore Alpha Anywhere Files
Some files and directories in an Alpha Anywhere workspace can be excluded from source control.
- How to Copy Code Libraries from Older Versions of Alpha Anywhere
Code Libraries from older versions of Alpha Anywhere can be copied into the current version of Alpha Anywhere. This is done by copying the Code Libraries from the older version of Alpha Anywhere to the directory where Code Libraries are stored in the current version of Alpha Anywhere.
- How to download a Sample App from the Alpha Anywhere GitHub Repository
Several sample applications are available from the Alpha Anywhere GitHub repository. This article explains how to find and download a sample application and open it in Alpha Anywhere.
- How to Extract the Value from a URI Query String
- How to Dynamically Set the Client-side Mask
- How to Execute Scripts on a Repeating Schedule
Scripts can be executed on a reoccurring schedule in desktop applications.
- How to implement comma_to_crlf honoring delimiters
The comma_to_crlf function does not take into account quoted delimiters.
- How to Programmatically Enable and Disable Buttons
Buttons in a UX component can be enabled and disbled using the button object's setDisabled() method.
- How to make a Checkbox Readonly
Learn how client-side enable expressions can be used to disable a checkbox, making it readonly.
- How to Dynamically Recalculate a Page Layout, Tabbed UI or UX Component at Run-time
If overrides have been defined for a Page Layout, Tabbed UI, or UX Component using the 'override_settings' property on the page the component is embedded, the component needs to recalculate the affected controls.
- How to Reference Component Definition Properties in Xbasic
- How to run a Component or Report in a User Defined Ajax Callback or <%a5..%> Code Block
Components and reports can be dynamically run using Xbasic in an Ajax Callback.
- How to Simulate the 'click' Event for a Control
Event handlers can be added for control events -- click, double tap, on key press, etc. In some cases, it may be necessary to trigger a control's event, such as the click event. This can be done by getting a pointer to the control and calling a function to simulate the click.
- How to add Keyboard Shortcuts to a Tabbed UI Interface
The Tabbed UI component is a great way to navigate an application. You can assign keyboard shortcuts to buttons in a Tabbed UI that launch components.
- How to Build an IIS Deployment Package
If there is completely no access to the IIS server, Alpha Anywhere does not currently support creating a package that can be independently deployed on the IIS server. However, by using the following steps, a deployment package can be created outside of Alpha Anywhere.
- How to Install Multiple Versions of the Alpha Anywhere Application Server for IIS
Multiple version of the Application Server for IIS can be installed on one system for a single license. This allows you to test new releases or deploy multiple applications running on different versions of Alpha Anywhere.
- How to Use IIS Behind a Load Balancer
If the Alpha Anywhere Application Server for IIS will be used on multiple machines, Microsoft's Web Farm Framework or a Load Balancer will be required to distribute requests across the machines.
- How to Determine the current Alpha Anywhere server version
In an A5W page, insert this code to display the version:
- How to Locate the Application Server configuration file being used by the current instance of Alpha
Alpha Anywhere and the Application Server each store server settings in a configuration file on the computer's hard drive. The location of the file being used by an instance of Alpha Anywhere or the Application Server can be determined using the function a5_GetAppServerConfigFile(). For example:
- How to Publish Multiple Web Projects Using Subfolders
If multiple projects are published to the same Application Server (such as often done in development) they have to be published to discrete folders under webroot to segregate the projects. This is done by giving each project a unique target folder in the publish profile.
- How to Specify an Alternate Configuration File for the Alpha Anywhere Standard Application Server
The Application Server allows for an alternate configuration file to be specified. This is done through the use of a command line option, CONFIGFILE. For example, to launch the Application Server using a configuration file named TestConfig.xml in the root of the server's C drive:
- How to Determine the Version for the Alpha Anywhere Development Environment
Version information for Alpha Anywhere can be found under the Help menu in the About Alpha Anywhere dialog.
- How to Install Multiple Versions of the Alpha Anywhere IDE
Multiple versions of the Alpha Anywhere Development Environment can be installed on a single machine.
- How to Remote Test an A5W/HTML Page on a Mobile Device
A5W or HTML pages can be tested on Mobile Devices using Remote Test in the A5W/HTML Page Editor.
- How to Test Your Application Using a New Version of Alpha Anywhere
Multiple versions of the Alpha Anywhere Application Server can be installed and run on a server. This is useful if you need to test your application on a new release before deploying it.