Release Notes for Alpha Five V11 Update

Click here to see all fixes made to Version 11 since last Version 10 release.

 

 

 

 


 

VERY IMPORTANT: Before using this upgrade you must publish as least one page or component to your server (does not matter which one). This will cause a new version of the __a5RunGrid.a5w and __a5RunReport.a5w system pages to get published. If you do not publish at least one file, your app will still be using an old version of these system file and it will fail. (You do not need to republish your entire application).

 

NOTE: Windows Server 2012 - Alpha Five Application Server - When installing the Alpha Five Application Server on a Windows Server 2012 machine you will need to download and install the Microsoft 2.0 CLR (Common Language Runtime) on the machine. This is because Windows Server 2012 no longer installs the 2.0 CLR. The 2.0 CLR is used by Alpha Five for all SQL Geography functionality.
 

 

Build 3381- 4096 - Released -  22 Mar-2013

 

 

Bugs

Grid Component - Edit-Combo - Detail View - Not Making Grid Dirty After Selection - In the Detail View, if an edit-combo had been configured with the 'User must make selection from list' option turned on, after the user made a selection from the edit-combo, the Grid did not go dirty, as it should have. This bug was introduced in a recent update, and only impacted the Detail View.

Lookups - Grid Component - Dynamic Filtering - Under some circumstances, the first time you opened a lookup Grid that had a dynamic filter, the lookup would report that no records were found.

Dialog Component - Tab Control - Genie Style - Repeating Sections - In a 'genie' style tab object, if one of the panes had a Repeating Section on it, the counter showing 'Page x of y' would not get updated.

Application Server - Orphan Files in the Temp Folder - Under some circumstances orphan files were being left in the Windows temp folder. These files matched this pattern:

A5H*.tmp

Now, the server automatically cleans up orphan temp files (if there are any) every 15 seconds.

Features

Edit-Combo Control - Grid and Dialog Component - Progressive Filtering - Progressive filtering of the choices in an edit-combo was not supported if the edit-combo had been configured as follows:

This is now supported. To turn on this feature, you will need to edit and re-save the edit-combo.

 

 

Chrome Browsers - Selecting Static Text - Global Setting in Web Project Properties - In Build 3341 we started automatically adding CSS to the generated CSS for all Grids and Dialogs to prevent static text from being selectable. This was done because it is desirable for mobile applications.

As a result of this change, static text, on a web page, when running in Chrome is not selectable. We described how you could add the following CSS to the local CSS definition for each component.

html {  -webkit-user-select: auto; }

 

Some developers have a large number of components, and editing each component individually to add in the CSS override is tedious. Therefore, a new property is available in Project Properties (accessible from the 'Project Properties' button on the Web Control Panel), that allows you to globally set a property. See the 'Webkit (Chrome/Safari) Specific' property.


 

 

 

Build 3375- 4095 - Released -  20 Mar-2013

 

Bugs

Grid and Dialog Components - Client-side Expression Editor - When editing an expression and then exiting the dialog, the debugger would pop up because a debug statement was accidentally left in some code.

Dialog Component - Charting - X Axis Labels - Improvements in how X Axis labels are shown then the chart is based on a single data series with the 'split' option turned on (to divide the series into multiple 'logical' series).

Grid Component - Image Upload - PNG - DBF Tables - Image upload of a .png image to a PNG Field Type in a .dbf table was not working correctly.

 

 

Tips

 

Dialog Component - Slider Control - Two-value - Default Value - Say you have a slider control that you have configured as a two value control (showing say 0 to 100). Let's assume you want to set the initial state of the control to 30..70. You cannot do this by setting the Default Value property of the control. However, you can add some code to the onDialogInitialize server side event to emit Javascript that will set the slider's value.

For example:

 

dim js as c
js = <<%txt%
var s = {dialog.object}.getControl('MYSLIDER')
s.setValue([30,70]);
%txt%
e.javascript = js
 

 

 

 

Build 3369- 4093 - Released -  18 Mar-2013

 

Videos

 

R7 Reports - Duplicating the Functionality of the Free-form Report 'Conditional Object' in a Layout Table Report - Showing Conditional Content in a Cell

 

Bugs - Grid and Dialog - Edit-Combo - Progressive Search - Fixed a bug that was introduced in previous update.

 

 

Build 3363- 4092 - Released -  16 Mar-2013

 

Bugs

Dialog Component - Lookup Grid - If a Dialog Component had a Lookup Grid and the Lookup Grid had a Search Part and was configured to not show the Grid Part if there was no active search, when a search was performed, the Grid was shown, but it did not have links to select the current record. This bug was introduced in a recent update, but is now fixed.

Grid Component - Static Text Objects - Javascript Events - Javascript events were not being generated for static text objects in the Grid.

 

Grid Components - SQL Tables - DISTINCT - If the SQL Select statement for a Grid included the DISTINCT keyword, the records show in the Grid were correct, but the count of the records shown in the Grid was not correct. This bug was introduced in a recent patch, but is now fixed.

 

Features

Dialog Component - onStateChange Client-side Event - Now includes an additional parameter to indicate if any data bound control is dirty or not.

Dialog Component - onDataStateChange Client-side Event - This new event fires when any data-bound control changes state from clean to dirty or vice versa.

 

 

 

Build 3357- 4090 - Released -  14 Mar-2013

 

Bugs

 

Web Application Server - '500 errors' - Addressed the issue discussed in previous update.

Grid and Dialog Component - Javascript Errors - A change made in the Alpha Five Javascript library in build 3353 to the 'array' object prototype cause Javascript errors in several methods (such as Maps in Grid components, etc.). This is now fixed.

 

Build 3353- 4090 - Released -  13 Mar-2013
 

Bugs

Page Layout Component - Placing a Page Layout part on a Page Layout component would cause an error if the Component did not contain a Tab Object.

Dialog Component - Placing an Embedded Object on the Dialog would cause an error if the Dialog did not contain a Tab Object.

Web Application Server - '500 errors' - Certain users have reported that they are receiving '500 errors' on certain pages after restarting the server. We have determined that this occurs ONLY under the following condition:

NOTE: 'Session' is the recommended policy for login expiration. If you use the recommended policy, you will not receive the '500' error.

This issue will be addressed in the next update.

 

 

Features

 

Grid - Alphabet Search - Can now set the alignment of the search bar to left, center or right. Previously it was automatically left aligned.

 

Dialog Component - Data Bound - SQL Tables - Multi-Column Primary Key - Update operations are now supported on tables that have multi-column primary keys where one or more of the columns in the primary key contains a blank value.

 

Web Applications - Optimized Publishing - If you use Optimized Publishing to publish a project to a remote server and you were publishing to a sub-folder of the webroot, it would fail unless you had previously published your project to this folder using the non-optimized method.

 

Tips

Event Bubbling - Row Expanders - Expand Row on Row Click - Assume that you have set a Grid with a Row Expander to expand the Row Expander when the user clicks on the row. Assume also that you have a button in the Grid row that performs some action. When the user clicks on the button, the action is performed, but the row is also expanded. This is probably not what you want. The reason that this happens is that the click on the button bubbles up to the button's container (the row) and the click event on the row is then executed.

To solve this problem you need to tell the button to stop bubbling events up when it is clicked. Here is how you can do this:

If the button was defined using Action Javascript, add a new 'Inline Javascript' action as the last action, with this code in it:

if(event.stopPropagation){event.stopPropagation();}event.cancelBubble=true;
 

If the button action is your own Javascript code, then just add the above line at the end of your code.


 

 


 

Build 3341- 4088 - Released -  9 Mar-2013
 

Videos

M59 - Grid - Marking Records as 'Deleted' without Physically Deleting Them - Shows how records can be 'marked' as deleted rather than physically deleted.

R5 - Reports - More About Boxes - When you put a box around a section, if the box touches a box in another section, it is automatically joined with the adjacent box. In some cases, this is desirable, and in others it will not give the desired effect. 

R6 - Reports - Suppressing Blank Lines in a Static HTML Control - When using a Layout Table report, the technique used to display blocks of text, such as an address block, is to put the fields in a static HTML field. In this video we show how blank lines in the 'address block' can be suppressed.

M60 - Three state logical checkbox - Video shows how you can put a logical checkbox control into an 'indeterminate' state if the data in the field is NULL.

 



 

Features

Web Applications - Security Framework - Using SQL Tables - If you are using SQL tables for your user and group name tables in the Security Framework, improvements have been made that will result in login code executing faster.

 

 

Excel Export - Now supports 'Excel' and 'Excel-XLSX' as the export type. 'Excel' option uses the old .xls file format. 'Excel-XLSX' uses the newer .xlsx file format.

 

Grid Component - Excel - Trailing Spaces - Trailing spaces are now trimmed from fields when exporting data to Excel.

 

Reports - SQL Data Source - Set SQL Statement at Runtime - You can now override the SQL statement used for a report at run-time. For example:

 

dim options as p

options.filter = "country = :whatcountry"

options.sqlstatement = "select firstname, lastname, country from customers"

 

dim args as sql::arguments

args.add("whatcountry","usa")

dim filename as c

filename = "c:\myreports\report1.pdf"

 

report.saveAs("myreport","pdf","","",filename,null_value(),args,options)

 

IMPORTANT: The SQL statement must return the same fields with the same data types as the original SQL select statement.

 

UI_Get_Text2() Function - This is an enhanced version of the UI_Get_Text() function. Instead of returning a character value, it returns a pointer with two properties:

The benefit of this function over UI_Get_Text() is that you can test explicitly if the user hit OK or Cancel.

 


p = ui_get_text2("test","","alpha")

'user clicked cancel

?p
= lastbutton = "cancel"
value = "alpha"

'user clicked ok

?p
= lastbutton = "ok"
value = "beta"
 

 

Grid Component - File/Image Upload - Upload Folder - UNC Path - UNC paths can now be specified for the file or image upload folder.

 

Web Applications - Downloading Files - Temp Folder - Web Project Properties - The Web Project Properties dialog allows you to specify a list of folders from which files can be downloaded. Because support for session folders will be dropped in V12, we have started changing internal code in Alpha Five (such as the Export Chart feature in the Dialog component) to use the Windows temp folder for temporary files that are generated for download, rather than the session folder. As a result of this change, attempting to export a Chart would fail if you had specified a list of allowed download folders in your Project Properties. This was because the list of authorized folders did not include the Windows temp folder. Now, files in the Windows temp folder are authorized for download.

 

Dialog Component - Data Bound Dialog - List Control Showing Primary Key Values - Set Current Row in List Control to Specified Key - If you have used the sever-side action to load the Dialog component primary keys and you have turned on the option to show the primary keys in a List control, you can now use a new method to set focus to a particular key in the List control. This will, in turn, populate the dialog with data for the specified key.

For example:

{dialog.object}._primaryKeyListSetKey(123)

If the key value is multi-valued (e.g. the primary key is Lastname and Firstname), specify a ||| delimited value. For example:

{dialog.object}._primaryKeyListSetKey('Smith|||John')

 

 

Dialog Component - Action Scripting Change Web Security Password - Action Scripting has been added to the Dialog Component to configure a Dialog to change a user’s password. The Dialog requires controls for user name, current password, and new password. It can also use a confirm password control for double entry of a new password. The action “Change Web Security Password” can be selected in the 'dialogValidate' or 'afterDialogValidate' event and includes a genie to map the Dialog controls to the expected security values. Messages to display after submit can be customized and can use language tags.
 

Fedex_delivery_status() Function - Has been updated to work with the redesigned Fedex website.

 

Opening Workspaces - Workspaces that have a large number of scripts and functions (especially if a file system dictionary is used for the Workspace) will now open significantly faster than the last official patch. (For more information on file system dictionaries, right click on white space in the Control Panel when the Code tab has focus.)

Application Server - Session Variables - Query String -  Executing a page with a query string that attempts to set a session variable will now throw an error. Setting session variables in the query string has been illegal since V11 shipped. Now, if you try to do this, Alpha Five will generate an error. Previously, the value for the session variable set in the query string would have been used for the duration of that page. The permanent value of the session variable was, however, not changed.

Ascii Import - Quotes as Field Delimiters - An enhancement to  import was made so that the quote delimiter character can be used inside the data to be imported. For example, the following data will can be imported:

"My Software, Inc",30 B Street,Boston,MA,This string has a  " in the name,27

 

Notice that in the above string, some of the fields are quote delimited (e.g. 'My Software, Inc'), whereas another of the fields simply includes the quote character (not as a delimiter) (e.g.  This string has a  " in the name)

 

 

Grid Components - Images - <Image> Display Format - When the <Image> display format is selected for a character field (whose control type has been set to Image), the 'Image Path' property is now enabled.

Previously this property was only shown if the display format had been set to <Image File Reference>.

This means that if the field contains a relative filename, (e.g. myImage.jpg), you can now specify a folder in the 'Image Path' property (e.g. 'myImagesFolder') where the the images are physically stored. You can specify an absolute or relative (to the webroot) folder name.

 

Tabbed UI Component - Auto  Launch - Auto Launch Delay - When an object in a Tabbed UI is set to auto-launch, you might want to introduce a small delay before the Javascript that launches the tab actually fires so as to give other Javascript that might be running time to complete. A new property allows you to specify a delay (in milliseconds). By default, the delay is 0ms.

Dialog Component - Tab Control - Embedded Objects - When an embedded object (e.g. Grid component, Dialog component, etc), is placed on the initially displayed Tab Pane of the tab object, you might want to introduce a small delay in the Javascript that loads the embedded objects to allow other Javascript to complete. For example, the other Javascript that you want to complete might be setting values in controls on the Dialog that the embedded object is filtered on.

A new property for initially displayed Pane of the Tab Control allows you to specify a delay (in milliseconds) before the embedded objects on Pane 1 are loaded.

In the case of an Accordion object, these comments apply to all Panes that are designated as initially displayed.

 

CSS Editor - Media Queries - Media queries in the CSS are now supported in the CSS editor. For example:

 

dim ssdef as c = <<%css%
.snakingItem {
width: 23%;
float: left;
height: 1in;

}

@media (max-width: 600px){
.snakingItem { width: 32%;}
}

@media (max-width: 400px){
.snakingItem { width: 48%;}
}
%css%
 

 

Dialog Component - Server-side Actions - Save Record - When you use this action and choose 'Enter new record' as the follow on action after the record is saved, the new record is done as part of the original ajax callback. Previously the save record action triggered a second ajax callback to display the new record. Doing the work to display the new record as part of the original ajax callback is obviously more efficient than triggering a second callback.

Xbasic - Improved Error Message - The following invalid Xbasic expression now returns a more meaningful error message:

?{111/111/111}


Now returns 'bad data/time/GUID constant'. Previously, the error was a somewhat less helpful 'token corrupt' message.

 

 

File.zip_from_string() Method - Creates a zip file from data contained in memory.

Syntax

L flag = file.zip_from_string(c zipfileName, c datafileName, c Data)

 

Where

 

file .t., or .f. depending on whether the method was successful
zipFileName Name of the zip file to create
dataFileName Name of the file inside the zip file. This is the file that contains the data that was zipped
Data The data to be zipped up.

 

Example

?dim data as c

data = <<%txt%

Here is some data that I want to save to a zip file

%txt

dim zipfilename as c = "c:\data\testZipFile.zip"

dim datafilename as c = "test.txt"

?file.zip_from_string(zipfilename,datafilename,data)

.t.

 

 

Report Server - Now supports Letters and Label style reports.

Bugs

 

AlphaDAO - SQL Server 2005 - Export from .dbf Tables - Fixed a bug that prevented export from .dbf to SQL Server 2005 if the connection string specified the 2005 SQL Server Native Client. Note that if the connection string specified the Version 2000 Native Client, the export did work.

 

Grid - Export to Excel - Use Column Headings for Excel Column Names - Language Tags in Column Headings - If the replacement strings in the language definition had spaces or certain other types of characters, the data from that column was not exported.

 

Web Applications - Calendar Component - Multi-day Events - Multi-day events were not displayed correctly in the Day view.

 

Workspace Files - Hidden Folders -  If the folder in which the Workspace files are located has been hidden, Alpha Five displayed an error. This is now fixed.

Browse - Data Entry - Focus Row - When doing data entry into a Browse Layout, the row you were editing moved to the top of the browse when the data was saved. The row now stays in its original location.

 

 

 

Application Server - Max Open DBF Tables - The maximum number of open dbf tables has been increased from 1,000 to 8,000. This is significant because even if your application is built using SQL databases (as most applications are), reporting creates temporary .dbf tables and the security framework user and groups tables are (by default) .dbf tables. The security tables can, of course, be converted to SQL tables. Click here for more information.

 

Web Security Framework - User Names - Accented Characters - Accented characters are now supported in user names. (Applies only if the security tables are in SQL tables).

 

 

Grid Component - Link Control Type - Javascript Action - Tabbed UI - If the 'Link' control type was selected for a field in a Grid, and if the Link action was set to Javascript, the generated HTML for the control would (correctly) have

href="#"

However, after a {grid.object}.refreshRow() method had been executed, the href attribute would be changed to a null value. As a result of this, if the Javascript that the user defined for the control did not include an explicit

return false;

command, then when the user clicked the hyperlink, after the row had been refreshed, all of the open tabs in a Tabbed UI would be closed.

Note: You must edit and resave the component to see the fix.

Grid Component - Lookup Grid - Dynamically Filtered - Under some circumstances a Lookup Grid that was dynamically filtered would fail to fill in the correct values from the selected row in the Lookup Grid.

 

Web Security Framework - More fixes relating to recent changes in the Web Security Framework.

Dialog Component - Action Javascript to Get List of Keys - If one of the search fields in the Dialog was a multi-valued field, the search would fail.

Dialog and Grid Component - HTML Editor - Right click menu - If you right click on the HTML editor, a menu (generated by the browser - not Alpha Five) displays various options, including 'Paste'. If you select the paste option, text is pasted from the clipboard. However, this does not cause the HTML editor's onChange event to fire (as pressing Ctrl-V would). As a result, the HTML editor does not see the control as being dirty. There is no work around for this. As a result, the right click menu has been disabled. This means that if you want to paste into the HTML editor, you must use the Ctrl-V shortcut.

 

 

Dialog - Data Entry in Data Bound Dialogs - Consider a dialog that is bound to a database. The dialog has a repeating section, so the data model is parentTable==>childTable (where ===> indicates a one-to-many relationship).

Assume that the dialog has a button to show a new record and that the user has pressed this button. The user then makes an update to a field in the repeating section but does not make any edits to fields in the header section, then commits the dialog. Previously this would generate an error because the record that was being entered into the repeating section had no value for the linking field(s) to the parent.

Now, if the parentTable has an auto-increment primary key, a record will be added automatically to the parent table (even though the user did not touch any parent table fields) and the update will now work.

As a result of this enhancement a bug was introduced in the following scenario. Consider again that same dialog with the same parentTable===>childTable data model. Now assume that the user has committed the dialog after making edits to the parentTable, but no edits to the repeating section. After the update the dialog is set to show the existing record for editing. The dialog is therefore showing an existing parentTable record and no records in the repeating section. The user then makes an edit to the repeating section, but does not make any edits to the parentTable, and commits the dialog. This would result in an error because the dialog would erroneously conclude that a new parentTable record should be added.

Grid Component - SQL Tables - Custom SQL Query - Primary Keys - If you set an explicit primary key for the primary table in the query that was different than the real primary key, when you closed the SQL Query Builder, the primary key that you set would be overwritten by the real primary key. This no longer occurs.

Javascript Windows - Displaying a Modal Window from a Modeless Window - The modal window would display behind the modal window. This has been fixed. The modal window will now always display on top of the modeless window.

 

Dialog Component - Data Bound - Default Value for Repeating Section Fields -  When populating a data bound Dialog component with data from a record, if there was no data found for the records in a Repeating Section, the Repeating Section shows one record (which would be a new record for the header record), but this new record did not show the default values that had been specified for fields in the Repeating Section.

Forms and Browses - Duplicate - Selecting the 'Duplicate' command from the Control Panel did not duplicate all of the meta data in the Form or Browse. (The alternative technique of editing a Layout and then selecting Save As... has always worked correctly).

 

Grid Component - Row Expander - AfterRowCollapse and CanRowCollapse Events - If the row expander in a Grid had been configured to allow multiple open rows at a time, when a row was collapsed, the AfterRowCollapse and CanRowCollapse client-side events would fire on all rows in the Grid - not just the rows that the user had previously opened.

 

Xbasic Classes - Inheriting From a Parent Class - A bug was fixed when an Xbasic class that inherited from a parent class called a method of the parent class.

For example, in the somewhat contrived example below we can see two class definitions. The second class inherits from the parentSays class. Both classes are defined in the DEMO namespace. As you can see, the 'sayWhat()' method of the child class calls the 'momTalk()' method of its parent class.

 

 

define class DEMO::parentSays
    dim phrase as c = "Listen to your parents."
    function momTalk as c()
        ui_msg_box("","momTalk:" + phrase)
    end function
end class


define class DEMO::childSays INHERITS DEMO::parentSays
    dim kidSpeak as c = "My mom always says:"
    function sayWhat as c()
        'call the parent class method
        momTalk()
    end function
end class
 

 

 

Watch video

Xbasic - Classes - Multiple fixes for Xbasic classes, including ability to save classes in their own namespace and fixes that allow the class constructor to be edited after the class has initially been defined.

Forms - Alphabet Button Supercontrol - Fixes an issue when using different themes.

Forms - Custom Menus - Fixes an issue when custom menus used oversize icons in the menu.

 

Grid Component - Tree Control Navigator - Fixes an issue when the tree was based on a sql table that has spaces in either the table name or field name.

 

Grid Component - Row Expander - Dialog Component - When a Dialog component was opened in a Grid's Row Expander, the Ajax Callback URL property for the Dialog was not set properly. As a result, any Ajax callback made from the Dialog would fail.

Grid Component - Linked Content Sections - If a Grid shown in a Linked Content Section also had Linked Content (in other words you are displaying a parent-child-grandchild relationship), in some cases the record with focus in the grandchild grid did not update when the parent record with focus changed. The situation was limited to the case where the grandchild Linked Content was actually two or more Grids shown in a tab control.   

 

Reports - Save to PDF - Comma in PDF Filename - Previously, if the filename you specified for the PDF file contained a comma in the filename, an invalid PDF file was created.

 

Dialog Component - Cascading Dropdowns - If you have cascading dropdowns in a data bound Dialog and you have defined a server-side action to save the submitted data to a table (and selected the option to enter a new record after the data has been saved), then after the data is submitted, and the new record is shown, the cascading dropdowns should have been disabled, (waiting until a selection was made in the parent).  They were previously shown as enabled. This is now fixed.

 

Desktop Applications - Forms - Sets with Grandchild Links - Fixed a problem entering data into a form where data in a grand child record was not cleared when a new record was started. (This was only a cosmetic error.)

 

Reports - Layout Table Reports  - Memos - Plain text memo fields were not automatically growing to show all of the contents in the field.

Reports - Layout Table Reports - HTML Memos - HTML Memos now inherit the default font from their containing cell.

Reports - Layout Table Reports - Cell Padding   - All memo fields now honor the cell padding settings.

Reports - Layout Table Report Editor - Expression Editor - Edit button for the pop-up expression editor did not fill in the expression when the expression editor was dismissed.

 

Tips

Grid Component - How to Make a Long Label Field into a Scrollable Field - When you display a field that has a lot of text (for example a Memo or HTML Memo field) on a Grid in a Label control, you might want to display the field in a fixed size, scrollable 'window'. (Rather than having the label expand to display all of the data in the field at once). This is easily accomplished by setting the Label's 'In-line style' property to:


width: 3in; height: 3in; overflow:auto; display:block;

 

Of course, you can set whatever size you want for the window. In the above example, we have set the window size to 3inches by 3 inches.

Web Applications - Selecting Static Text - Chrome Browsers - As a result of a change made in the CSS that is automatically generated for Grid and Dialog components, static text on a page is no longer selectable in Chrome. This change was made to so that mobile applications behave more naturally. If you want to turn on the ability to select static text on the page when running in Chrome, you can edit your components and add this CSS to the local CSS definitions property:

 

html {  -webkit-user-select: auto; }


 

Build 3044- 4041 - Released -  7 Nov-2012

 

Bugs

Report Server - UDFs - AEX Files - UDFs defined in AEX files can now be seen when printing reports in the Report Server.

Grid Component - Search Part - Search Styles - Negative Values - Qbf Mode - The search style (a number) determines the type of search that is performed. For example, a style of 1 indicates exact match, 2 indicates a 'is contained in' search, 3 indicates 'starts with', etc. In a recent update, support was added for negative search styles. For example, -1 searches for all records that do NOT equal the search string. If QBF mode was turned on and the search style was negative, and, for example, you entered 'MA,CA,NY' in the 'state' field, the generated search expression joined clauses with an OR operator, rather than an AND operator.

Now, if say the search style was set to -1 and the user entered 'MA,CA,NY' into the 'state' field, the generated search clause will be:

state <> 'MA' AND state <> 'CA' AND state <> 'NY'

 

Features

Grid Component - Export to Excel - File type of the exported file has been changed from .xls to .xlsx. As a result, the 65K row limit on export is now removed.

Grid Component - Export to Excel - Spaces in Column Headings - If column headings in the Grid are uses as the Excel column names, then spaces in the Grid column names are now preserved.

 

 

Build 3036- 4040 - Released -  3 Nov-2012

 

Features

Grid and Dialog Components - Dropdownbox Controls - Cascading Dropdowns - 'Explicit' Cascading Filter - A new option is available when you define a cascading dropdown. You can specify an explicit filter for the cascading dropdown. For example, say you have a component with two dropdownbox controls: 'country' and 'city'. When you define the choices for the 'city' dropdown you specify that it is a cascading dropdown, and that its parent is 'country'.

By default, Alpha Five will automatically compute the filter for the query that populates the choices in the 'city' dropdowbox.

However, a new option now allows you to specify an explicit filter, rather than letting Alpha Five compute the filter automatically. This gives you much more control over how cascading dropdownboxes are populated.

This new option is useful when the choices for the dropdownbox come from different tables, and where the fields have different names.

For example, in the case where we have two dropdowns: 'country' and 'city', the 'country' dropdown might be populated from a table called 'countryList' where the field that contains the country names is called 'countryNames', whereas the 'city' dropdown might be populated from a table called 'cityNames' where the 'country' field might be called 'country'.

In this case, the explicit cascading filter could be defined as:

country = :c_country

 

The argument :c_country follows a special naming convention. The 'c_' prefix indicates that the argument data type will be character. the 'country' part (that follows the 'c_' prefix) indicates that the argument will be populated with the current value in the dropdownbox that called 'country'.

 

 

Web Applications - Reports - Client-side Data Format - Support has been added for situations where the client-side date format is different than the server-side date format.

For example, consider the following scenario:

The date that is submitted to the server is '31/12/2012', which is not a valid date (because the server regional settings expects dates in the mm/dd/yyyy format) and as a result no records are printed (even though there should have been records in the report).

As a result of the new functionality just added, the server now knows that the date format of the submitted date value is dd/mm/yyyy and it will therefore automatically convert the date to the correct format. The report will therefore print the correct set of records.

To get this new functionality, it will be necessary to edit and resave all buttons that print reports. This will regenerate the Javascript.

NOTE: The functionality (i.e. correcting date values that are submitted to the server) has always been present in Grid and Dialog components. It was not present for reports.

 

Bugs
 

Grid Component - Group Brreaks - Show/Hide Group Contents - Snaking Column Layout - If your Grid uses snaking column layout and has group breaks, the show/hide group contents now works without leaving blank space in the group when the group is hidden

 

Build 3034- 4037 - Released -  2 Nov-2012

 

Features

Report Server - Session Variables - Session variables in reports are now supported in the Report Server. Previously, the Report Server could not see session variables.

 

Web Control Panel - New option to recalculate all Dialog Controls in batch mode. See the Edit, Bulk Operations menu. This is useful if you want to recalculate all controls on the Dialog for a large number of Dialog components. It beats opening up each Dialog component individually and selecting the Menu, Recalculate all controls menu item.

Web Project Properties - Allowed File Types for File Download - RTF  - Added *.rtf to the list of allowed file types that can be downloaded. Previously, *.rtf was not in the default list of allowed file types (user had to manually add it). As a result, users who forgot to add in .rtf files were not able to export charts as word files from a Dialog component.

 

Bugs

Dialog Component - Embedded Components - Nested Tabs - If you had embedded components on nested tabs, the embedded components did not render under certain circumstances.

Dialog Component - Record Navigation List for Primary Keys - Additional Columns to Descript Primary Key - Action Javascript to Load Primary Keys based on a Search Criteria - After the search was performed, the List was repopulated with just the primary key values. The additional descriptive columns were not set. This bug was introduced in build 3019.

 

 

Build 3032- 4036 - Released -  1 Nov-2012

Bugs

Grid and Dialog Component - Action Javascript - Open Grid in Tabbed UI Pane - When you used this action to open a child Grid in a Tabbed UI Pane, the generated Javascript had an error. This was a new bug that was introduced in build 3019 and would only affect users who created a new action using build 3019 or above. If you created a new action using 3019 or above, you must edit and resave the action in order to re-generate the Javascript.

Grid Component - Open Child Grid in a Pop-Up Window - Window Placement Relative to Button - When you clicked the button a second and subsequent time (if your action had turned on Grid caching), the window was not positioned correctly.

 

 

 

Build 3028- 4035 - Released -  31 Oct-2012

 

Bugs

Report Server - If the Report Server was enabled, SQL reports were not working if the connection string contained high order characters.

Calendar Component - Workshift View - Adding Events - If you added an event in 'Workshift' view, the event was shown in the calendar on a separate 'line', instead of on the main. This is now fixed, but it is necessary to regenerate the Dialog component for editing events to get the fix.

If you do not want to regenerate the Dialog, you can still get the fix by adding the line shown in red to this code in the Dialog's 'afterDialogValidate' event.

 

dim po.group as p
po.wsEventType = "workday"
po.group.groupId = convert_type(e.dataSubmitted.groupId,"N")
po.eventName = e.datasubmitted.eventName
po.startTime = time("yyyy-MM-dd 0h:0m:0s",convert_type(e.datasubmitted.startTime,"t"))
po.endTime = time("yyyy-MM-dd 0h:0m:0s",convert_type(e.datasubmitted.endTime,"t"))
po.allDay = convert_type(e.datasubmitted.allDay,"L")
po.eventDesc = e.datasubmitted.eventDesc
dim objTxt as c
objTxt = vartojson(po,.f.,.t.)

 

Features

Report Server - The Report Server can now see session variables.

 

Grid Component - New Server-Side Events - BeforeSearchSave and BeforeSearchLoad - Two new server-side events have been added for users who are using the feature to save search criteria in the Grid component.

When you save a search, a new record is added to the Repository Table. The Repository Table has two fields, UserId and SecurityGroups, that were not being used when a search was saved to the Repository.

Now, the BeforeSearchSave event can be defined. In this event, if you set these properties:

e.userId

e.securityGroups

 

the values that you set for these properties will be used when saving the record to the Repository.

Similarly, if you set these properties in the BeforeSearchLoad event, they will be used in the query that retries the saved searches to show the user.

With these two events it is possible to allow each users in an app so save and load searches that are specific to that user, or to that user's Security Groups.

 

Reports - Wide Reports - If you create a report that is wider than the selected page size, Alpha Five will now present a new dialog that allows you to specify that the page size should be kept as is, or should be recalculated to fit the closest matching supported page size. At print-time, the report can be scaled so that it fits on the selected page size.

 

 

Build 3019- 4033 - Released -  26 Oct-2012

 

New Videos

Report Server - (Subscriber benefit) Speed up printing of reports in a Web Application, and improve overall application responsiveness by offloading the printing of reports to separate 'Report Servers'.  Watch video for a graphic demonstration of the benefits of the Report Server.

 

Dialog Component - D59 - Refresh choices in a Dropdownbox control and dynamically filter the choices in a Dropdownbox control.

 

Dialog Component - D60 - Prompt for a New Choice to add to a Dropdownbox Control and Add the Choice to the Dropdownbox.

 

Grid Component - M54 -  Using a Grid Component in a Desktop Application - Automatically Closing the Host Xdialog Window when Data in the Grid is Saved

Grid Component - M55 - Using a Grid Component in a Desktop Application - Calling Xbasic from Events on the Grid.

Dialog Component - D61 -  Using Action Javascript when Writing Javascript Code

Dialog Component - FP11_DLGCHART13 - Exporting Charts to PDF or RTF Files

Dialog Component - D62 - Understanding Control Width vs. Container Width Layout Mode

Dialog Component - FP11_DLGCHART14 - Splitting a Single Physical Series into Multiple Logical Series to Plot a Dynamic Number of Series on a Chart

Dialog Component - D63 - Setting the Text in a Label or Button Automatically when a Client-side Expression is True - Conditional Text and Events

Dialog Component - D64 - Server-side Action Scripting - Send E-mail - Get E-mail Settings at Run-time

Dialog Component - D65 - Printing Reports - Using the 'BeforePrintJavascript' and 'AfterPrintJavascript' Events To Display a Wait Message (Subscriber Benefit)

Miscellaneous - M57 - Debugging Server-side Xbasic in Web Applications - Live Preview

Dialog Component - D66, Grid Component M58 - Storing State Information in the Grid or Dialog Object
 

Charts - FP11_DLGCHART15 - By default, the label for each bar in a bar chart is the data value for the bar. In this video we show how each bar can have a descriptive label.

Dialog Component - D67 - Using the 'Lookup and Fill In' Action in a Repeating Section

Dialog Component - D68 - Understanding the 'synchronizeDialog' (client-side) and onSynchronize (client-side) events.

 

 

Subscriber Benefits

The following features are only available to users who have a subscription.

 

 

Grid and Dialog Component - Client-side Conditional Text and Event - The client-side conditional style feature  has been extended and now can be used to also dynamically set the text of a (non-data bound) control (e.g. button, hyperlink, static-text object). It can also be used to dynamically call an arbitrary Javascript function.

In addition the client-side conditional style property was previously only available for data bound controls (e.g. textboxes, textareas, etc.). It is now available for non-data bound controls, such as buttons, hyperlinks and static text objects.

See video D63. Watch videos

 

Report Server - The Report server boosts the throughput of Reports in a Web Application by offloading the processing of reports to a separate process running on unused cores of your machine.

NOTE: The Report Server can only be used if your Application Server is running on a multi-core processor.

The Report Server is separately licensed and can be licensed for 4 core, 8 cores, or max cores on your machine.

(Subscribers automatically get the 4 core license).

 

Without the Report Server, when a user requests a report that takes a long time to print, other users of the application must wait until the report has completed.

With the Report Server, other users do not have to wait until the report has completed before their requests are serviced.

Watch the video for a graphic demonstration of the benefits of the Report Server.

The following sample A5W page can be used to report on what the Report Server is doing:

 

<%a5
dim rs as reportserver::ReportServer

if rs.ClientRequestAllowed() then
    ? "Report Server Is Running<br>"+crlf()
    dim reportJobsPending as c = rs.ListQueue("$(i)|||$(r)"+crlf())
    if reportJobsPending <> "" then
        ? "Reports Currently Being Printed"+crlf()
        reportJobsPending = strtran(reportJobsPending,"|||","</td><td>")
        reportJobsPending = *for_each(x,"<tr><td>"+x+"</td></tr>",reportJobsPending)
        ? "<table border=\"1\" cellspacing=\"1\" cellpadding=\"3\" >"+crlf()
        ? "<tr><th>Report Job id</th><th>Report name</th></tr>"+crlf()
        ? reportJobsPending
        ? "</table>"+crlf()
    else
        ? "No Reports are currently being printed by the server<br>"+crlf()
    end if
   

    dim reportServerTable as c = rs.ServersAvailable("$(n)|$(g)|$(c)"+crlf())
    reportServerTable = strtran(reportServerTable,"|","</td><td>")
    reportServerTable = *for_each(x,"<tr><td>"+x+"</td></tr>",reportServerTable)
    ? "<table border=\"1\" cellspacing=\"1\" cellpadding=\"3\" >"+crlf()
    ? "<tr><th>Server</th><th>Reports Generated</th><th>Reports     Canceled</th></tr>"+crlf()
    ? reportServerTable
    ? "</table>"+crlf()
else
    ? "Report Server Is NOT Running<br>"+crlf()
end if
%>

 

This page shows how many instances of the Report Server are running, how many reports each instance has handled, and how many reports each Report Server instance is currently printing.

For example, the screen blow shows a Tabbed UI with 3 buttons that execute very long running reports.

The first button, runs the sample page shown above.

When the first button is clicked to show that Report Server Information, we see that there are 3 instances of the Report Server (because a multi-core version of the Report Server has been licensed), but that currently all instances are idle (because no reports have been requested). However, we see that previously instance 1 has handled 7 reports, while instance 2 and 3 have each handled 1 report each.

 

 

In this next image, the user has clicked on each of the three 'BigCustomerSummary List' buttons. This has sent back three separate requests to the server to print long running reports.

 

Now, if the Report Server Info button is clicked we see that the Report Server is running and that all three Report Server instances are processing reports.

 

Now, a short while later if we refresh the Report Server info page, we see that all reports have now been completed. There are no reports being printed and that each Report Server instance has handled 1 additional report.

 

 

 

 

 

Bugs

Dialog Component - Postgres Database - Data Entry - Sequences - In a data bound Dialog component, if the table into which you were doing data entry specified a sequence for an auto-increment field, the record would not be refreshed correctly on screen after a new record was added. This issue only happened if the auto-increment field was NOT defined as the primary key in the table schema.

File Import Operation - Import into Existing Table - Genie was not initializing correctly with the existing table's fields names.

Grid Component - File and Image Upload - File Names with International Characters - When uploading files to character fields (i.e. when the uploaded files is stored in a folder on the server, rather than in a binary field in the target record), files with international characters in the name were not being saved correctly.

 

Grid Component - File and Image Upload - Customizing the Text in the Upload Window - The file and image upload Action Javascript builders allow you to customize the text for the prompt and watermark shown in the window that is displayed to select the file to be uploaded. The builder was not URL encoding the text that you entered in the 'Prompt' and 'Watermark' properties, as it should have done. This is now fixed. However, if you are using language tags for either of these properties, you will need to use a new directive in your language definition to instruct Alpha Five to use a URL encoded replacement value for your language tag. For example, assume that you set the 'Prompt' property in the builder to:

<a5:r>FileUploadPrompt</a5r:>

In the Language Definition, you must wrap the replacement string in the 'urlencode{{' and '}}' strings to instruct Alpha Five to URL encode the replacement value. For example

FileUploadPrompt=urlencode{{Select the file you want to upload.}}

 

Reports - Charts - In some cases, reports with charts would not print when the report was printed in a Web application.

Reports - Quick Report Builder - You could not clear a formatting expression for a field once you had defined it.

Reports Editor - Calculated Field Properties - If Alpha Five could not evaluate the data type of a calculated field (perhaps because a global or session variable used in the expression was not available at design time), then when you right clicked on the field in the Report Editor to set the field properties, the 'Width' property was not shown.

 

Grid and Dialog Component - Lookup Grid - Lookup Grid Configured to Not Show if No Active Search - Internet Explorer - If you had a Grid or Dialog with a Lookup field that displayed a Grid that was configured to only show the Grid part when there was an active Search, the popup window in which the Grid was displayed would behave oddly under Internet Explorer. Every time you hovered over the 'Clear search' hyperlink in the Search Part, the window height would grow by a small amount. This was only under Internet Explorer.

Grid Component - {grid.Object}.showGridColumn() Method - Now also hides the summary value column, if there is one.

 

Layout Table Report - Landscape Mode - If you define a landscape report in the Layout Table Report Genie, then switch to the Report Editor, the report editor did not correctly show that the report was in landscape mode.

 

Dialog Component - Data Bound - Cascading Dropdownboxes - Now, when you populate a Data Bound Dialog with data from a table, any cascading dropdownboxes are now correctly populated.

 

Application Server - SSL - Alpha Fives uses a 3rd party DLL to support SSL. This releases has a work around for a bug in the 3rd party OpenSSL DLL that can cause the server to appear unresponsive.

Linked Reports - SQL - The way in which Linked Reports that are based on SQL tables are handled has been improved. Previously, it was possible to run out of connection handles if there were a large number of linked reports on a page. This resulted in the failure of a linked report to be shown for some parent records.

 

Dialog Component - Charts - Bitmap size - The Chart Control in the Dialog Component has been changed to generate .png files rather than .bmp files. This results in a substantially smaller image bitmap and therefore better performance because of lower network traffic.

 

Application Server - Logs - Rotation - Automatic rotation of logs was not working correctly. This is now fixed.

Grid Component - Grouping - Summary Fields in Groups - Filter on Grid - SQL - In a Grid based on a SQL table, if the SQL on which the Grid was based included a WHERE clause, the summary calculations in the Group Header or Footer were not correct.

 

Grid component - FetchMore Record Navigation Mode - Form Layout - Snaking Columns - FetchMore mode is not supported when snaking column layout is turned on. The user interface now suppresses the Record Navigation Mode property when snaking columns is turned on.

 

Dialog and Page Layout Component - Open Grid Action - Target TabbedUI Pane - Re-use Existing Pane Setting - If you defined an action on a Page Layout or Dialog Component to open a Grid in a Tabbed UI Pane, the setting to re-use existing panes was not being honored.

 

Reports - Linked Reports - SQL -- Publish Fields to Parent Report - Fixed an issue when publishing fields from an linked report to the parent report when the linked report was based on a SQL data source.

Charts - Data Series Styles -  Fixed an issue when defining multiple Data Series style.

 

Report - Images - Printing images in a report was failing as a result of another recent change made to improve image scaling. This bug only exists in the pre-release build.

Reports - Linked Reports - Oracle - In some cases linked reports, based on Oracle tables, were not printing correctly.

Web Applications - FTP Publishing - Improvements were made to both standard and Optimized FTP Publishing. For Optimized publishing, it will no longer fail if you are publishing to a folder if your have the Security Framework turned on, and you have never published to that folder previously. For regular FTP publishing, it was sometimes necessary to move the mouse occasionally while publishing files to get Alpha Five to continue with the next file in the list of files to be published.

Application Server - Memory Leak - A memory leak in the pre-release update was fixed. This memory leak is NOT present in the current official update.

Calendar Component - .dbf Tables - If the Calendar component was built using .dbf tables for the calendars and events table, the events were not displayed on the Calendar.

Reporting - Linked Reports  and Charts - Bugs relating to Linked Reports and printing of Charts were fixed.

Dialog Component - Repeating Sections - Client-side Conditional Styles - Client-side conditional styles were not working correctly for controls in a Repeating Section.

Forms/Reports - Static RTF - Could not set dynamic properties for the static RTF object.

Grid Component - DBF Tables - Grids Based on Views - If a Grid that was based on multiple .dbf tables was used to enter multiple new records at once, and the refresh method was not set to full page, the primary keys for the new records added to the Grid would not be stored in the Grid object correctly. This meant that if you added multiple new records, saved the new records, and then immediately edited the records just added, the edits might be applied to the wrong record. This problem only occurred if you entered more than one new record at a time.

Web Applications - FTP Publishing - An intermittent bug with FTP Publishing was fixed.

Grid Component - Link Control - Open Target Page in Ajax Window - If the URL of the target page contained variables based on data in the current row, the variables were not properly created.

 

Features

Dialog Component - Synchronize Events - Client-side and Server-side - When a Dialog component is opened in a pop-up window, it can be set to use a 'cached' version of the Dialog the second and subsequent time it is opened. In the case of small Dialogs, there is not much benefit is using a cached version. But for large Dialogs, if you use a cached version, the second and subsequent opens will be much faster.
 

When a cached Dialog is opened the onDialogInitialize event does not fire. Instead, there is a client-side and (new) server-side event that fires.

See video D68 for more details.

 

 

 

Clipboard Object - The Xbasic clipboard object now has new methods to query the available clipboard formats and for reading registered clipboard formats.


For example, after selecting HTML in a browser (Chrome, IE, Firefox, etc.), a format called "HTML format" is available.



' Query the available clipboard formats
? clipboard.Available_Formats()
= DataObject
CF_TEXT
CF_UNICODETEXT
HTML Format
Ole Private Data
CF_LOCALE
CF_OEMTEXT

 

 

When reading data from the clipboard, you can now pass in the format type using a string. Previously you had to use a number to indicate the format.

For example:


 

? clipboard.Get_Data("HTML Format")
= Version:0.9
StartHTML:0000000195
EndHTML:0000003925
StartFragment:0000000233
EndFragment:0000003887
SourceURL:http://msdn.microsoft.com/en-us/library/windows/desktop/ff729168(v=vs.85).aspx
<html>
<body>
<!--StartFragment-->
<h1 id="TopicTitle" style="font-size: 36px; fo....
....formats are described in the following table.</p></div></div></div></div>
<!--EndFragment-->
</body>
</html>

 

 

udf_multiple_define() Function  -  (For Advanced Users) - Allows you to register multiple user defined functions at once. The UDF are stored in a string.

Technical Note: The defined functions become standard UDFs. In other words, they exist in the global namespace.

For example, say you have this string that defines several functions:

 

UDFString = <<%code%
function foo as c()
    foo = "foo"
end function
function bar as c()
    bar = "bar"
end function
function foobar as c()
    foobar = foo() + bar()
end function
%code%
 

Now, to register these functions as UDFs:

udf_multiple_define(UDFString)

 

Having done this, you can now invoke any of the functions. For example:

?foo()

= "foo"

 

Contrast this with the compile_template() function, which puts the compiled functions into a specific namespace. For example, here we create a dot variable and the functions are become properties of the dot variable.

 

dim p as p

p = compile_template(udfstring)

?p.foo()

= "foo"
 

 

PDF_Append_List() Function  - Appends a list of pdf documents into a single pdf file.

Syntax:

 

flag = pdf_append_list(FileList as c, ResultFile as c)

 

 

PDF_Split_Pages() Function - Splits a single PDF document into multiple documents - one document per page.

 

Syntax:

pdf_split_pages as l (Source_File as c [, Result_File  as c ])


If Result_file is blank, Source_file name will be used. Result files will have page number appended to name. For example:'Result_File_page1.pdf', 'Result_File_page2.pdf', etc
 

 

 

Reports - Layout Table Reports - Export to Word - Exporting Layout Table Reports to Microsoft Word is greatly improved fro two reasons:

Watch Video

 

 

SQL Summary Functions - New functions have been added to get summary values from a sql table. These functions are:

 

Note for Access Users: These functions mirror the DSum(), DCount(), etc. 'domain' functions in Microsoft Access.

 

For example, the following Interactive window session shows examples that go against the sample Northwind database.


dim cn as sql::connection

cn.open("::Name::access_northwind")
dim args as sql::arguments
args.add("whatOrder",10248)

dim n as n
?sql_max(cn,"order details","[unitprice] * [quantity]","orderId = :whatOrder",args)
= 174
?sql_min(cn,"order details","[unitprice] * [quantity]","orderId = :whatOrder",args)
= 98

?sql_avg(cn,"order details","[unitprice] * [quantity]","orderId = :whatOrder",args)
= 146.6667
?sql_sum(cn,"order details","[unitprice] * [quantity]","orderId = :whatOrder",args)
= 440

?sql_count(cn,"order details","[unitprice] * [quantity]","orderId = :whatOrder",args)
= 3

 

 

Grid and Dialog Component - Client-side Calculated Fields - International Currency Symbols - If you define a client-side calculated field and you want to format the result of the calculation with a currency symbol, you might use the str() function to format the result. For example:

str(price * qty,10,2,"$,")

 

When used in a server-side calculation, the str() function automatically uses the currency symbol defined by the machine's Regional Settings. However, when used in a client-side calculation, the Regional Settings of the server are unknown. The str() function therefore always uses a $ sign.

Now, you can supply a 5th parameter to the str() function (only when it is used in a client-side calculation), to explicitly set the currency symbol to be used. The value for the currency symbol must be entered using Javascript Unicode notation. A helper in the Client-Side Expression dialog box will allow you to insert the currency symbol in the correct format.

 

Images - Reports and Xdialogs - More image types are now supported, including images referenced by a URL. For example, the following Xdialog shows a URL image:

 

ui_dlg_box("test","{image=http://i.cdn.turner.com/cnn/.e/img/3.0/global/header/hdr-main.gif}")
 

 

Reports - Layout Table Report Editor - Images - Previously you were limited to inserting images that were either internal to Alpha Five, or images that had been added to the Control Panel. However, this was a serious limitation for users who were using Layout Table reports in Web applications. Now, you can insert images from the Web Project folder. The image name is stored in the report as:

 

[webroot]\yourImageFilename.extension

 

Grid Builder - ADO Data Source - The Grid Builder no longer shows the ADO data source option since the preferred method for accessing SQL databases is AlphaDAO (not ADO). Grids based on ADO data sources are severely limited - they are not AJAX enabled. If you want to turn the ADO option on, go to View, Settings, Preferences, Grids.

jQuery Version - Web Applications - By default, Alpha Five loads jQuery automatically when any component is run. The source for the jQuery files is controlled by a setting in the Web Project Properties. If you load the 'internal' version of JQuery, this has been updated to the latest jQuery version.

Grid and Dialog Component - OnChange Event and OnClick For Checkbox and Radiobutton - Event Delay - When you define an OnChange event for a control on a Grid or Dialog (or an OnClick event for a Checkbox or Radiobutton), a 1 ms delay is automatically introduced before the event is actually fired. This delay is necessary to make sure that the internal 'set dirty' event for the control has fired before the user defined event fires. However, in some cases, this delay can cause unintended consequences, so an ability has been added to instruct Alpha Five to not introduce this delay (which is in the form of a setTimeout() function), when generating the code. By adding the special {NoSetTimeOut} directive to the beginning of your Javascript code, you can prevent the delay from being added to your code.

If you are using Action Javascript to write the code for the event handler, you can add an Inline Javascript action as the first action in the script and add the directive to this action.

 

Text Encoder Window - Web Applications - Entering International Characters - In some parts of the Component builders, when entering international characters, it is necessary to use encoded text. The new 'Text Encoder Window' makes this easy to do. This window is modeless - it can be left open while you are working. It is opened from the Tools menu when the Web Control Panel has focus.

 

 

Chart Control - XY Charts - Data Label - Data Label Expressions now support control over what data to show next to data point for XY charts. You can show the X axis data, the Y axis data, or any expression of your choice that involves both data points.


 

Grid Component - Search Part - Search Options - Negated Searches - The numeric search options (e.g., 2, 3, 4 etc.) which control whether a search is for text that is contained in, starts with, or ends with a particular search string, can now all be negated (e.g. -2, -3, -4) to negate the search. For example, if you set the search option to -2, then the search will be for records that do NOT equal the specified search string.

 

Grid Component - Display Images Embedded as BLOBs in Table Fields - PNG - If a table contains a BLOB field with an embedded image, a new display format, <PNG Field> can be selected to display PNG images that are stored in the BLOB field.

 

Dialog Component - TextArea Control - Prevent Resize -  New property allows you to turn off resizing of the text area in browsers that support text area resize (such as Safari).

 

Grid and Dialog Component - Cascading Dropdownboxes - More than 2 Cascade Levels - Previously if you had more than 2 cascade levels (e.g. Countries --> Cities -->Customers), all of the dropdownboxes had to be populated from the same table. Now, each dropdown can be populated from its own table. The only caveat is that the relevant fields in all tables must be named the same.

 

Dialog Component - Charts - Language Strings - The <a5:r>..</a5:r> language tags can now be used in Chart data labels and titles.
 

Reports - Using Arguments in the 'top_records()' Filter Expression - It was not possible to use an argument in the top_records() filter expression previously.

For example, the following pattern was not supported:

dim args as sql::arguments 
args.add("whatstate","ca")
args.add("count",2)
filter = "top_records(:count,\"bill_state_region = :whatstate\")"
report.preview("Customer Summary List",filter,"",.f.,.f.,args)
 

The reason this did not previously work is that the arguments were in a 'string within a string'.

Now, this pattern is supported. As you can see in the above example, arguments are used both for the number of records to display, and for the state name.

 

DBF Tables - PNG Images - DBF Tables now support a new field type - PNG Image. This means that that DBF tables now support the following image types

 

SQL Reporting - Built-in Support for PNG Image - Assume you have a report based on a SQL table. A field in the SQL table has a binary data that is in PNG Image format. You can now easily print this image in your report. When you define the SQL DataSource for the Report, click the 'Advanced Options' button then select 'Override field definitions....'

Once you have set the Field Definition Override, then simple place the field on your report and set its format properties. Typically the only property you need to set is the 'Display Mode' which you normally will set to 'Stretch' or 'Best Fit'.

 

 

Note: These comments apply to binary fields that contain JPG and BMP data as well, but support for these data types has always been present

 

 

Application Server - Server Logs - Enhancements to the Server Logs - The HTTP Raw log will now also record:

 

 

The Thread ID is just a unique identifier given to each thread so that we can track which thread is logging which request or response.

The request sequence is a simple counter of the number of requests that the thread has processed since it was created. Note that currently this count is slightly flawed, as it is a count of the number of times a connection on the the listener has been accepted. If a client connects but never send a complete request (DoS, timeout, etc.), it will be counted as a request processed for the purposes of this counter.

The socket handle is simply the handle for the open socket being used by the thread.

The Keep-Alive sequence is a simple counter of the number of requests that have been serviced while the currently connected socket has been connected.

In normal operation:

  1. The server will start up and log a number of threads being started and show the thread id for each.
  2. A request will come in and the headers will be logged, recording the thread ID, request sequence (1), socket handle (some numeric value), the Keep-Alive sequence (1), and the log entry type "**HEADERS"
  3. The server will log the request body, also recording the (unchanged) extended info. This is logged even if there is no body (i.e. a GET request) and will simply reflect an empty body.
    The server will log the response, also recording the (unchanged) extended info.
  4. Upon the next request received by this thread, the request sequence will increment. If the socket had remained connected since the previous request, the socket handle will remain unchanged and the keep-alive sequence will increment. If the socket was closed, the request sequence will be incremented, the socket handle will (should) be a new value, and the keep-alive sequence will be reset to 1.
  5. If the server starts to get busy and extra spare threads are needed, they will be created as specified by the server settings and the new thread creation will be recorded.
  6. If a previously busy server now has less traffic and has too many spare threads, they will be killed off as specified by the server settings, and thread destruction will be recorded.
  7. It is possible for log entries to be interleaved as various threads may write to the log. Using the thread id, request sequence, socket handle and keep-alive sequence as a primary key of sorts will allow you to find all three parts of the Request and Response.
     

Here's an example of what it all looks like. Lines in red are not in the actual log, they have been added to add to the explanation.

 


****************************************
Starting initial worker threads
****************************************
****************************************
Starting new thread, ID: 167d9be3d8c94cfc8fa512b1065a6c6c
****************************************
****************************************
Starting new thread, ID: 66c4cf92103f47ceaa2815363f3f3453
****************************************
****************************************
Starting new thread, ID: 366d0cb33ab04f918d5d1f135ff597fa
****************************************
****************************************
Starting new thread, ID: 25d15758a37d4349932fe4b14de3aa6f
****************************************
****************************************
Server now running all initial threads.
****************************************
The server is now fully up and running.
****************************************
13/Sep/2012:18:20:54 -0400
Thread ID: 66c4cf92103f47ceaa2815363f3f3453
Request Sequence: 1
Socket Handle: 384
KeepAlive Sequence: 1
**HEADERS** log entry type HEADERS

GET / HTTP/1.1
Host: localhost
Connection: keep-alive
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: A5WSessionId=ae733863d183414b8b1a27504ae0f455
****************************************
13/Sep/2012:18:20:55 -0400
Thread ID: 66c4cf92103f47ceaa2815363f3f3453
Request Sequence: 1
Socket Handle: 384
KeepAlive Sequence: 1
**BODY** This is how an empty body gets logged.
****************************************
****************************************
Here's the response, with matching thread id, socket handle and sequences.
13/Sep/2012:18:20:55 -0400
Thread ID: 66c4cf92103f47ceaa2815363f3f3453
Request Sequence: 1
Socket Handle: 384
KeepAlive Sequence: 1
**RESPONSE**

R>>> HTTP/1.1 200 OK
R>>> Connection: Keep-Alive
R>>> Accept-Ranges: none
R>>> Date: Thu, 13 Sep 2012 22:20:55 GMT
R>>> Server: Alpha Five/11.0 Build/2931-3998
R>>> Content-Length: 2942
R>>> Content-Type: text/html
R>>> Set-Cookie: A5WSessionId=8dc0ad94cf314b71bb042528e8692d03; HttpOnly; path=/
R>>>
R>>> <a href="http://localhost/">A5V11</a> - <a href="http://localhost:82/">A5V10</a> - <a href="http://localhost:81/">IIS</a>
R>>> <h2>Server Objects</h2>
R>>> <a href="/Request/">Request and Context.Request</a><br/>
output trimmed
****************************************
Here is the second request. It came in on the same socket that remained connected (Keep-Alive) and was handled by the same thread.
The socket handle is still the same because the socket was never closed.
Both sequences have been incremented.

13/Sep/2012:18:20:55 -0400
Thread ID: 66c4cf92103f47ceaa2815363f3f3453
Request Sequence: 2
Socket Handle: 384
KeepAlive Sequence: 2
**HEADERS**

GET /favicon.ico HTTP/1.1
Host: localhost
Connection: keep-alive
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: A5WSessionId=8dc0ad94cf314b71bb042528e8692d03
If-Modified-Since: Fri, 20 May 2011 15:56:16 GMT
****************************************
13/Sep/2012:18:20:55 -0400
Thread ID: 66c4cf92103f47ceaa2815363f3f3453
Request Sequence: 2
Socket Handle: 384
KeepAlive Sequence: 2
**BODY**
****************************************
****************************************
13/Sep/2012:18:20:55 -0400
Thread ID: 66c4cf92103f47ceaa2815363f3f3453
Request Sequence: 2
Socket Handle: 384
KeepAlive Sequence: 2
**RESPONSE**

R>>> HTTP/1.1 304 Not Modified
R>>> Connection: Keep-Alive
R>>> Accept-Ranges: none
R>>> Date: Thu, 13 Sep 2012 22:20:55 GMT
R>>> Server: Alpha Five/11.0 Build/2931-3998
R>>> Set-Cookie: A5WSessionId=8dc0ad94cf314b71bb042528e8692d03; HttpOnly; path=/
R>>>
****************************************
****************************************
Here is the third request. It came in on a new socket on a different thread.
13/Sep/2012:18:20:55 -0400
Thread ID: 167d9be3d8c94cfc8fa512b1065a6c6c
Request Sequence: 1
Socket Handle: 2091
KeepAlive Sequence: 1
**HEADERS**

GET /favicon.ico HTTP/1.1
Host: localhost
Connection: keep-alive
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: A5WSessionId=8dc0ad94cf314b71bb042528e8692d03
If-Modified-Since: Fri, 20 May 2011 15:56:16 GMT
****************************************
13/Sep/2012:18:20:55 -0400
Thread ID: 167d9be3d8c94cfc8fa512b1065a6c6c
Request Sequence: 1
Socket Handle: 2091
KeepAlive Sequence: 1
**BODY**
****************************************
****************************************
13/Sep/2012:18:20:55 -0400
Thread ID: 167d9be3d8c94cfc8fa512b1065a6c6c
Request Sequence: 1
Socket Handle: 2091
KeepAlive Sequence: 1
**RESPONSE**

R>>> HTTP/1.1 304 Not Modified
R>>> Connection: Keep-Alive
R>>> Accept-Ranges: none
R>>> Date: Thu, 13 Sep 2012 22:20:55 GMT
R>>> Server: Alpha Five/11.0 Build/2931-3998
R>>> Set-Cookie: A5WSessionId=8dc0ad94cf314b71bb042528e8692d03; HttpOnly; path=/
R>>>
****************************************
This request was handled by the same thread that got the first and second requests, but the keep-alive connection had timed out.
This is indicated by the same thread id, incremented request sequence, new socket handle, and reset keep-alive sequence.
13/Sep/2012:18:42:55 -0400
Thread ID: 66c4cf92103f47ceaa2815363f3f3453
Request Sequence: 3
Socket Handle: 1672
KeepAlive Sequence: 1
**HEADERS**

GET /favicon.ico HTTP/1.1
Host: localhost
Connection: keep-alive
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: A5WSessionId=8dc0ad94cf314b71bb042528e8692d03
If-Modified-Since: Fri, 20 May 2011 15:56:16 GMT
****************************************
13/Sep/2012:18:42:55 -0400
Thread ID: 66c4cf92103f47ceaa2815363f3f3453
Request Sequence: 3
Socket Handle: 1672
KeepAlive Sequence: 1
**BODY**
****************************************
****************************************
13/Sep/2012:18:42:55 -0400
Thread ID: 66c4cf92103f47ceaa2815363f3f3453
Request Sequence: 3
Socket Handle: 1672
KeepAlive Sequence: 1
**RESPONSE**

R>>> HTTP/1.1 304 Not Modified
R>>> Connection: Keep-Alive
R>>> Accept-Ranges: none
R>>> Date: Thu, 13 Sep 2012 22:20:55 GMT
R>>> Server: Alpha Five/11.0 Build/2931-3998
R>>> Set-Cookie: A5WSessionId=8dc0ad94cf314b71bb042528e8692d03; HttpOnly; path=/
R>>>
****************************************
The admin stops the server, and the closing off all threads is recorded.
****************************************
Server shutting down, stopping all threads
****************************************
****************************************
Ending thread, ID: 66c4cf92103f47ceaa2815363f3f3453
****************************************
****************************************
Ending thread, ID: 366d0cb33ab04f918d5d1f135ff597fa
****************************************
****************************************
Ending thread, ID: 25d15758a37d4349932fe4b14de3aa6f
****************************************
****************************************
Ending thread, ID: 167d9be3d8c94cfc8fa512b1065a6c6c
****************************************
 

 

 

Dialog Component - Map Control - New Method to Show Marker Detail - A new method is now available to open the info box for a marker on the map

<mapObject>.showMarkerDetail(markerName)

 

Dialog Component - Arguments - Bind Arguments to Field Values - You can now bind argument values to controls on the Dialog component.

On all Ajax callbacks, the value of the controls on the Dialog are submitted, and the value of any argument that is bound to a control value is updated.

This is especially useful you have a Data Series used in a Chart where the SQL or DBF query for the Data Series references an argument value in the filter. When an Ajax callback is made to refresh the Data Series, the arguments will be reference the current value of the controls they are bound to.

 

 

Application Server - Xbasic Debugger - Previously it was not possible to debug server side Xbasic code in a running web application. You can debug using Working Preview, but in some cases, using Working Preview if not an option because your component might rely on session variables, or the Security Framework, which are not present in Working Preview. Now, any page or Component that is run in LivePreview can be debugged in the Xbasic Debugger.

Watch video.

 

Dialog Component - Server-side Action Scripting - Send-Email Action - Reading E-mail Settings at Run-time - You can now configure this action to read the e-mail settings from the Repository Database at run-time.

For example, see how the properties are set in the image below.

For more information, including information on how to use a Dialog component to set values for these properties in the Repository, watch this video.

 

 

Dialog Component - Container Width Mode - Wysiwyg Mode - Was not previously implemented for 'Container Width' mode. This is now working.

Dialog Component - Container Width Mode - Control Width - Previously, if an explicit width for a control was not defined, it defaulted to 2in. Now, if a width is not defined the control will generally auto-size.

Grid and Dialog Components - Language Tags - Unresolved Tags - If a Grid or Dialog uses language tags (<a5:r>....</a5:r>), any language tags that were not replaced (because there was no corresponding definition in the Language Definition), are automatically stripped out of all Javascript that is sent to the browser. In some cases, this turns out to be undesirable. Therefore, a new property has been added to allow you to turn off this behavior.

String Functions - UTF8 Data - UTF8 Compliant versions of the following string functions have been introduced:

 

These are: 

 

 

 

Action Javascript - Dialog Component - New Action - 'Chart Actions' - A new action has been added to Action Javascript to execute some of the methods exposed by the Chart control. Using Chart Actions you can:

The Export charts action exposes options such as page size and orientation for PDF files.

 

Grid Component - .RefreshRow() Method - Custom Controls - This method now refreshes any custom controls in the current row.

 

Dialog, TabbedUI and PageLayout Builders - Inserting Containers - The toolbox has been simplified and there are no longer separate entries for [Container End], [Frame End], [Tab Control End] etc.

 

Application Server - Using 3rd Party Programs Such as AlwaysUp or Srvany - When using 3rd party programs, such as AlwaysUp, which run the Application Server as a service, it is imperative to ensure that Alpha Five does not display any notification dialogs of any type, as this will hand the server. As a result, a new command line switch can be used when starting the Application Server. The switch is:

BACKGROUNDTASK

 

When this command line switch is used, all UI is disabled. The server will not raise any configuration or error dialogs at all and there is no systray icon created. Further, if the server cannot start properly (e.g. the port is in use), the details of the failure will be logged in the Windows Event log (as shown below) and the process will exit.

 

 

 

 

Grid and Dialog Component - Client-side Conditional Text and Event - The client-side conditional style feature  has been extended and now can be used to also dynamically set the text of a (non-data bound) control (e.g. button, hyperlink, static-text object). It can also be used to dynamically call an arbitrary Javascript function.

In addition the client-side conditional style property was previously only available for data bound controls (e.g. textboxes, textareas, etc.). It is now available for non-data bound controls, such as buttons, hyperlinks and static text objects.

See video D63. Watch videos

(Subscriber Benefit)

 

Grid - Group Breaks - Descending Order - When you define Group Breaks for a Grid, you can now specify that the groups should appear in descending order.

 

Grid - Fixed Column Widths - You can now apply fixed column widths to buttons, hyperlink, image and static text columns.

 

Dialog Component - Collapse/Expand Containers - Double Click - You can now collapse or expand a container by double clicking on it. Previously you had to right click and select from a menu. (Subscriber Benefit Only)

 

Xdialog - Event Filtering - In an Xdialog the syntax for adding event handlers to a control is typically something like this:

 

[.100selected^#choices!choiceChanged]

 

or

[.100selected^#choices!choice_*]

 

In the first case the event fires when the variable changes. Events such as double clicking on the list, or setting focus to the list do not trigger any events.

In the second example, because of the _* in the event name, all events fire. Often, you are forced to use this syntax because you care about the double click event (even though you don't care about the set and kill focus events). However, because so many events are firing your event handler code becomes unnecessarily complicated.

Now, you can specify an 'event' filter to indicate which events should fire.

You still use the _* syntax in the event name (to fire all events), but then you follow this with a | and a comma delimited list of the events you want to filter in.

 

 

dim colors as c = a5.Color_Enum()
dim events as c
ui_dlg_box("Color",<<%dlg%
[.100,10color^#colors!list_*|change,dblclick];
Events:;
[%M%.100,10events!edit]
%dlg%,<<%code%
if left(a_dlg_button,5) = "list_" then
events = events + a_dlg_button + crlf()
a_dlg_button = ""
else if left(a_dlg_button,5) = "edit" then
a_dlg_button = ""
end if
%code%)

 

 

Dialog Component - New Layout Mode - 'Container Width' - The Dialog component now has two layout modes:

Prior to this build, the only mode was 'Control width'. Starting with this build, the default mode for new Dialog components is 'Container width'. To select the layout mode, select the 'Properties' pane and then the 'Layout type' property at the top of the list of properties.

There are significant advantages to the 'container width' mode, but it is important to understand the differences between this mode and 'control width'.

Watch video

In 'control width' mode, the width setting that you define for a control (either explicitly in the control's 'width' property, or implicitly in the control's in-line style property) is applied to the control itself. The control is then wrapped in a container div (with a class of 'A5Container') which has padding settings. The total width taken up by the control when it is rendered is therefore the actual control width, plus the container left padding, plus the container right padding. If the control label is left or right aligned, then you must add the label width to the total width. Because the total width taken up by the control is quite different than the explicit width you assigned to the control, it can be difficult to lay out your Dialog controls so that the right edges of all controls are nicely aligned.

In 'container width' mode, the width setting you define for a control is actually applied to the width of the container div in which the control is wrapped. The container div has a class of 'A5CWLayout'. The actual width of the control is whatever is left over after subtracting the left and right padding from the container width. If the control label is left or right aligned, the actual control width will be further reduced by the width of the label.

In 'container width' mode, if you don't assign an explicit width to a control, a default of 2 inches is used.

Let's say you have a Dialog with these controls, laid out over several lines:

[Firstname (3in) ] [Lastname (3in) ]

[Address (6in) ]

[City (3in) ] [State (1in) ] [Zip (2in) ]

As you can see, the total width of all of the controls on each line is 6 inches. However, in 'control width' mode, the right edges of the controls will not be nicely aligned. However, in 'container width' mode, the right edges of the controls will be perfectly aligned, as shown in the images below:

 

Control Width Layout

Container Width Layout

Using Percentage Based Control Widths

The advantage of 'container width' mode is even more apparent when you want to use percentage based layout widths.

For example, assume that the controls in a section of the Dialog are wrapped in a Container or a Frame and a width of (say) 6 inches has been applied to the container. The actual widths assigned to the individual controls in the container are in percentages, as follows:

 

[Firstname (50%) ] [Lastname (50%) ]

[Address (100%) ]

[City (50%) ] [State (20%) ] [Zip (30%) ]

 

The images below show that when the Dialog is rendered, it is nicely laid out. In the second image, the width property of the containing Frame has been changed from 6 inches to 3 inches, but the Dialog still continues to be nicely laid out and none of the individual form controls has had to be adjusted. Nice!

 

Percentage based layout using 'Container Width' mode - 6in width applied to containing Frame control

 

Percentage based layout using 'Container Width' mode - 3in width applied to containing Frame control

 

 

 

Dialog Component - Logical Checkbox - Repeating Section - When you place a logical checkbox control in a Repeating Section, the control's width property is honored, and the logical checkbox is centered in a column whose width is set by the control's width property.

 

 

Dialog Component / Tabbed UI / Page Layout - Frame control has new height and width properties.

 

Action Javascript - Open Grid, Report, Dialog in Ajax Window - Builder now has options to suppress the close button on the window title, or suppress the window title completely.

 

Dialog Component - Charts - Dynamic Number of Series on a Chart - For certain types of charts it is desirable to have a variable number of data series plotted on the chart. A new property has been added to the Chart Builder in the Dialog component that allows you to transform a single physical series into multiple 'logical' series.

For example, consider a chart for which the following Static data series has been defined:

 

Sales|Year|Company
1200|2001|IBM
1500|2002|IBM
1600|2003|IBM
1400|2001|GM
1600|2002|GM
1650|2003|GM
 

 

This data set could be divided into the following 2 logical data sets by splitting the data on the 'Company' sub-series. The first logical data series would be:

Sales|Year|Company
1200|2001|IBM
1500|2002|IBM
1600|2003|IBM
 

And the second logical data series would be:

Sales|Year|Company
1400|2001|GM
1600|2002|GM
1650|2003|GM

 

The Chart builder allows you to specify if the data should be split (into multiple logical series) and to specify what field (i.e. sub-series name) on which to split the data.

 

 

 

 

 

Grid and Dialog Component Builder - Field Labels - CamelCase Field Names - When you build a Grid or Dialog and you add a new field to the component, a suggested field label is automatically created from the field name (or variable name in the case of a Dialog). Now, the suggested field label honors camelCase fields. For example, if your field name is 'lastName', the suggest field label will be 'Last Name'.

 

Web Projects - Search all Files - Now includes CSS and Javascript files.

 

{Dialog.Object}.exportChart() method - Allows you to export charts on a Dialog component to a PDF or RTF file. (see video FP11_DLGCHART13)

 

Video Finder - The Video Finder utility (Help/Video Finder) has been improved in two significant ways. The Video Finder window is now opened as an MDI window, rather than a modal window. This means that the Video Finder can now be kept open at all times. Also, when you click on a hyperlink to play a video, your default browser is now used. Previously, Internet Explorer was used, regardless of your setting for default browsers.

 

Web Applications - Working with Session Files - New Methods of the Session Object - Three new methods of the session object have been introduced. These methods are:

 

Syntax:

Session.SaveFileToSessionFile(filename as c,key as c)

 

Example:

 

dim string as c

string = <<%txt%

this is a long string

that has multiple

lines

of

text

%txt%

dim fn as c

fn = request.GetRequestTempFileName(".txt")

file.from_string(fn,string)

 

 

dim key as "temp.txt"

Session.SaveFileToSession(fn,key)

 


 

Syntax

Session.GetDataFromFile(BYREF data as B,key as c)

 

Example:

dim b as b

dim key as c

key = "temp.jpg"

Session.GetDataFromFile(b,key)

 

Syntax:

    Session.DeleteSessionFile(key as c)

 

Example:

key = "temp.jpg"

Session.DeleteSessionFile(key)

 

 

Microsoft Access - AlphaDAO - Portable SQL - Round() Function and new NativeRound() Function - The Microsoft Access team, in their infinite wisdom, decided to implement the round() function differently to most other products. In Access, 'bankers rounding' is used. Most other products round up.

When Alpha Five converts a portable SQL statement that uses the round() function it generates code that does rounding up.

As a result of this, when executing portable SQL statements against access you will get slightly different results than when executing the same statement using native SQL.

To address this issue, a new portable SQL function has been added: NativeRound().

If you use NativeRound() against an Access database, the NativeRound() function will be translated to the Access Round() function.

If you use NativeRound() in a query against any other database, Alpha Five will treat the function the same as the Round() function - i.e. it will generate code that rounds up.

 

 

 

 

Dialog Component - Adding Multiple Control to the Dialog At Once - Specifying Control Type - When you add new controls to a Dialog, the dialog box allows you to add one control at a time, or to specify multiple controls at once. When you choose the option to add multiple controls at once, you can now specify an optional control type for each control. For example:


Ciity,State{D},Zip


This will create 3 controls on the same line, and the State control will be a dropdownbox. The control type follows the control name and is enclosed in curly brackets. You can either spell the control type in full or use a first letter abbreviation (for cases where the first letter is not ambiguous).

 

 

 

Application Server - 'Context', 'Request', 'Response', 'ServerSetting' and 'Session' are global objects used by the Application Server. Some users were writing code that was assigning to the root level of these variables, which is, of course, illegal, but also trashed the Application Server environment. Code has been added to now generate a helpful error message when the user tries to assign these variables.

 

Alpha DAO - MySQL - 'Year' Column Type -  Support for the 'Year' column type has been added.

 

 

a5_scale_imageBlob() Function - This function supported two methods for scaling images - using the internal Alpha Five image scaling features, or using the 3rd party ImageMagic application (bundled with Alpha Five). Previously, the ImageMagic application provided superior results when scaling images. Now, the built-in scaling features work as well as ImageMagic, and there is less need to use ImageMagic for image scaling.

 

 

Dialog Component - Using Action Javascript in Custom Javascript Code - You can now use Action Javascript in custom Javascript function. As shown in the image below, the Javascript editor now has a new button on the toolbar (called Action Javascript) that allows you to create new Javascript Actions and to insert code into your Javascript functions that invoke these Javascript actions.

 

Watch video D61

 

 

 

Web Applications - Security Framework - Caching Responses - The security settings now have a new property in the 'Customize' section to 'Ask browser to not cache requests requiring login'.

Check this option to ask a browser to turn off caching for any item that requires login. This ONLY applies to requests for items that require login to view. This will normally cause the browser to make a new request for a page if the browser 'back' or 'forward' buttons are used. Caching will still be permitted if security is off, or the page or component requested is always allowed.
 

Layout Table Reports - Dynamic properties are now enabled.

 

Dialog Component - New Chart Types - New chart types have been added for XY type charts.

 

 

Dialog Component - 'Load Primary Keys' Action - Session Variables - It is now possible to use session variables in the filter your define for the 'Load Primary Keys' action.

Dialog Component - New Method - {dialog.object}.populateDropdownBoxRepeatingSection() - Populates the choices in a Dropdownbox control that is in a Repeating Section. Every instance of the control is updated. I.e. the control in row1, row2, row3, etc. is repopulated.

Dialog Component - New Method - {dialog.object}.refreshDropdownBoxChoices() -  Does an Ajax callback to recompute the choices in a DropdownBox and repopulates the choices in the DropbownBox for the specified controlName. Applies only if the choices in the Dropdownbox are based on a SQL or .dbf query.

Grid Component - .refreshRow() Method - Images - The .refreshRow() method will now also refresh images in the Grid row. Previously, it only refreshed data in the row.

Grid and Dialog Component - Action Javascript - Open a Pop-up Ajax Window Action - New Options - Two new options have been added to this action:

 

File.change_access() Method - Allows you to change permissions on a file.

Syntax:

file.change_access( Filename as c, Option as c )

 

Values for the option flag:

 

+a - allow all users access to a file

-w - revoke write access.

 

Examples:

 

file.change_access("e:\dev\lt_rtf.rtf","+a")

file.change_access("e:\dev\lt_rtf.rtf","-w")

Tips

Calling Xbasic UI from Working Preview - Grid and Dialog  - When you run a Grid or Dialog on the desktop, (which is equivalent to running in Working Preview mode), you might want to call XBasic UI commands to respond to actions on the Grid and Dialog. For example, you might have some Xbasic UDF that opens an Xdialog and you would like to call this Xbasic function when the user clicks a button on the Grid or Dialog.

Keep in mind that when a user clicks a button on the Grid or Dialog, the event handler for this click is Javascript code.

The Grid and Dialog both automatically define a Javascript function called 'genericXbasicUIFromWorkingPreview()' which can be used to invoke your Xbasic function.

For example, say that your Xbasic function (that displays an Xdialog) is called 'showXdialog()' and that it takes a single argument.

You might call this function as follows:

showXdialog("something to show")

 

To call this function from your Javascript code (only in Working Preview mode, of course), you would set the onClick event for the button to:

 

genericXbasicUIFromWorkingPreview('showxdialog("something to show")');

 

 

Using Grid and Dialog Components in Desktop Applications - Closing the Window in which the Component is Shown - If you use a Grid component in a Desktop Application and you open an Xdialog window that hosts a Grid component, a common use case is to automatically close the host Xdialog window when data in the Grid is submitted.

Here is how you can do this:

First, add this code to the Javascript Functions section in the Grid component:

 

function closeXdialog() {
var xb = [];
xb.push('dim dlgtitle as c');
xb.push('dlg_title = ui_dlg_query("dialog")');
xb.push('dlg_title = filter_string(dlg_title,"GridComponentInXdialog_",crlf())');
xb.push('ui_modeless_dlg_close(dlg_title)');
xb = xb.join(';');
genericXbasicUIFromWorkingPreview(xb);
}

 

Then, add this code to the afterGridSubmit and afterRowSubmit Client-side events:

 if(e.hasErrors == false) closeXdialog();

 

 

How to Define your Own Helpers for Function Arguments in User Defined Functions

Assume you have defined the following UDF in the code editor.

 

function myFunc as c(arg1 as c, arg2 as c , arg3 as c , arg4 as n )
    myFunc = "test"
end function
 

Now, when you are writing code and you type myFunc( in the code editor, you would like to provide pick-lists or genies for the function arguments. This can be done easily using the addin.function_argument_help() method.

This method takes these arguments

If the code contains 'Q' the function parameter will be quoted when it is inserted into your code.

If the code contains = the Xbasic expression is expected to display an Xdialog to prompt for a value.

If the code does not contain =, the expression is expected to return a crlf list of choices

If the code contains A, the crlf delimited list of choices is in the form 'displayvalue=returnvalue'

 

'each of the commands below are a single line - line breaks are for readability only

 

'when user right clicks on 'arg1' a ui_get_text() dialog is shown.

addin.function_argument_help( "arg1" , "helper arg1","ui_get_text('Enter argument','argValue')","=Q","")

 

'choices shown to user are 'alpha', 'beta', 'gamma'. Value entered into function is

'quoted
addin.function_argument_help( "arg2" , "helper arg2","comma_to_crlf(\"alpha,beta,gamma\)","Q","")

 

'choices shown to user are 'First','Last' and 'Closest'. Value entered into function

'when user makes a selection is 'F', 'L' or 'C' (quoted)
addin.function_argument_help( "arg3" , "helper for my argument","comma_to_crlf(\"First=F,Last=L,Closest=C\")" , "AQ","")

 

'choices shown to user are 'First','Last' and 'Closest'. Value entered into function

'when user makes a selection is 1, 2 or 3 (unquoted)
addin.function_argument_help( "arg4" , "helper for my argument","comma_to_crlf(\"First=1,Last=2,Closest=3\")" , "A","")
 

 

Notes:

How to Close a Pop-up Window when the Window Contains an .A5W Page - A common use case when a pop-up window contains a Dialog or Grid is for an event handler in the Dialog or Grid to execute some Javascript to close the pop-up window. For example, you might want to close the pop-up window automatically after the Grid has been submitted.

This is easily done using the following techinque:

1. Give the window some arbitrary 'id' by putting a span tag in the window title. For example

<span id="MyWindow1">My Window Title</span>

2. Call this Javascript in the event handler

closeParentA5Window('MyWindow1');

 

A problem arises however if the window contains a .a5w page (which in turn contains the Grid or Dialog component). This is because .a5w pages run in an IFrame. So the window you want to close is not in the same namespace as the Grid or Dialog. To solve this problem, change the Javascript that closes the window to this:

window.parent['closeParentA5Window']('MyWindow1');

 

This executes the function in the context of the IFrame parent's namespace, and the window will close.

 

Creating an .A5w Page that Uses the <ProjectStyle> Style Name

The Project Properties dialog allows you to specify a 'Project Style' that will automatically be used by all components that have their style set to '<ProjectStyle>'. However, if you create your own .a5w page that does not contain any component, you might still want to use load the style sheet defined by the <ProjectStyle>. The sample .a5w page shown below shows how the a5_resolve_componentStyleName() function can be used to dynamically generate the html links to the correctly resolved style name.

 

<!DOCTYPE html>
<html>
    <head>
        <!-- must use in order to make XP Themes render -->
        <meta HTTP-EQUIV="MSThemeCompatible" content="Yes" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
        <%a5
            dim styleHTML as c = ""
            dim styleName as c 
            styleName = A5_resolve_componentStyleName("<projectstyle>")
            styleHTML = styleHTML + "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/"+styleName+"/Style.css\">" + crlf()
            styleHTML = styleHTML + "<script type=\"text/javascript\" src=\"css/"+styleName+"/Style.js\"></script>" + crlf()
        ?styleHTML
        %>
        <title></title>
    </head>
    <body>
    </body>

</html>

 

Serial Port - Using Xbasic to Interact with a Serial Port

 

 

dim sp as System::IO::Ports::SerialPort
dim Buffer as B
dim SizeRead as N
dim BarCodeSize as N = 12
dim ReadLog as C


ui_dlg_box("Bar Code Scan",<<%dlg%
{can_exit=close}
{startup=init}
{timer=CheckScanner}{interval=.5}
{region}
{region}
[%MRV%.30,20ReadLog]
{endregion}
| {region}<Start>;<Stop>;<Close!close>
{endregion}
{endregion}
%dlg%,<<%code%
if a_dlg_button = "init" then
    a_dlg_button = ""
    'sp.BaudRate = 9600
else if a_dlg_button = "Start" then
    a_dlg_button = ""
    hourglass_cursor(.t.)
    sp.Open()
    hourglass_cursor(.f.)
else if a_dlg_button = "Stop" then
    a_dlg_button = ""
    hourglass_cursor(.t.)
    sp.Close()
    hourglass_cursor(.f.)
else if a_dlg_button = "CheckScanner" then
    a_dlg_button = ""
    hourglass_cursor(.t.)
    if sp.IsOpen
        if sp.BytesToRead >= BarCodeSize
            SizeRead = 0;
            Buffer = ""
            on error resume next
            SizeRead = sp.Read(Buffer, 0, BarCodeSize)
            on error goto 0
            if SizeRead = BarCodeSize
                StatusBar.Set_Text(Buffer)
                ReadLog = ReadLog + Buffer + crlf()
            else
                StatusBar.Set_Text("Read error" + Buffer)
                ' .. handle read error
            end if
        else
            StatusBar.Set_Text("Bytes available = " + sp.BytesToRead)
        end if
    else
        StatusBar.Set_Text("Port not open.")
    end if
    hourglass_cursor(.f.)
end if

%code%)
 

 

 

Build 2765_3967  Jun 29 2012

 

Features

Web Applications - Publishing Profiles - New options for creating Profiles - A new button, called 'More', on the Profile dialog allows you to perform the following actions:

In addition, the dialog where you define your Publishing Profiles now has a new button that allows you to test your FTP settings.

 

Calendar Component - Dialog to Edit Events - Format for Date/Time Values -  When you use the feature to automatically create a Dialog component to edit the Calendar events, the Dialog that is generated now automatically fills in a Display Format expression for the start and end time and also automatically sets the Date format of the Dialog based on the current regional settings.

 

Bugs

Dialog Component - Embedded Grid Object - Live Linking - Order Expression - The order expression was not being honored on an embedded Grid that was 'live linked'.

Dialog and Grid Component - Client Side Expressions - Occursi() Function - If you used the occursi() function in a client-side expression, the expression was not being converted correctly into Javascript.

Desktop Applications - Forms - Charts - The size of the chart was artificially limited to 800 px wide.

Dialog Component - Language Tags - A bug was introduced in the previous update causing some language tags in the dialog to be ignored.

Dialog - Chart Controls - Refresh Chart Method - A bug was introduced in build 2759 that has now been fixed.

Grid Component - Norwegian Regional Settings - Write Conflict when Editing Numbers - A bug was fixed when editing numeric values when regional settings were set to Norway.

 

 

 

 

Build 2759_3962  Jun 26 2012

Features

Web Applications - Publishing an Application using FTP - If you publish your web application to your hosting site using the built-in FTP feature, a new FTP option can dramatically speed up the process. When you define your Publishing Profile, there is now a new option called 'FTPOptimized'.

When you select the 'FTPOptimized' option, all of the files to be published are zipped into a single file which is then uploaded to your server. Then, once the .zip file has been published, it is unpacked on the server.

IMPORTANT: In order to use this option, the Alpha Five server must be running, and the 'Base Url' property in the Publishing Profile must be set correctly.

The FTPOptimized option can be orders of magnitude faster than publishing a large number of small, individual files.

Web Applications - Publishing Profiles - Duplicate a Profile -  When you define/edit your Publishing Profiles, there is now a new option to create a new profile by duplicating an existing profile.

Web Applications - Dialog Component - Charting - DBF or SQL Queries - Referencing Control Values in the Filter Expression - Sometimes, when you define the query for a data series on which a chart is based, you would like to use the value in one or more of the Dialog controls in your filter.

For example, say your Dialog has a control called AccountNumber and you want the filter in the SQL expression for your chart to reference the value in this control. This is now easily done, as follows:

  1. Create a new argument (the name of the argument is arbitrary)
  2. Set the argument Default Value to the control name in curly parentheses. e.g. {AccountNumber}
  3. Define the filter and use the argument in the filter.

Grid Component - Alternate View - Google Map - Suppress Marker for Lan/Lng Zero Value - A new property allows you to suppress the marker if a record does not have a non-zero lat/lng value.

Bugs

Email_send_noprofile() Function - MIME Types for Attachments - When you use the .Net option with this function, the MIME types for attachments are now correctly set.

Control Panel Hide - Autoexec Script - If your autoexec script opened a startup Form and then hid the Control Panel, under some circumstances the Control Panel would not be hidden. This bug was introduced in the previous update, but is now fixed.

 

Build 2751_3953  Jun 22 2012

Overview

This is a big update. Here are some of the highlights:

 

Terminology

Change in Terminology - .ADB File is now 'Workspace' not 'Database' - We have changed the terminology for the .adb file. Previously this was called a 'Database'. Now it is called a 'Workspace'. (For users who find this change way too traumatic, you can go to View, Settings, Preferences, Terminology to change back to 'Database').

The reason for this change is that a large number of Alpha Five users today are using Alpha Five to build web applications that connect to SQL databases. Calling the .adb file a 'Database' is therefore both misleading and confusing. It is really a 'Workspace' that contains your files. If your primary focus is still Desktop applications using .dbf files, this change in terminology is still consistent with the function of the .adb file.

New Videos

A new series of videos have been released. Click here to see all Videos.


FP11_PROXSRCH - Grid - Using a Proximity Search Control to Search for Records within a Specified Radius of an Address, or Partial Address. (Feature Pack)

M50 - Grid/Dialog - Action Javascript - Message Box Action - Advanced Options (Subscriber Benefit)
D46 - Dialog - Geocoding Data when Records are Saved  (Subscriber Benefit)
D47 - Dialog -  Server Side Events For CRUD Operations (Subscriber Benefit)
D48 - Dialog - Using the 'Prevent Container Float' Property on a Free-form Container To Center or Right Justify Text
D49  - Dialog - Displaying a Fade Out Message to Confirm that Record was Saved (Subscriber Benefit)

M51 - Grid - Display a Fade Out Message to Confirm that Record was Saved (Subscriber Benefit)

D50  - Dialog - Adding a Row to a Repeating Section Programmatically By First Prompting for Data in a Pop-up Window
D51 - Dialog - Prompting for Confirmation Before Submitting a Dialog

D52 - Dialog - Dynamically Re-populating Choices in a Radiobutton or Checkbox Control.

D53 - Dialog - Dynamically Re-populating Choices in a Dropdownbox Control

D54 - Dialog - Preventing an Event From Firing Twice when a User Double-clicks on a Hyperlink or Button. (Same technique can be used in a Grid)

D55 - Dialog - Using jQuery to make a Div draggable.

D56 - Dialog - Defining Javascript Action - Using Action Javascript Genies to Define Global Javascript Code (Subscriber Benefit)

D57 - Dialog - Tutorial on how to write your own Xbasic and Javascript to populate a Dialog with data.

R3 - Reports - Printing the Same Report in Multiple Languages

FP11_DLGMAP1 - FP11_DLGMAP7 - Placing a Map Control on a Dialog Component (Feature Pack)

APP1 - Contact Manager Application Template - When you create a new project at the Web Control Panel you can now create a pre-built application using an Application Template.
 

 

Features

 

Documentation Viewer - A new documentation viewer has been built into Alpha Five. The documentation viewer uses a local copy of the documentation, so you do not need to be connected to the Internet to use the Alpha Five documentation.

New buttons on the Control Panel and Web Control Panel make it easy to open the documentation viewer.

Key features of the Documentation Viewer include:

 

 

 

The following videos demonstrate the features of the documentation viewer:

 

Watch video - part 1

Watch video - part 2

Watch video - part 3

Watch video - part 4

 

Note about images in the documentation.  When you first view a particular topic in the Documentation Viewer, the images in the topic are displayed from the Alpha Wiki website. This means that in order to see the images you would need to have an internet connection. However, as the images are retrieved from the wiki, they are cached locally so that the next time you visit that particular topic, the images will be read from the local cache. That means that if you are viewing the documentation and you do not have an internet connection, topics that were previously viewed when a connection was available will show images, but if you have not previously viewed the topic, the images will not be visible.

 

Dialog Component - Data Binding - SQL Tables - Repeating Sections - Order and Filter - In the Data Binding definition, you could specify a property for the Order expression, but it was not honored. Now, this is working. In addition, you can now also specify a Filter property. This is the filter that applies to the records shown in the Repeating Section. For example, if you specify a filter of:

quantity > 10

only the order items with quantity > 10 will be shown in the 'OrderItems' Repeating Section.

 

Web Applications - Login Component - Added support for HTML5 input types.

 

Dialog and Grid Component - Cascading DropdownBoxes - Previously, the parent dropdownbox for a cascading dropdownbox had to be populated from the same table as the cascading dropdownbox. The parent dropdownbox could not be populated with a static list, for example.

Now, the parent dropdownbox can be populated from a static list, or a query from a different table. To support this option, two new properties have been added to the builder where you define dropdownbox choices.

These properties are:

  For example, say your component has two dropdownboxes: DDB1 and DDB2. The choices in DDB1 are set to a static list:

A

B

C

D

The choices for DDB2 are dynamic. The SQL for the choices is: SELECT DISTINCT PART FROM INVENTORY.

DDB2 is defined as a cascading dropdownbox and its parent is set to DDB1.

By specify (say) PARTCODE as the value for the 'Field in query linked to parent control' property, the actual SQL used to populate the dropdownbox will be:

SELECT DISTINCT PART FROM INVENTORY WHERE PARTCODE = '<value of DDB1>'

 

 

 

Working with Excel - Office::Spreadsheet Namespace Improvements

 

The following new methods in the Office::Spreadsheet namespace have been enhanced:

 

New overloads to Read(), Write() and WriteFormula() now accept the identifier for a named range instead of row and column indexes.

 


GetNamedRange -  GetNamedRange is a new function.

GetNamedRange as L (Name as C, BYREF FirstRow as N, BYREF LastRow as N, BYREF FirstColumn as N, BYREF LastColumn as N)

Notes:
 

dim wk as office::ExcelDocument
dim s as office::Spreadsheet

s = wk.AddSheet("Test")

s.SetNamedRange("TestRange", 1,1,1,1)
s.Write("TestRange", "Hello World!")
?s.read("TestRange")
= "Hello World!"


s.SetNamedRange("TestRange", 5,6,7,9)

s.Write("TestRange", "Hello World!")
ERROR: Office::ExcelDocument The named range has more than one value. This is not currently supported for reading and writing

?s.read("TestRange")
ERROR: Office::ExcelDocument The named range has more than one value. This is not currently supported for reading and writing

s.SetNamedRange("TestRange", 8,8,9,9)
s.Write("TestRange", "Hello World!")
?s.read("TestRange")
= "Hello World!"

?s.read(8,9)
= "Hello World!"

dim startrow as N
dim endrow as n
dim startcolumn as n
dim endcolumn as n
s.GetNamedRange("TestRange", startrow, endrow, startcolumn, endcolumn)
?startrow
= 8

?endrow
= 8

?startcolumn
= 9

?endcolumn
= 9
 

Reports - Layout Table Reports - Setting Properties on Multiple Cells - You can now select multiple cells in the Layout Table and apply properties to all selected cells at once.

Reports - Charts - Multiple Series - Charts that are based on data in a report can now display multiple data series (each series is based on a column in the report).

Amyuni PDF Driver - Updated to the latest Amyuni PDF Printer Driver - V4.5.2.7. Amyuni states that this version supports Windows 8.

Grid - Non-Sortable Columns - No longer use a <StyleName>Link class for the column heading.

Web Project Properties - A5_application.A5I File - Connection Strings - When you publish a project, the a5_application.a5i file gets created. This file has your connection strings in it. The connection strings are encrypted in this file. A new option on the Design-time Pane of the Web Project Properties dialog allows you to turn encryption off. This can help debug connection issues because it allows you to see exactly what connection string you application is using.

 

a5DialogHelper_GetDataToPopulateDialog() Function - The a5DialogHelper_GetDataToPopulateDialog() Function is a helper, typically used in conjunction with the a5DialogHelper_JS_PopulateDialog() function, to generate the data with which to populate a Dialog component.

 

Watch Video. - See Video D57

 

In most cases, when you are working with Data Bound Dialog components, the code that populates the Dialog with data from tables is automatically generated by Server-side Action Scripting. However, in some cases, developers will want to write their own code to populate a Dialog (including its Repeating Sections).

The a5DialogHelper_GetDataToPopulateDialog() function can be used to create the Xbasic dot variable that contains the data with which you want to populate the Dialog.

The a5DialogHelper_GetDataToPopulateDialog() function takes as its input an array that describes the SQL query to execute for each 'level' of the Dialog. (Each Repeating Section in a Dialog constitutes a Dialog 'level').

Here is an example of an array that defines the queries to perform for a Dialog that has the following data structure:

Customer====>InvoiceHeader=====>InvoiceItems
 

 

This Dialog shows Customer at the top level. It then has a Repeating Section to show all of the InvoiceHeaders for the customer and it has a second Repeating Section to show InvoiceItems for the selected InvoiceHeader.

 

Structure definition array:


dim sections[3] as p
sections[1].alias = "customer"
sections[1].sql = "select * from customer"
sections[1].filter = "customer_id = 2"
sections[1].connectionString = "::name::mysql_alphasports"
sections[1].portableSQL = .t.
sections[1].argumentsXML = ""
'map fields in query to control on dialog
'format is field=variable
sections[1].fieldToVariableMap = <<%txt%
ship_address_1=shippingAddress
%txt%
sections[1].displayFormatMap = ""

sections[2].alias = "invoiceHeader"
sections[2].repeatingSectionId = "CONTAINER_1"
sections[2].currentRow = 3
sections[2].sql = "select * from invoice_header"
sections[2].connectionString = "::name::mysql_alphasports"
sections[2].portableSQL = .t.
sections[2].parentAlias = "customer"
sections[2].parentLinkFields = "customer_id"
sections[2].childLinkFields = "customer_id"
sections[2].order = ""
sections[2].filter = ""
sections[2].argumentsXML = ""

'map fields in query to control on dialog
'format is field=variable
sections[2].fieldToVariableMap = <<%txt%
SALES_REP=SalesRepresentative
DELIVERY_BY=DeliveryMethod
customer_id=custId2
%txt%
sections[2].displayFormatMap = ""

sections[3].alias = "invoiceItems"
sections[3].repeatingSectionId = "CONTAINER_2"
sections[3].currentRow = 1
sections[3].sql = "select * from invoice_items"
sections[3].connectionString = "::name::mysql_alphasports"
sections[3].portableSQL = .t.
sections[3].parentAlias = "invoiceHeader"
sections[3].parentLinkFields = "invoice_number"
sections[3].childLinkFields = "invoice_number"
sections[3].order = "quantity desc"
sections[3].filter = "quantity > :whatquantity"
sections[3].argumentsXML = <<%xml%
<SQLArguments>
    <SQLArgument>
        <Name>whatquantity</Name>
        <Data Type="N">1</Data>
        <IsNull Type="L">0</IsNull>
        <Usage>Input</Usage>
    </SQLArgument>
</SQLArguments>
%xml%

'map fields in query to control on dialog
'format is field=variable
sections[3].fieldToVariableMap = <<%txt%
Invoice_Number=InvNum2
%txt%
sections[3].displayFormatMap = <<%txt%
price=alltrim(str( convert_type(<value>,"N") ,250,2,"$("))
%txt%
 

 

The properties of the above array are, for the most part, pretty easy to figure out. There are some properties that are worth discussing in more detail.

The array has 3 entries because the Dialog to be populated has 3 levels (top level, and 2 Repeating Sections). Note that it is irrelevant if the Repeating Sections have a parent-child relationship, or are siblings. In this example, the two Repeating Sections have parent-child relationship.

Each section defines a connection string, a SQL query, a filter and an order. The filter can use arguments (for example, in section[2], we defined quantity > :whatQuantity). If the filter uses arguments, the argument value is defined in the argumentsXML property.

Each section also defines an alias, parentAlias, parentLinkFields and childLinkFields. The properties define how the section is related to other sections in the array. For example the sections[2] is linked to the 'InvoiceHeader' alias (section[1]).

Since the field names in the SQL tables you are querying do not necessarily have the same names as the controls on the Dialog, the 'fieldToVariableMap' property is used to map fields in the SQL table to controls in the Dialog. You only need entries in this property if a field is mapped to a control of a different name.

For example for sections[2]. the fieldToVariableMap property is defined as follows:

SALES_REP=SalesRepresentative
DELIVERY_BY=DeliveryMethod
customer_id=custId2
 

This indicates that the SQL table we are querying will have fields called 'SALES_REP', 'DELIVERY_BY' and 'customer_id', but that the corresponding controls on the Dialog are called 'SalesRepresentative', 'DeliveryMethod' and 'custId2'.

The next property that bears discussion is the displayFormatMap property. This property is a CRLF delimited list of values indicating server-side formatting to apply to any fields in the query. For example, for sections[3], this property has been defined as:

price=alltrim(str( convert_type(<value>,"N") ,250,2,"$("))
 

This indicates that the server-side display format expression for the Price field in the query is:

alltrim(str( convert_type(<value>,"N") ,250,2,"$("))
 

The last property worth discussing is the 'currentRow' property. This is only relevant when there is a parent-child relationship between Repeating Sections (as there is in this case because the InvoiceHeader Repeating Section is the parent of the InvoiceItems Repeating Section). This property indicates which 'row' the Parent Repeating section has 'focus'.

So, for example, say that for a give Customer, the InvoiceHeader Repeating Section had these InvoiceNumbers:

InvoiceNumber

3

25

45

78

 

If sections[2].currentRow = 3, the query would return the InvoiceItems for InvoiceNumber 45 (3rd row in the Repeating Section).
 

Once you have defined the sections[] array, you can call the a5DialogHelper_GetDataToPopulateDialog() to generate the Xbasic dot variable that contains the data with which you want to populate the Dialog.

 

For example:

   

Dim pr as p

pr = a5DialogHelper_GetDataToPopulateDialog(sections)

 

 

The return value (pr in this case) will have 4 properties:

 

?pr.hasError

= .F.

?pr.errorText

= ""

?pr.xbasic

= p.CUSTOMER_ID="2"
p.FIRSTNAME="Sally"
p.LASTNAME="Peabody"
p.COMPANY=""
p.PHONE="(617) 555-0089"
p.FAX=""
p.BILL_ADDRESS_1="152 Court St"
p.BILL_ADDRESS_2=""

dim p.CONTAINER_1[0] as p
dim nextIndx as n
nextIndx = p.CONTAINER_1.append()
p.CONTAINER_1[nextIndx].INVOICE_NUMBER="18"
p.CONTAINER_1[nextIndx].custId2="2"
p.CONTAINER_1[nextIndx].DATE="01/18/2007"
p.CONTAINER_1[nextIndx].SalesRepresentative="Sailor"
p.CONTAINER_1[nextIndx].DeliveryMethod="Bulk Rate Post"
p.CONTAINER_1[nextIndx].PAY_METHOD="Visa"
 

dim nextIndx as n
nextIndx = p.CONTAINER_1.append()
p.CONTAINER_1[nextIndx].INVOICE_NUMBER="78"
p.CONTAINER_1[nextIndx].custId2="2"
p.CONTAINER_1[nextIndx].DATE="02/28/2012"
p.CONTAINER_1[nextIndx].SalesRepresentative=""
p.CONTAINER_1[nextIndx].DeliveryMethod=""
p.CONTAINER_1[nextIndx].PAY_METHOD=""
 

 

?pr.javascriptSetActiveRow =

{dialog.object}.setRepeatingSectionActiveRow('CONTAINER_1',3);
 

 

Once you have the 'pr' variable, you can call a5DialogHelper_JS_PopulateDialog(). For example

 

dim pjs as p

pjs = a5DialogHelper_JS_PopulateDialog(pr)

 

And then you can construct the complete Javascript response to send to the browser. (As described in the section documenting the a5DialogHelper_JS_PopulateDialog() Function.)

 

a5DialogHelper_JS_PopulateDialog() Function - Generating Javascript to Populate a Dialog - The a5DialogHelper_JS_PopulateDialog() is a helper function of use to users who write their own Xbasic code in a Dialog server-side event hander to populate the controls in a dialog. The function will generate the necessary Javascript to populate the controls in a Dialog. The function takes as its input a dot variable that contains the data with which you want to populate the Dialog. The function can handle Dialogs with multiple Repeating Sections.

Watch Video. - See Video D57

For example, assume you had a dialog with these controls at the top level: 'FIRSTNAME', 'LASTNAME' and 'MARRIED', and these controls in a Repeating Section (which had an id of 'CONTAINER1'):     'ADDRESSTYPE', 'ADDRESS' and 'CITY'.

The structure of the Xbasic dot variable that contains the data with which you want to populate the Dialog is shown below:

 

dim p as p
p.firstname = "fred"
p.lastname = "smith"
p.married = .t.
dim p.container_1[0] as p
p.container_1[].addressType = "work"
p.container_1[..].address = "123 main st"
p.container_1[..].city = "boston"
p.container_1[].addressType = "shipping"
p.container_1[..].address = "123 center st"
p.container_1[..].city = "burlington"
p.container_1[].addressType = "home"
p.container_1[..].address = "123 raleigh st"
p.container_1[..].city = "weston"
 

As you can see, the data for the top level (i.e. controls that are not in a Repeating Section) are contained in properties of the dot variable (e.g. p.firstname, p.lastname, etc.)

The data for the control that are in Repeating Sections are contained in arrays with the same name as the Repeating Section id. The number of entries in each array corresponds to the number of rows of data in the Repeating Section.

NOTE: A second helper function, a5DialogHelper_GetDataToPopulateDialog(), can be used to query SQL tables and generate the dot variable that contains the data.

When you call the a5DialogHelper_JS_PopulateDialog() method, you pass in the pointer to the dot variable that contains the data. The function return a dot variable with two properties:

 

For example:

pr = a5DialogHelper_JS_PopulateDialog(p)

?pr.populateControls
= _d['FIRSTNAME'] = 'fred';
_d['LASTNAME'] = 'smith';
_d['MARRIED'] = true;

_d['ADDRESSTYPE:1'] = 'work';
_d['ADDRESS:1'] = '123 main st';
_d['CITY:1'] = 'boston';

_d['ADDRESSTYPE:2'] = 'shipping';
_d['ADDRESS:2'] = '123 center st';
_d['CITY:2'] = 'burlington';

_d['ADDRESSTYPE:3'] = 'home';
_d['ADDRESS:3'] = '123 raleigh st';
_d['CITY:3'] = 'weston';

?pr.setRepeatingSections
= {dialog.object}._setRepeatingSectionRowCount('CONTAINER_1',3,false);
 

Note that the Javascript code in pr.populateControls and pr.setRepeatingSections does NOT constitute a complete Javascript response. For example, your Xbasic event handler would still need to generate the Javascript to declare the _d Javascript object that was being populated and it would still need to call the Dialog's .populate() method, For example the code below is some sample Xbasic that you might have in a server-side event handler to generate a complete Javascript response to send to the client to populate controls:

 

dim js as c = ""

'emit the Javascript to set the Repeating Section row counts

js = js + pr.setRepeatingSections + crlf()

'emit the Javascript to declare the _d Javascript object

js = js + "var _d = {};"

'emit the Javascript to define the _d Javascript object

js = js + pr.populateControls + crlf()

js = js + "{dialog.object}.populate(_d);"

 

 

 

Web Applications - Application Templates - Contact Manager - When you create a new Project by clicking the New Project button on the Web Control Panel a new dialog appears allowing you to either create an empty new project, or create a project from a template. At this point, only a single template is available.

Video - Tour of the Contact Manager Template

Video - How to Create a new Application from a Template

 

a5_mergeDataIntoTemplate() Function - This function, which merges data from a .dbf table, sql table or xbasic array into a template, takes an optional dot variable called 'mergeResult' as one of its input parameters. If the mergeResult variable is passed in then the following variable will be set when the function has completed

mergeResult.rows

This is the count of the number of records that were merged into the template.

 

Code Editor - Home Key - The behavior of the 'Home' key has been changed. Previously, the 'Home' key moved to character position 1 on the line. Now, the first time you press home, it moves to the position of the first character on the line (which may not be position 1 if the line has been indented). The second time you press 'Home' the position moves to character position 1.

 

Grid Components - AlphaDAO - Connect Button - A change in behavior has been made when you click the Connect button in the Grid builder. Previously, when you clicked 'Connect' Alpha Five would get a list of tables and views in the connection. Now, this is no longer done. The reason for this change is as follows:

A user had a situation where they were connecting to a remote Oracle database with multiple thousand tables and views. Getting a list of tables and view in the remote Oracle database was extremely slow, and as result, every time they created a new Grid, there would be a long delay while Alpha Five waited for Oracle to respond.

Now, pressing the Connect button will simply connect to the remote database (which will be quick).

Then, when you click the button to select the table or view on which to base the Grid, a query will be performed to get the list of tables and views. However, another change in this dialog has also been made to allow all of the checkboxes (for Tables, Views, Aliases, etc.) to be unchecked. In this case, there will be no pick list to select the table or view, and you can simply type in the name of the table or view on which to base the Grid.

 

 

Web Applications - Calendar Component - WorkShift View - Change in the way the Calendar Component renders WorkShift view - A change in the way the Calendar component renders the 'WorkShift' view has been made, as shown in this image.

 

 

 

 

Image Resizing Functions - Two new functions have been added to Xbasic to resize images. The functions allow you to resize an image by supplying an absolute size or a ratio.

The new function are:

Imaging::FileTransformer::Resize as V( InputFile as C, OutputFile as C,  OutputWidth as N, OutputHeight as N)
Imaging::FileTransformer::ResizeByRatio as V (InputFile as C, OutputFile as C, SizeRatio as N)
 

 
Example:

Imaging::FileTransformer::Resize("Myinput.bmp", "MyOutput.bmp", 1024, 800)

 

Xbasic - .Net Framework - Advanced Web Service Client Configuration in Alpha Five Version 11

Background

WCF (Windows Communication Foundation) is a technology from Microsoft that is implemented in .NET to make it possible to communicate with SOAP and RESTFUL web services over the internet.

As part of the .NET support provided in Alpha Five version 11, you can create client assemblies automatically by pointing to a URL with the address of a WSDL (Web Service Definition Language) that describes the service in detail.

If you create or install a client assembly, and then register it in the Alpha Five runtime, you can dimension instances of the client class generated into the assembly and call functions as if the functions were local to your application. The client class is referred to as a “proxy” because it acts on behalf of the true function and redirects your local function call to the web service on the same or a remote machine.

Web service clients can be generated by Alpha Five using the DOTNET::Services object using the function GenerateWCFWebServiceClientFromURL() as documented already. Once the client assembly is created and a reference to the assembly is registered in the running Alpha Five process, you can make service calls directly on an instance of the object.

For example, if the class representing the client generated is MYService::MyClient, you can instantiate a connection to the service and make calls using syntax like the following:


Dim Client as MyService::MyClient

Client.CallMyServiceFunction()


If Advanced Configuration is Needed

Commercial services often need to have changes made to the applications configuration file. Generally this is because the size of the data returned or the complexity of the data is greater than normal. This would generally require you to create a file called Alpha5.config and save it into the installation directory (or A5ApplicationServer.config for web applications) and can make it difficult to maintain and deploy your web and desktop applications calling these services.

Another approach, shown here, is to set the values that would be read from the configuration file directly in an XBasic function that creates and returns your client. Please note that where you see “<MyServiceClientClass> and <MyServiceNamespace” below, you want to substitute the actual class name of your web service client and the namespace as they are generated by GenerateWCFWebServiceClientFromURL() or provided by the author of the service as a client assembly.

The functions below create an instance of the client class and set values for the binding that would normally be either defaulted or set in a configuration file. You don’t need to worry too much about the details here. Just be aware that the values that you would have to set in a configuration file have analogs in the binding object.

Note: The values required by your service may be different and you will need to consult the documentation for the web service, or contact the provider for support. The values below should suffice for most purposes.

 


 

Important: Word wrapping on certain lines below is unintentional.


FUNCTION CreateService as <MyServiceClientClass> (DefinitionWebLink as C, EndPointWebLink as C, AssemblyFile as C)
 

dim Result as CallResult = RegisterServiceDLL(DefinitionWebLink, AssemblyFile)
if .not. Result.Success

    error_generate(Result.Code)

end if

 

dim b as system::ServiceModel::BasicHttpBinding

    b.MessageEncoding = System::ServiceModel::WSMessageEncoding::Text

    b.Security.Mode = System::ServiceModel::SecurityMode::Transport

    b.Security.transport.ClientCredentialType =     System::ServiceModel::HttpClientCredentialType::None

    b.Security.Transport.proxyCredentialType =     System::ServiceModel::HttpProxyCredentialType::None

    b.MaxReceivedMessageSize = 20485760

    b.maxBufferSize = 20485760

    b.MaxBufferPoolSize = 10485760

    b.ReaderQuotas.maxDepth = 32

    b.ReaderQuotas.MaxStringContentLength = 10485760

    b.ReaderQuotas.MaxArrayLength = 16384

    b.ReaderQuotas.MaxBytesPerRead = 4096

    b.ReaderQuotas.maxNameTableCharCount = 16384

    b.Security.Transport.Realm = ""

    b.Security.Message.ClientCredentialType =     System::ServiceModel::BasicHttpMessageCredentialType::UserName

    b.Security.Message.AlgorithmSuite = System::ServiceModel::Security::SecurityAlgorithmSuite::Default

 

dim e as system::ServiceModel::EndPointAddress = new System::ServiceModel::EndPointAddress(EndPointWebLink)

 

dim MyService as <MyAssemblyNameSpace>::<MyServiceClientClass> = new <MyServiceClientClass>(b, e)

 

SetSvcGraphObjectQuota(MyService)

CreateService = MyService

 

END FUNCTION

 

 


FUNCTION RegisterServiceDLL as CallResult (DefinitionWebLink as C, AssemblyFile as C)

dim Result as CallResult
on error goto errorRegisterServiceDLL

dim sv as dotnet::Services
dim Assembly as dotnet::AssemblyReference

Assembly.FileName = AssemblyFile

if .not. File.Exists(AssemblyFile)
    if .not. sv.GenerateWCFWebServiceClientFromURL(DefinitionWebLink, AssemblyFile)
        Result = sv.CallResult
    end if
end if

if Result.Success
    if .not. sv.RegisterAssembly(“<MyAssemblyNamespace>”, Assembly)
        Result = sv.CallResult
    end if
end if

goto doneRegisterServiceDLL

errorRegisterServiceDLL:
on error goto 0

Result.Code = error_code_get()

doneRegisterServiceDLL:
on error goto 0

RegisterServiceDLL = Result

END FUNCTION
 


FUNCTION SetSvcGraphObjectQuota as CallResult (Service as P)

dim Result as CallResult
on error goto errorQuota

Operations = Service.Endpoint.Contract.Operations

for i = 1 to Operations.Count
    Operation = Operations[i]
    Behaviors = Operation.Behaviors
   
    Enumerator = Behaviors.GetEnumerator()
    while Enumerator.MoveNext()
        Current = Enumerator.Current
        if Current.gettype().FullName =         "System.ServiceModel.Description.DataContractSerializerOperationBehavior"
            Current.MaxItemsInObjectGraph = 2147483647
        end if
    end while
next
 

goto doneQuota
errorQuota:
Result.Code = error_code_get()
doneQuota:
SetSvcGraphObjectQuota = Result
END FUNCTION

 

Grid and Dialog Component - Action Javascript - Open a Grid or Dialog in a Window Action - When you use Action Javascript to open a child Grid or Dialog component in a window, the builder now presents a new option:

Warn before closing if Grid/Dialog in window is dirty

If you check this option, then the user will be prevented from closing the pop-up window in which the child Grid or Dialog has been opened if the child Grid or Dialog is dirty.

 

Grid Component - {grid.object}.isDirty() Method - A new method of the Grid object tells you if the Grid is dirty. If the Grid contains a Detail View, then the method checks if the Detail View is dirty, otherwise, it checks if any row in the Grid part is dirty.

Dialog Component - Customization - New options have been added to the customization section of the Dialog to allow you to set the text of the dirty dialog warning message that now appears when you try to close a dirty Dialog, if that Dialog has been opened in a pop-up Ajax window.

 

ui_dlg_refresh_targeted() and ui_modeless_dlg_close() Functions - Xdialog - Now return a logical result if the function succeeded. Previously if the target dialog did not exists, an error would be shown. This meant that the Xbasic code would first need to use the ui_modeless_dlg_exist() function to test if the dialog was there before calling ui_dlg_refresh_targeted() or ui_modeless_dlg_close(). Now, you can just call these functions and if the dialog does not exists, they will return .f.

 

Dialog Component - New Method to Populate a Dropdownbox on using Javascript - A new method has been added to populate a dropdownbox using Javascript.

{dialog.Object}.populateDropdownBox(columnName,data,clearExistingData)

The method is just a wrapper on the existing A5.form.populateSelect() function.



<table>.flush_indexes() Method - Causes Alpha Five to reload index key values for DBF tables.

This method would only be needed in the following condition:

  1. Two or more Alpha Five instances are running (e.g. user1, user2)
  2. Both users have a form based on the same table open.
  3. User2 makes a change that causes an index update.
  4. User1 executes some Xbasic (such as a db_count(), or lookupc()) which relies on an index. Since user1 has cached the index keys, he will not see user2's changes unless he first re-reads the index.
     

The following Xbasic will allow user1 to get the updated index keys before calling db_count(), lookupc(), etc.
 

dim tbl as p
tbl = topparent.table_get()
tbl.flush_indexes()

 

Note: In most cases the .flush_indexes() method is not needed. For example, if user1 were to edit the same record that user2 just edited, the index would be automatically refreshed before updates were made to it. It is ONLY in the case where you are using a function that relies on an index that refreshing indexes would be required.
In addition, if user1 makes an edit to ANY record in the table, the index is automatically refreshed and the .flush_indexes() method would then NOT be needed.

 

 

Reports - Dynamic Labels - Text Equation Genie - A new genie makes it easier to use the Dynamic Text feature in Reports. For example, say you have a report and depending on a user's language preference, you want different static text for column headings and the report heading.

This is easily done using the Dynamic Text feature (which has been a feature of Alpha Five for some time now).

However, defining the dynamic text expression is now much easier because a new 'Text Equation Genie' allows you to create Dynamic Text expressions more easily.

To specify Dynamic Text you use the Properties pane in the Task List and you expand the property for 'Text' to expose the 'Dynamic' property. When you click on the smart field, the new builder (shown below) is opened.

 

 

 

 

Here is the new Dynamic Text builder.

In the example shown below, the text for some label is defined for three different conditions:

 

 

 

 

Windows 8 - Previously, when trying to run Alpha Five on Windows 8, a message saying that Alpha Five was not licensed for this operating system was displayed. This restriction has been removed.

Quick Report Builder - Enhancements - Multiple improvements that mean in many cases you will be able to get the report looking exactly like you want without having to switch from the Quick Report Builder to the full Report Editor. Individual enhancements are listed below.

 

Quick Report Builder - Group Header - Header Text - Group header is now an expression which allows you to insert any text in the group header. For example, if the reports is grouped on 'StateName', previously the group headers would have shown:

 

CA

NY

MA

etc.

 

Now you can write an arbitrary expression that generates the heading that you want. For example:

State name: CA

Quick Report Builder - Group Header - 'Keep together on page' Property - Added a property that allows you to prevent groups from being split across multiple pages.

Quick Report Builder - Group Header - Padding - Can now specify the amount of padding to use above and below the group heading.

Quick Report Builder - Report Titles - Added a new property for the Report Title. Report Titles support multiple properties in addition to the title text. For example, you can specify an image to display in the title. You control the image placement. You can define a free-form text block to place in the title section (useful for address blocks, etc.). All of the title settings (called the 'letterhead') can be saved for easy reuse.

Quick Report Builder - Detail Section Spacing - A new property ('Detail spacing') allows you to control how tightly line in the detail section are spaced. The default value for this property is 100. If you set the property to a value above 100 the spacing is looser than the default spacing and less than 100 makes the spacing tighter than the default spacing.

Quick Report Builder - Report Styles - Free-form Reports - Are now applied to free-form reports. (The Quick Report Genie allows both Table Layout and Free-form reports to be created). Previously, system report styles were only applied to reports if the Table Layout option in the Quick Report Builder had been checked.

Quick Report Builder - Free-form Reports - Alignment and Formatting Properties -  Now honor setting for alignment and formatting (e.g. currency formatting). Previously, these options were only supported if using the Layout Table option.

Quick Report Genie - Calculated Fields - You can now define calculated fields in the Quick Report Genie. There is a new tab in the Genie for calculated fields. Any calculated fields defined in this tab are  now available in the field list to include in the report. Previously, you needed to switch from the Quick Report Builder to the full Report Editor when you wanted to use calculated fields.

Quick Report Genie - Default Font Settings - The Quick Report Genie now honors the default font settings that were specified in the View, Settings, System, Style, Report section.

Quick Report Genie - Report Settings Tab Pane - The settings on the Report Settings Tab Pane in the builder can now all be saved so that future Quick Reports will use these settings as a defaults.

Quick Report Genie - Report Styles - 'Classic' Style - The 'classic' style is intended for user who want to create Free-form reports that are styled similarly to reports created by the Report Genie in V10.

Report Editor - Layout Table Reports - Conditionally Displaying Table Rows - The Report Editor makes it easy to conditionally display rows in the Layout Table. This is done in the Properties sheet by setting an expression for the 'Row condition'.

 

 

If the report section in which the row appears has multiple rows, when you click the smart field to edit the 'Row condition' a builder appears that allows you to easily set conditions on all rows in the report section as once. For example, in the image below, the 'Detail' section has three rows. Therefore, the builder allows you to define conditional expression for each of the three rows. In this image, the second row of the table would be suppressed is the company field was blank.

 

 

json_generate() Function - Generates a string in JSON format from an Xbasic dot variable. This function should be used in place of varToJSON() which will be deprecated. The json_generate() function is identical to varToJSON() in all respects, except that the attribute name and string values are quoted using double quotes in accordance with the official JSON specification.

json_parse() Function - Parses a string in JSON format and returns an Xbasic dot variable. This function is simply a wrapper on the INET::JSONParser.parse() method. However, unlike the low level INET::JSONParser.parse() method, the json_parse() function can also be used to parse strings that are in Javascript array format. (INET::JSONParser.parse() can only be used for strings that are in JSON format.) For example:

 

p=json_parse("[1,2,3]")
?p
= [1] = 1
[2] = 2
[3] = 3
 

p2 = json_parse("[{name: 'Fred Smith', age: 23 },{name: 'John Jones', age: 45}]")
?p2[1]
= age = 23
name = "Fred Smith"
?p2[2]
= age = 45
name = "John Jones"
 

 

The json_parse() function  can interpret Javascript Date() functions in the JSON string. This allows you to parse JSON strings generated by the json_generate() function, if the json_generate() function generated a JSON string that uses the Date() function.


The following example shows a 'round trip' using json_parse() and json_generate() to show how data and time values are preserved.


dim p as p
p.name = "Karen"
p.dob = date()
p.time = now()

?json_generate(p)
{
"name": "Karen",
"dob": Date('06/02/2012'),
"time": Date('06/02/2012 10:17:11 32 pm')
}

dim jsonTxt as c
jsonTxt = json_generate(p)
dim p2 as p
p2 = json_parse(jsonTxt)
?p2

= dob = {06/02/2012}
name = "Karen"
time = 06/02/2012 10:17:11 32 pm

 

 

 

 

{dialog.object}/{grid.object}.getSessionVariable() Method - Gets the value of any session variable that was explicitly 'published' to the broswer. Both the Grid and Dialog component have a property that allows you to specify which session variables should be 'published' so that their value can be read on the client-side.

 

Grid Component  - Search Rules when Grid Supports Multiple Search Methods - When a Grid allows multiple search methods (e.g. Search Part, Quick Search, Alphabet Buttons, etc.), you can now specify rules to govern how the search criteria from each search part should be applied. A search rules property is available when defining different search properties.

 

 

 

Xbasic Language - You can now use Javascript style array and object syntax to set the value of Xbasic variables and to DIM Xbasic variables. The following Interactive Window session demonstrates this capability:


'set the value of variable to an array of numeric values
ar = [ 1 , 2 ]
? ar
= [1] = 1
[2] = 2

 

'in this next example we dim an array and populate it in a single command.

'in this example the array is a vector (single dimensional array)

dim MyVector[5] as N = [ 5,4,3,2,1]
 

'we can also dim and populate multi-dimensional arrays from a list of list
dim MyArray[3,2] as N = [ [6,5], [4,3], [2,1] ]

'Note that the following is the same as the previous command:
dim MyArray[3,2] as N = [ 6, 5, 4, 3, 2, 1 ]

 

The reason that the above two dim statements are the same is that data in Alpha Five arrays is stored in what is called 'row-major' form, the values in the vector match the values in the nested array.
 


'set the value of a variable to an array of character values
arrc = [ "one" , "two" , "three" ]
? arrc[1]
= "one"
? arrc[2]
= "two"
? arrc[3]
= "three"



'set the value of a variable to an array of properties
arrp = [ { "firstname" : "john" , "lastname" : "smith" } , { "firstname" : "john" , "lastname" : "public" }  ]
? arrp[1]
= firstname = "john"
lastname = "smith"
? arrp[2]
= firstname = "john"
lastname = "public"

 

'set the value of a dot variable
name = { "firstname" : "john" , "lastname" : "smith" }
? name
= firstname = "john"
lastname = "smith"


'dim a property array and initialize the array
dim arrx[2] as p = [ { "firstname" : "john" , "lastname" : "smith" } , { "firstname" : "john" , "lastname" : "public" }  ]
? arrx[1]
= firstname = "john"
lastname = "smith"
? arrx[2]
= firstname = "john"
lastname = "public"


'dim a character array and initialize the array
dim arrc[3] as c = [ "one" , "two" , "three" ]
? arrc
= [1] = "one"
[2] = "two"
[3] = "three"

'dim a dot variable and initialize the variables
dim fullname as p = { "firstname" : "john" , "lastname" : "smith" }
? fullname
= firstname = "john"
lastname = "smith"
 

 

Xbasic - DIM Statement - Can now dim arrays of classes. For example:

 

dim myConnections[4] as sql::connection

myConnection[1].open("::name::myconnectionString")

 

 

Xbasic Arrays - .Net Framework -  As a result of the change to Xbasic that now allows arrays of classes, the following use case, which is common when working with the .Net framework is now possible:

Declaring arrays of .NET objects.
 

dim MyStringArray[3] as System::Text::StringBuilder

MyStringArray[1].Append("Hello")

MyStringArray[2].Append("Goodbye")

MyStringArray[3].Append("Test")


Notes:

  1.  XBasic arrays are automatically converted to .NET arrays when they are passed to a .NET function or assigned as a property. As a result, an XBasic array can be assigned directly to a .NET property that accepts a .NET array.
  2. .NET arrays are objects and are deliberately NOT converted to XBasic arrays when received as the result of a .NET function or read as a property.

     

 

SQL::Connection.ToFormattedString() and SQL::ResultSet.ToFormattedString() - The SQL::Connection and SQL::ResultSet objects now have a new method.

In addition to the other arguments of the .ToString() method, the .ToFormattedString() method takes a parameter of type SQL::RowFormattingOptions that encapsulates ColumnDelimiter, RowTerminator, DisplayFormat, and two new arguments ColumnDelimiterEscape and RowTerminatorEscape.

The purpose of this function is to allow escaping of values within the formatted string so that columns that contain either the column delimiter or the row terminator can be properly and flexibly escaped.


Example Interactive Window Session
 

dim cn as sql::Connection
?cn.open("::Name::Access_Northwind")

dim fo as sql::RowFormattingOptions
fo.ColumnSeparator = "|"
fo.RowTerminator = "-"
fo.ColumnSeparatorEscape = "<pipe>"
fo.RowTerminatorEscape = "<dash>"

SQL = "select first 3 Concatenate('abcde',:pipe, 'fghik'), Concatenate('lmnop', :dash, 'q') from customers"
cn.portableSQLEnabled = .t.

dim args as sql::arguments
args.add("pipe", "|")
args.add("dash", "-")


?cn.ToFormattedString(SQL, args)
= abcde|fghik lmnop-q
abcde|fghik lmnop-q
abcde|fghik lmnop-q

?cn.ToFormattedString(SQL, args, fo)
= "abcde<pipe>fghik|lmnop<dash>q-abcde<pipe>fghik|lmnop<dash>q-abcde<pipe>fghik|lmnop<dash>q"

?cn.execute(SQL, args)
?cn.ResultSet.ToFormattedString()
= abcde|fghik lmnop-q
abcde|fghik lmnop-q
abcde|fghik lmnop-q


?cn.execute(SQL, args)
?cn.ResultSet.ToFormattedString(fo)
= "abcde<pipe>fghik|lmnop<dash>q-abcde<pipe>fghik|lmnop<dash>q-abcde<pipe>fghik|lmnop<dash>q"
 

 

Xbasic JSON Parser - Xbasic can now parse strings that are formatted as JSON objects.

A new method called INET::JSONParser::Parse(c text) has been defined.

In addition, an Xbasic function called json_parse() has been created. json_parse() just wraps INET::JSONParser::Parse(), but is easier to write).

The following Interactive window examples show how:

 

dim text as c

'define a simple JSON object string
text = <<%txt%

{"name": "John Smith", "married" : true, "age": 35 }

%txt%
dim p as p
p = json_parse(text)

 

'could also write:  p = INET::JSONParser::parse(text)


?p.name
= "John Smith"

?p.married
= .T.

?p.age
= 35

 

'define a more complex JSON object string
dim text2 as c
text2 = <<%txt%

{"obj" : [{"name" :  "Harry Jones", "city" : "Lexington" },{"name" : "Kurt Kantor"} ]}

%txt%
dim p2 as p
p2 = json_parse(Text2)

?p2.obj[1].name
= "Harry Jones"
?p2.obj[1].city
= "Lexington"

?p2.obj[2].name
= "Kurt Kantor"

?p2.obj[2].city
ERROR: Property not found
p2.obj[] subelement not found.
 

 

'Now convert the Xbasic variable back to a JSON string:

?json_generate(p2)
= {
"obj" : [
        {
            "name" : "Harry Jones",
            "city" : "Lexington"
        },
        {
            "name" : "Kurt Kantor"
        }
    ]
}
 

 

 

 

*rational() Function - Represents a fractional number as the closes ratio that can be found.

 

n = 1/3
? n
= 0.333333333333333
? *rational(n)
= "1/3"
 

*fraction() Function - Creates a text string for a number that displays the fractional portion of the number as a ratio.

 

? *fraction(33 + 1/3)
= "33 1/3"
? *fraction(100)
= "100"
? *fraction(1.2)
= "1 1/5"
? *fraction(-1.4)
= "-1 2/5"
? *fraction(1.5)
= "1 1/2"
? *fraction(1.3)
= "1 3/10"
? *fraction(1.4)
= "1 2/5"
? *fraction(1.6)
= "1 3/5"
? *fraction(1.7)
= "1 7/10"
? *fraction(1.8)
= "1 4/5"
? *fraction(1.9)
= "1 9/10"
? *fraction(1.25)
= "1 1/4"
? *fraction(1.03)
= "1 3/100"

 

Dialog Component - {dialog.object}.newRecord() Method - Now automatically gives focus to first row in each repeating section.

 

Grid and Dialog Component - Textbox Controls - HTML5 'type' Attributes for Textbox Controls - When creating a textbox control in a Grid or dialog, you can now specify the following HTML5 attribute values for the 'type' attribute:

 

 


 

 

AlphaDAO - SQL::ResultSet::ToJSONObjectSyntax() - Column names in SQL::ResultSet::ToJSONObjectSyntax() are now double quoted.

  
dim cn as sql::Connection
cn.open("::Name::Access_Northwind")
= .T.
 
?cn.tojsonobjectsyntax("select CustomerID, CompanyName from customers")
= {"CustomerID" : 'ALFKI', "CompanyName" : 'Alfreds Futterkistes'}
{"CustomerID" : 'ANATR', "CompanyName" : 'anna'}
 

 

Exif Info Object - A new object has been added to Xbasic to enable reading and writing of exif information in image files.

 

Here is an example that will add exif data to an image file:


dim ex as helper::ExifInfo
ex.gps.Latitude =  "37, 49.94,  0"
ex.gps.Latitude_Ref = "W"
ex.gps.Longitude = "122, 28.78,  0"
ex.gps.Longitude_Ref = "W"
ex.gps.Altitude = "74.728"
ex.gps.Altitude_Ref = "Sea level"
ex.SaveExifData("c:\dev\test.jpg")
 

To read exif data, call the <ExifObject>.LoadExifData() method, passing in the name of the image file.

To see all of the properties of the exif object, execute this code in the Interactive window:

 

dim ex as helper::ExifInfo
ex.LoadExifData()
?properties_enum(ex)

 

{dialog.object}.getParentObject() method - A new method has been added to the Dialog Component Object, and the Grid Object's .getParentObject() method has been enhanced.

Now, the method will return the parent object which can either be a Grid or a Dialog.

So, for example, if a Dialog is opened by a Grid, then {dialog.object}.getParentObject() will return the parent Grid object.
If a Grid is opened by a Dialog, then {grid.object}.getParentObject() will return the parent Dialog object, and so on.

 

If the following example a Dialog's parent object is obtained, and a test if performed to see if the parent object is a Dialog or an Grid:

var po = {dialog.object}.getParentObject();

var parentType = '';

if(typeof po.gridId != 'undefined') parentType = 'grid';

if(typeof po.dialogId != 'undefined') parentType = 'dialog';

alert('Parent object type: ' + parentType;


 

 

Dialog Component - Record Navigators - List View and Sliders - Additional Columns to Describe the Primary Key - When you define an action to populate the Dialog with a list of the primary keys for a data bound Dialog, you can specify additional columns to 'describe' the primary key. For example, in the image below, the list view control is showing the Name, City and State fields for each primary key value.

Now, if you edit the value in any of these 'descriptor' fields, the corresponding entry in the List View (and the comment show in the slider) are automatically updated. You no longer need to execute a command to refresh the key list.

Important Note: This feature is only available for Dialogs that are bound to SQL tables.

 

Watch video to demonstrate feature

 

 

Xbasic Code Editors - Editing Scripts and Functions that use Local UDFs - If you are are editing code in which local UDFs are defined, then you can now double click on the local UDF to quickly navigate to the section in the code where the local UDF is defined.

 

UI_Bitmap_Exits() Function - A new function has been added to validate images:


? ui_bitmap_exists("$$application.alpha")
= .T.

? ui_bitmap_exists("not_exist")
= .F.

 


Web Applications - Publishing – Publish Selected Only - Currently, when you publish a file, Alpha Five will also publish all related files. So, for example, if you publish a Tabbed UI component, all of the components called by the Tabbed UI will also be published, if they have not been previously published.

Now, a new option in the Publish dialog allows you to specify that you only want to publish the file and not any of the dependent files.

The default settings for this option can be set when you define the publishing Profile.

 

ImageMagik - Convert.exe - An updated version of the ImageMagik convert.exe utility is now included with Alpha Five.

Alpha DAO - ADO.Net Connection strings - A new connection option is available to connect to SQL databases. The connection string dialog now shows an option for 'ADONET'. When you select this option, the following connection string builder dialog is shown.

 

 

 

 

Code Menu - Convert Library into File System Dictionary - If you use the Code, Convert library into file system dictionary command to convert to use a file system dictionary for your code, if you specify a base path that is in the same folder as the .alb file, a relative path is used. This allows you to easily move the files using a file copy operation.

 

Web Applications - Security - a5ws_Get_User_Assignments() Function - The function 'a5ws_Get_User_Assignments()' will accept either the 'ulink' or 'UserId' values to find the user assignments. The function previously checked if the value supplied to the function matched a 'ulink' value and if no match was found, it then checked if it matched a 'userId'. If two or more records had the same 'ulink' value, the function found multiple matches and returned no values. In V11, the 'UserId' value is preferred over the use of 'ulink', and the function now checks for a match to a 'UserId' value first. The 'UserId' value must be unique, so if any value 'UserId' value is supplied, the assignments will be found.

 

 

Xdialog - Property Grid - Dynamically Filtering the Categories Shown in a Property Grid - You can now dynamically filter the categories shown in a property Grid. For example, in the image below, the Property Grid has three categories. A selector has been added below the Property Grid to select the categories that are shown.

 

 

dim prop.def as c
dim prop.object as p
dim show_font as l = .t.
dim show_fill as l = .t.
dim show_border as l = .t.
prop.def = <<%str%
^^Font
state=opened
++name
var=font.name
++size
var=font.size
^^Fill
state=opened
++style
var=fill.style
++color
var=fill.color
^^Border
state=opened
++style
var=border.style
++color
var=border.color
%str%

dim dlg_body as c
dlg_body = <<%dlg%
{region}
{propgrid=100,30prop};
{endregion};
{line=1,0};
Select the categories you want to show:;
{endregion};
(show_font!catchange) Font
(show_fill!catchange) Fill
(show_border!catchange) Border;
{line=1};
{justify=right}<*&OK!ok> <&Cancel>;
%dlg%
dim dlg_title as c = "Show Categories Function"

ui_dlg_box(dlg_title,dlg_body,<<%code%
if a_dlg_button = "catchange" then
    a_dlg_button = ""
    dim cats as c = ""
    if show_font then
        cats = "Font"
    end if
    if show_fill then
        cats = alltrim( cats + crlf() + "Fill" )
    end if
    if show_border then
        cats = alltrim( cats + crlf() + "Border" )
    end if
    prop.object.ShowCategories(cats)
end if
%code%)

 

 

A5.msgBox.show() Javascript Method - The A5.msgBox.show() Javascript method, which is part of the Alpha Five Javascript Library has been enhanced. It now allows you to define an arbitrary array of buttons to appear in the window footer.

In addition to passing in the standard directives of:

o - OK button

oc - OK and Cancel

yn - Yes and No

ync - Yes, No and Cancel buttons

 

You can also pass in an array of objects, as shown in the example below.

The advantage of using the new syntax is that it allows you to easily customize the text that appears on each button.

 

var title = 'Notice';
 

var message = '<div style="height:1in; padding:20pt;">Are you sure you want to submit the form?</div>';
 

var msgOptions = [
        {html: 'Cancel', value: 'cancel'},
        {html: 'Yes', value: 'yes'},{html: 'No', value: 'no'},

        {html: 'Custom Button1', value: 'cb1'},

        {html: 'Custom Button2', value: 'cb2'}


    ];

A5.msgBox.show(title,message,msgOptions,function(button)
{
    if(button == 'cancel') {
    }

    if(button == 'yes') {
        {dialog.object}.submit()
    }

    if(button == 'no') {

    }
 

    if(button == 'cb1') {

        alert('You clicked custom button1');
    }

 

    if(button == 'cb2') {

    }

}
);

 

 

UI_get_text() Function - This function now has new options. You can specify the size of the input box and the maximum number of characters to accept. The function prototype is:

 

function ui_get_text as c ( Title as C, Caption_Text as C , Default_String = "" , Format_String = "", Size = "" , MaxCharacters = "")

 

 

Dialog Component - Repeating Section - Orphan Fields - Orphan fields are fields that were hidden, but not consumed in a free-form container in the Repeating Section. Now, orphan fields are automatically added to a hidden DIV in the Repeating Section. This means that if you check the 'Hide' property on a control, but do not consume that control in a free-form container, it's value can still be read and set.

 

time_to_unixTimeStamp() Function - Converts a time value to a UNIX time stamp - number of seconds since 1-Jan-1970.

unitTimeStamp_to_tome() Function - Converts a UNIX time stamp (number of seconds since 1-Jan-1970) to a time value.

 

Dialog Component - Data Binding - Bind Fields Dialog - This dialog has now been simplified. The dialog now allows you to set the data binding for controls and also specify if a control is updateable or not.

If a control is set to updateable, then it must be bound to a table alias and field.

If a control is set to not updateable, then it can be bound to a table or set to '*unbound'. The reason you would want to bind a field that is not updateable is so that when you populate the dialog with data from a table, the data in this field is populated.

Application Server - File Upload - Maximum Size - File uploads have been greatly improved so that memory used by the server is significantly less while processing. When a file is uploaded to the server, it is now streamed directly to the server's filesystem instead of read into memory. The file contents will never be directly loaded into memory unless they are explicitly referenced.

To avoid loading the uploaded file(s) into memory, the .Data property should no longer be used. Previously it was common to use save_to_file() or a similar Xbasic function to store the file on the server. There is a new method, SaveToFile(), which should be used as a replacement. This method will save the file contents to the specified filename without having to load the data into the server's memory. The Data property remains available for direct access to the data, such as for storing the file contents in a database instead of on the filesystem.


if eval_valid("cmd")
    'file.from_blob(ServerSetting.Document_Root + "\\" + FileToUpload.filename,     FileToUpload.data) 'OLD SYNTAX, loads file into memory before saving to disk
 

    FileToUpload.SaveToFile(ServerSetting.Document_Root + "\\" + FileToUpload.filename)
    msg = FileToUpload.filename + " was uploaded"
end if
 

There is a new setting on the Advanced tab of the Application Server Settings - Maximum POST body size. This setting is specified in megabytes and limits the amount of data that can be sent to the server in a single POST request. This setting effects the size of a file that may be uploaded to the server. This setting is not the maximum file size itself, but rather the total size of all data being sent, which may include more than one file and/or other form data, depending on the exact application.

The maximum size of any POST request is further limited by the largest available contiguous block of unreserved virtual memory. This is at most 2 GB minus the virtual memory already reserved by the process. The exact value will vary based on operating system configuration and current server load.

If the server receives a POST request with a body that is larger than either the maximum POST body setting or the largest available contiguous block of unreserved virtual memory, it will return a 413 error (Request Entity Too Large) to the client and log the error if server logging is enabled. Like other error status codes, a custom error page for 413 errors may be specified in the server settings.
 

Dialog Component - {dialog.object}.setValueFrom() Method - A new method that makes it easy to copy the value from one control and set the value in another control with the value. This method combines the .getValue() and .setValue() methods into a single method. The source and target can be an array.

If the field you want to set is in a Repeating Section, use 'name:rownumber' for the field name, otherwise the row with focus will be updated.
 

//Set value in 'LASTNAME' field with the value in the 'FIRSTNAME' field

{dialog.object}.setValueFrom('LASTNAME','FIRSTNAME');<br />
 

//Pass in an array of controls.
{dialog.object}.setValueFrom(['T1','T2','T3'],['S1','S2','S3']);
 

 

Bugs

Xbasic Debugger - Alt Keys - Alt Keys can now be used to select menu items.

Xbasic Debugger - Pop-up Variable Inspection Window - When you hover over a variable in the Xbasic debugger, a pop-up menu shows the variable value. This pop-up window would sometimes not disappear as quickly as one would like when moving focus off the variable.

Xbasic Debugger - Global Watches - Fixed several bugs related to global watches.

Xbasic Debugger - Debugger Focus - Fixed a situation that could result in Alpha Five appearing to be hung because the debugger had focus, but could not be brought to the foreground window.

Grid Component - AlphaDAO Grids - Suppress Empty Rows - If this property was turned off, when navigating to the last page on a Grid, if there were insufficient records to fill the page (e.g. only 3 records on a Grid set for 10 rows per page), an error would occur.

Dialog Component - Power Search for Embedded Reports - Letters/Labels - The builder gave an error when selecting a Letter or Label report type.

Forms - Embedded Browsers - Conditional Display of Columns - Using the conditional properties feature, hiding an showing columns in an embedded browser, did not work correctly.

Grid Component - Detail View - Save and Enter Button - Was not working correctly.

Grid Component - Auto-Suggest and Edit-Combo Lookups - DBF Tables - Previously, these two controls would display a unique set of choices based on the value in the return field. So, for example, if the lookup table contained this data:

Smith, Joe

Smith, Mary

and the return value was the 'Lastname' field, only one entry for Smith would be shown.

Now, if the auto-suggest or edit-combo is configured to show additional columns (besides the return field), then the uniqueness test that is performed is based on all of the displayed columns, not just the column that contains the return value. As a result of this change, the lookup will now display both entries for Smith (assuming that the lookup is configured to show the 'Firstname' field as well).

 

Grid and Dialog Components - Client-Side Expressions - Translating to Javascript - The 'Not' operation was not being properly converted to Javascript.

 

Calendar Component - International Data Formats - Fixed a problem with the calendar when switching views. The problem only happened in countries where the data format is dd/mm/yyyy

 

ImageMagik - Convert.exe - An updated version of the ImageMagik convert.exe utility is now included with Alpha Five. If you previously installed a pre-release build, the pre-release build was installing the wrong version of convert.exe. As a result, the Image Upload Action Javascript would fail, if the option to scale the image was selected.

 

Grid Component - Action Javascript - Import Excel/Ascii File Action - Oracle - Failed to import data correctly into a Grid that was based on an Oracle table.

 

Edit-Combo - Progressive Search - Ajax Callback - If the edit-combo is populated using an ajax callback and the 'user must select from list' property is set, the 'Progressive' search method is now enabled. Previously, the 'progressive' search method was only enabled if the list was not populated on an ajax callback, but rather when the control was rendered.

 

Dialog Component - International Regional Settings - Decimal Place - Now uses a comma even if you have not set a Display Format.

 

Grid Component - Auto Refresh - If you turned on the Grid auto-refresh and then closed the Grid (by closing the Tabbed UI pane or window in which the Grid was opened) without first turning auto-refresh off, the auto-refresh would continue to fire. Now, if the Grid is no longer visible, the auto-refresh is turned off automatically.

 

Web publishing using File System Dictionaries and SQL reports - Previously you could not use a File System Dictionary with SQL reports in a web application as the publish process did not recognize the File System Dictionary. The option to “Publish Database Library” will now correctly publish a library containing SQL reports even if using a File System Dictionary.

Web Applications - SQL Reports - File System Dictionary – If you used a File System Dictionary with SQL reports and named data sources, the named data sources did not convert correctly from a Library System to a File System. SQL data sources created after conversion to a File System Dictionary did work correctly. This has been fixed. The current build will automatically convert both types of data sources to a new syntax.


However, SQL data sources in the new File System Dictionary are not backwards compatible with older builds. If you wish to roll back to an earlier build, convert the File System Dictionary back to a conventional Library Dictionary before rolling back to an earlier build
 

http_delete() Function - A bug that prevented http_delete() from sending a request properly has been fixed.

Reports - Linked Reports - SQL - Named Data Source - Web Applications - If you built a report that had a linked report embedded in it, and if the linked report was based on a 'Named SQL Data Source', the child report would not render when the report was run in a Web application using the stand-alone Application Server.

Dialog Component - Slider Control - Custom CSS - If you customized a CSS style, the customized style did not include the CSS classes for the slider control.

Grid Component Builder - Preview after Editing a Property - If you edited a property in the Property Grid, but did not tab out of the property, then went to any of the Preview modes, the property value that you just edited was not used. You had to actually tab out of the property. This is now fixed.

Dialog Component - Repeating Section - Show Label Rule - All rows - Hidden Fields and Contol type - If you had hidden fields or controls that used the Hidden control type in a Repeating Section and you had set the rule for labels to show on all rows, the Repeating Section did not render correctly.

onRptSectionRowChange Client-side Event - Now fires when the active row changes, even if a control in the Repeating Section does not have focus.

formatCurrency() Function - The thousands separator was not being applied to currency formats if "Trailing currency symbol" was selected. This is now fixed.

Grid Component - HTML Editor - Javascript Events - If you defined a Javascript event, such as onChange, for a field that was configured as an HTML editor, the Javascript events were not being honored. As a result of this change, it is now possible to automatically commit a record in the Grid when the user clicks the save button on the pop-up HTML editor.

Grid Component - Hidden Control Type - Blank Values - As a result of a fix made in the previous update, controls that had a type of 'Hidden' were being populated with '&nbsp;' if the value in the field was blank. This is now fixed.

Reports - Linked Reports - Fonts - Certain fonts were not being displayed correctly in linked reports.

Dialog Component - Genie Style - Repeating Section - When a Dialog is set to operate in 'genie' style, all of the fields on the current tab pane are validated before the user is allowed to advance to the next page. If a pane contained a Repeating Section, and validation rules had been defined for any field in the Repeating Section, you would get an Xbasic error when trying to advance to the next pane.

Dialog Component - Repeating Sections - Cascading Dropdowns - Cascading dropdowns did not work if the controls were in a Repeating Section.

Grid Component - Google Map Alternate View - Blank Addresses -  If you configured the Map to place markers on the map for each record in the Grid and the markers were defined by an address (rather than a longitude/latitude value), an error message was displayed if a record contained a blank address. This error is now suppressed.

Furthermore, all 'ZERO RESULTS' error message from Google maps are suppressed. With this change, addresses that contain P.O. Box addresses will no longer raise the error message.

 

Calendar Component - First Day of Week Setting - Was not honoring the setting if you tried to change the first displayed day of week from Sunday to Monday.

Calendar Component - 24 Hour Format - Did not allow option to use a 24 hour time format.

Calendar Component - Field Mapping - Did not work when using custom field names in the Calendar table.

 

FTP - Virtual Hosts - When using the built-in FTP functions in Alpha Five,you could not use virtual host names in the login name, because the pipe character that separated the host name and the user name was misinterpretted. For example:

VirtualHostName|UserName

 

Now, you can work around this specifying the username as:

VirtualHostName****pipe****UserName

 

 

Feature Packs

Dialog Component - Chart Control - You can now add charts to the Dialog Component.

To see a list of all chart types that are offered, click here.

To see videos that demonstrate the Chart control in a dialog, click here.

The basic principle behind defining a chart is as follows:

 

Here is how to define Data Series to be used by a Chart control:

 

 

This will open the Data Series builder when you can define you series.

 

A series is a list of values. For example, this is a simple series:

1

5

9

13

A single series can also be defined as follows:

1|East

3|West

9|South

11|North

In this case, the series is said to have two sub-series. The pipe character delimits the data points in each sub-series. A series can define an unlimited number of sub-series. The first series in the above list is the values: 1, 3, 9 and 11. The second series is the list of values: East, West, South and North.

The data for a series can be 'static' - a hard coded list list of values, or dynamic. In the case of a dynamic series, you can specify a query that runs against SQL or .dbf tables, or you can specify Xbasic or Javascript functions that will compute the series values.

 

 

Proximity Search Control - Grid Component - Search Part - A new feature pack has been released. The Proximity Search Control allows you to easily add a search field to your Grid to find all records within a specified radius of an address, or partial address (only works with SQL tables that have a Geography/Geometry field). See video.

The builder for the Proximity Search control is shown below:

 

 

Dialog Component - Map Control - You can now put map controls on a Dialog component. The map control object exposes methods that allows you to easily program against the map object. For example, you can center the map, add markers to the map, read the position of markers, etc. Currently the map control uses Google Maps. In the future, if there is sufficient demand, we would like to add support for other map vendors, such as Bing. Watch Video

Subscriber Benefits

Subscriber Benefits are Alpha Five features that are available only to subscription customers.

(All subscribers should have received their license keys from Customer Service. If you have not received your license key to unlock the Subscriber Benefits, please contact Customer Service)

 

Click here to see a complete list of Subscriber Benefits.

 

 

Dialog Component - Server Side Action Scripting - Save Submitted Data To Tables - SQL - Geocoding Addresses - When you save a record, you can now automatically geocode addresses in the data at the same time the record is saved. This option only applies to SQL tables. For example, assume that the Dialog prompts for an address, city, state, postal code and country field and that the table to which the Dialog is bound has a latitude and longitude field.

When the record is saved after edits, or a new record is added you can automatically geocode the address in the address fields and get the latitude and longitude for the address and store those values in the table's latitude and longitude fields.

Watch Video - Part 1

Watch Video - Part 2

 

When you edit the Server Side action to save data to tables, you will see the additional properties for Geography Fields. This is where you can define that you want to geocode addresses when the record is saved.

 

Dialog Component - Server Side Action Scripting - Save Submitted Data To Tables - SQL - Compute Geography Field from Latitude/Longitude Values - If a table has a Geography/Geometry field, when you edit the table and change either the latitude or longitude value on which the Geography/Geometry field is based, you can automatically compute a new value for the Geography/Geometry field. Encoding the Geography/Geometry field value is important if you want to do Geography searches on your data.

Watch video


Grid and Dialog Component - Action Javascript - New Action - Fade Out Message - You can now define an action to display a message that automatically fades out of view over a certain interval. Fad out messages are ideal for providing feedback to a user to indicate, for example, that some action has been completed.

Watch video

 

Dialog Component - Server Side Action Scripting - Save Submitted Data to Tables Action - Fade Out Confirmation Message - You can now display a fade out confirmation message to the user if the data was successfully saved when the user clicks the Submit button.

Watch viideo

 

Grid and Dialog Component - Message Box Action - Advanced Message Box - When you create an action to display a message box, instead of using the built-in Javascript alert() and confirm() functions, which are very primitive, and do not allow custom styling, you can now choose an advanced option which allows you to create a styled message box that uses the A5.messageBox() function in the Alpha Five Javascript library. Also, when you use the advanced option you can define custom buttons to appear on the dialog. You are not limited to OK, Cancel, Yes and No.

Watch video

 

Message box builder with the Advanced option selected:

Note that the builder allows you to control the button labels, the Javascript that gets executed when any of the buttons gets clicked, and the justification of the buttons.

 

 

The image below shows a message box created with the built-in Javascript alert() function

 

Here is a message box using the advanced options.

 

 

 

Dialog Component - Defining Javascript using Javascript Actions instead of Writing Javascript Functions - When you define a Javascript function you need to write the Javascript code by  hand. Now, in the Dialog Properties pane, a new property 'Javascript Actions' has been added. This allows you to define Javascript using genies.  Defining Javascript Actions is similar to defining Javascript Functions for your Dialog, except that you use the Action Javascript Builders to write the Javascript code rather than hand-coding it. The Actions that you define here can be called by various event handlers in your Dialog.

How to open the Javascript Actions builder:

 

When you edit your Dialog's Javascript code (by selecting the Javascript functions pane in the Dialog builder) you can define an unlimited number of Javascript functions. Similarly you can define an unlimited number of actions in Action Javascript. For example, the screen below shows the Action Javascript builder after two actions have been defined:

To run an action that was defined using in Javascript Actions,  you use the following Javascript code:

{dialog.object}.runAction(actionName);

 

You can also use the 'Run Action' action in the Action Javascript builder to run a Javascript Action.

Watch video

Tips

Textbox Control - Watermark - Tabbing Into Control - IE - A bug in Internet Explorer results in the loss of the blinking caret when a user tabs into a textbox control with a Watermark property. The following Javascript can be added to the control's onFocus event to work around the problem.

 

if(this.value == $ga(this,'A5WatermarkText')) {
    A5.edit.setSelection(this,0,0);
} else {
    A5.edit.setSelection(this,0,this.value.length);
}

 

 

AlphaDAO Connection Strings - SQL Server - Additional Connection Parameters - 'Application Name' Parameter - A user recently asked how to set the 'Application' parameter in the connection string.

You can modify the SQL Server connection string to set the application name by manually editing the connection string and adding the string “,App=My Application” as in the example below.

 

dim cn as sql::Connection
?cn.open("{A5API='SQLServer',A5DBVersion=2012,Server='(local)',A5ANSINullPadWarn=Default,Trusted_connection=yes,App=MyAlphaFiveApp}")
?cn.execute("select app_name()")
= .T.

?cn.resultset.tostring()
= "MyAlphaFiveApp"
 

For even more options you can use an ODBC connection, or the new ADO.NET connection string type.

 

Action Javascript - File Download Action - Embedded Object - Customizing the Client-side Filename -  When you define an action to download an binary object that is embedded into a field in a table, the builder does not allow you to set a dynamic (client-side) filename for the downloaded file.

However, assuming that you have a field in the Grid that contains the suggested client-side filename (called say 'filename'), you can easily modify the generated Javascript for the action to use the value in this field.

To do this, first convert the action to text mode and then make the changes shown below

 

 

window['{grid.componentName}_G__UNBOUND_BUTTON_2_1'] = function(rowNum,rowId,objEle) {

//get the value in the 'FILENAME' field
var csfilename = {grid.object}.getValue('G','FILENAME',rowNum);
 

//set the value of the __csfn parameer to this value
var data = '__fileTypeField=name&_getData=true&__exportFilename=tempexportfile&__objectfieldname=blob&__csfn='+csfilename+'&__action=Display message&__message=File {filename} not found.';
{grid.Object}.ajaxCallback('G',rowNum,'__a5DownLoadObjectField','',data);
}

 

 

Getting a Pointer to a Pop-up Window - In most cases when you create a pop-up wndow to display content, Alpha Five names the window itself, and does not let you specify a name of your choice (don't confuse 'name' here with 'title' - you can certainly set the window title). To get a pointer to the window (so that you can then call methods of the window), you need a pointer to the window, but without knowing the window name, you can't call the Grid or Dialog object's .getWindow() method.

The technique discussed below is a simple way to get a pointer to the window object.

In the window's onShow Javascript event, add code like this

{dialog.object}._mywindow = this;

 

If the window was in a Grid object, you would write:

{grid.object}._mywindow = this;

In this example, '_mywindow' is an arbitrary variable name. It could be any name you want.

When the window is opened, a pointer to the window is stored in your variable.

Now, you can call methods of the window. For example

{dialog.object}._mywindow.setTitle('New Window Title');

 

 

Forms - Customizing the Confirmation Message When Closing a Dirty Form - The following example code can be put on a form's CanExit event to replace the built-in confirmation message with a message of your own.

 

dim q as n 
q = ui_msg_box("Notice","Are you sure you want to exit from this form without saving your data?",UI_YES_NO_CANCEL)

if q = ui_cancel_selected .or. q = ui_no_selected then 
    cancel()
else
    topparent.command("record_cancel")
end if 
 

 

 

Watch Events - Grid and Dialog Components - Firing when a Key is Pressed - When you define a watch event (e.g. a show/hide, or enable expression) that watches the value in a textbox control, the watch event will fire under these conditions:

 

  1. When the Component changes state from 'clean' to 'dirty'
  2. When the control is blurred (i.e. when it loses focus)

There are situations however, when you would like the watch events to fire after each keystroke is entered into the textbox whose value is being watched.

For example, say you have two controls, Control1, and Control2. Control2 has a show/hide expression:

len(Control1) > 10

When you are typing into Control1, you would like Control2 to become visible as soon as the user types the 11th character into Control1. You don't want to have to wait until the user blurs out of Control1.

To achieve this, you would add this code the onKeyUp event for Control1:

 

{dialog.object}.refreshClientSideComputations()
 

 

Custom A5W Pages - Using the Date/Time Picker - The following sample .a5w page shows how you can includes the date/time picker control on your own .a5w pages (when not using any of the built-in components). This example can be extended for other of the Alpha Five Javascript control types (such as edit-combo, auto-suggest, etc) by generating a Dialog component and then looking at the generated HTML and Javascript

 

 

 

<html>
    <head>
        <meta http-equiv="Pragma" content="no-cache">
        <meta http-equiv="expires" content="-1">
        <!-- must use in order to make XP Themes render -->
        <meta HTTP-EQUIV="MSThemeCompatible" content="Yes" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <script type="text/javascript" src="javascript/a5.js"></script>
        <script type="text/javascript" src="javascript/a5_url.js"></script>
        <link rel="stylesheet" type="text/css" href="css/GrOlive/style.css" />
        <script type="text/javascript" src="css/GrOlive/style.js"></script>
        <script>
            var dp = new A5.EditDateTime({
                theme: 'GrOlive',
                dateTime: {
                format: 'MM/dd/yyyy'
            }
            });
        </script>
    </head>
    <body class="GrOlivePage">
        <input type="text" id="date1" class="GrOliveEdit" />
        <script>
            var ele = $('date1');
            dp.bind(ele);
        </script>
    </body>
</html>

 

 

Build 2549_3903  Mar 27 2012

Bugs

Radio Button and Checkbox Controls - Space for Stored Value - Radio buttons and Checkboxes now support one or more spaces as the stored value.

For example, say you defined a radio button and then set the choices to:

 

Yes|<space>

No|X

 

Where <space> represents a single space character (NOT the literal string <space> !!!).

If the stored value in the field was a single space, the radio button will now be initialized to Yes.

 

Dialog Component - Power Search on Embedded Grid Feature Pack - Clear search action was causing an error in the builder when you selected the target Grid.

 

Dialog Component - Link an Embedded Grid Feature Pack -Was causing an error in the builder when you selected the target Grid.

 

Features

Checkboxes and Radio Button Controls - Static Choices - Blank Stored Values - Previously it was not possible to specify a blank as the stored values. Now, using the special <BlankValue> placeholder you can specify that the stored value for an option is a blank. For example:

 

Option1|<BlankValue>

Option2|2

 

Dialog Component - Tree View - Easier to Associate Container Ends with their Start Entry - The Tree View in the Dialog component now puts an Id in the text for the [Container End], [Frame End] and [Tab End] entries in the tree list, as shown below.

 

 

Subscriber Benefits

Subscriber Benefits are Alpha Five features that are available only to subscription customers.

(All subscribers should have received their license keys from Customer Service. If you have not received your license key to unlock the Subscriber Benefits, please contact Customer Service)

 

Click here to see a complete list of Subscriber Benefits.

 

 

Dialog Component - Collapse and Expand Containers - When working in a large Dialog with multiple nested containers (Containers, Frames, Tab, etc.), the tree view of the Dialog can get quite complicated. Now, you can right-click on any container control and select an option to collapse the entry into a single item. Watch Video

Watch Video

 

Dialog with containers in their 'expanded' state:

 

Dialog with the 'Repeating Section' container collapsed:

(Note that collapsed containers are shown in red. The number of items in the collapsed container is show. For example, in the screen below, the collapsed container has 7 items - including the Container Start and Container End entry.)

 

 

Build 2534_3899  Mar 22 2012

Features

SQL::Arguments Object - Array - The SQL::Arguments object now supports arrays. This is a very powerful addition because it makes support for parameterized SQL queries that contain the IN keyword possible. See example below.

To set a SQL::Argument value to an array, you simply create an Xbasic array and then set the argument value to the array, as show in the following interactive window session.

 

'create an Xbasic array with 3 elements

dim a[3] as c
a[1] = "Boston"
a[2] = "London"
a[3] = "Berlin"

dim args as sql::arguments
args.add("whatcity",a)
 

'View the XML property of the SQL::arguments object
?args.xml
= <SQLArguments>
    <SQLArgument>
        <Name>whatcity</Name>
        <Data Type="C[]">
            <Item Type="C">Boston</Item>
            <Item Type="C">London</Item>
            <Item Type="C">Berlin</Item>
        </Data>
        <IsNull Type="L">0</IsNull>
        <Usage>Input</Usage>
    </SQLArgument>
</SQLArguments>

 

'read the first argument into an Xbasic array
dim aa as p
aa = args[1].data

?aa[1]

= "Boston"
 

'find the data type of the first argument. a type of 'P' indicates that the argument is an array
?typeof(args[1].data)
= "P"

 

 

'find the data type of the array

?typeof(args[1].data[1])

= "C"

 

 

'add a new element to the array.

dim myarr as p

myarr = args[1].data

myarr[] = "Santiago"

args[1].data = myarr

 

 

In this next example, we show how you can use array arguments in a SQL statement that uses the IN keyword.

 

dim cities[0] as c

cities[] = "London"

cities[] = "Madrid"

cities[] = "Paris"

 

dim cn as sql::connection

cn.open("::Name::Northwind")

dim sql as c

sql = "select customerId,city from customers where city in (:cities)"

 

dim args as sql::arguments

args.add("cities",cities)

 

?cn.execute(sql,args)

= .t.

?cn.resultset.toString()

= AROUT London
BSBEV London
CONSH London
EASTC London
NORTS London
SEVES London
BOLID Madrid
FISSA Madrid
ROMEY Madrid
PARIS Paris
SPECD Paris
 

 

Bugs

Grid Component - Security Framework - Disabling Controls For Which User Did Not Have Edit Permission - If a field was set to 'Not Updateable' because the user did not have permission to edit the field, in some circumstances the control was not being rendered in the browser as disabled. This was only a cosmetic problem because if the user made an edit in the field and then submitted, the edit was rejected.
Grid and Dialog Component - Client-side Show/Hide Expression - Radio Button and Checkbox Controls - If a radio button or checkbox control should have been hidden by a client-side expression, it was not being hidden. (Note: You will need to edit the component and make the control dirty, then resave to see the fix.)

Grid Component - Search Part - Map Control - If you specified that the search result should be shown on the map, and you defined info boxes for each marker that was placed on the map, the infobox would show the wrong text if the Grid was being run in a Tabbed UI. This is now fixed, but you will have to edit the Grid, then end the map control definition in the search part to see the fix.

Grid - Editable Grid - Scrollable Body - Even though the scrollable body property is recommended for read only Grids, some users are using it with editable Grids anyway. When used with editable Grids, the columns in the Grid did not line up properly. This is now fixed.

 

Build 2528_3899  Mar 20 2012

Bugs

Grid Component - Alternate View - Google Map - Info Box - Tabbed UI - When a clicking on a marker in the map to show the Info Box, the wrong info box was shown if the Grid was running in a Tabbed UI. The problem was specific to running the Grid in a tabbed UI.

Grid Component - 'Hidden' Control Type - Fixes were made for controls set to use the Hidden control type.

Build 2522_3897  Mar 18 2012

Feature Packs

Two new feature packs have been released.

Power Search for Reports Embedded in Dialog Components - Watch Video

Advanced Tab Control for Dialog Component - Watch Video

 

 

Features

Reports - Calculated Fields - Filter Expression - It is now possible to use calculated fields defined in the Report in the filter expression for the Report.

Bugs

Dialog Component - Populate from Table Action - Repeating Section - Unbound Controls in Repeating Section - If the Repeating Section contained any controls that were not bound to a table, you would get an error.

Grid Component - Cascading Dropdown Controls - Multiple Levels of Cascading Controls -  Under certain conditions, if you have more than 2 levels of cascading dropdowns, you would get an error when editing an existing row.

Update Operations - .dbf Tables  -  Really long Update expressions could be lost if the expressions contained lots of escaped characters (i.e. carriage-return/ line feeds).

Grid Component - Detail View - Hidden Control Type in Grid Part - If a Grid with an editable Detail View had a control with a Hidden control type in the Grid part, adding a new record that included a single quote in the hidden field would cause a Javascript error after the record was updated.

Grid Component - Client-side Conditional Style - Control Level - Edit-combo, Lookup Grid and Date Pickers - The style was not being applied.

Dialog Component - Repeating Sections - Data Binding - SQL Tables - Server Side Action Scripting - Save Records - Entering a new record in a repeating section would fail under certain circumstances. This bug was introduced in the previous patch.

Dialog Component - Control Javascript - Repeating Sections - If you defined 'Control Javascript' for a control, the Javascript was not executing correctly if the field was in a Repeating Section.

Dialog Component - Lookup Grid - User Must Select from Lookup Option - Repeating Section -  The 'User must select from lookup' option was not being honored if the lookup field was in a repeating section.

Dialog Component - SQL Tables - Primary Key Guid - Server-side Action Scripting - Save Record Action -  If you have Dialog component for which Data Binding has been defined and if the primary key of the table you have bound to is a Guid field, if you don't specify a value for the guid when entering data, Alpha Five will now automatically assign a value to the field.

Dialog Component - SQL Tables - Data Binding - Repeating Section - If you had a Dialog with Data Binding defined and you have a Repeating Section and you have indicated that the parent table of the Dialog is read only (but that the tables in the Repeating Section are editable) you were not able to enter a new record in the Repeating Section. It was necessary to set the parent table to be updateable as well, even though you did not intend to perform updates against the parent table.

Dialog and Grid Components - Client-side Enable Expression - Checkbox Control - Firefox and Chrome - If a control should have been disabled by a client-side expression, it was not showing as disabled in Chrome and Firefox. This is now fixed.

Dialog Component - Data Binding - Genie to Create Tables from Dialog Definition - Some improvements were made to this Genie so that you can now reuse if after its initial use.

Grid Component - Lookup Grid - Filling in Values - When making a selection from a lookup Grid, under some circumstances, not all of the mapped fields were being filled in with data from the lookup Grid. The error occurred only if the Grid you were filling in used a mixture of controls - i.e. some label and some textboxes.

 

Subscriber Benefits

Subscriber Benefits are Alpha Five features that are available only to subscription customers.

 

Navigation System Component - Server-side Show/Hide Expression - You can now define a server-side show/hide expression. The expression can reference session variables. If the expression is .t. then the menu (and its children) are shown. If the expression of .f., then the menu (and its children) are eliminated from the menu.

 

 

 

 

Grid Component - Row Expander - Server-side Show/Hide Expression - When you define a Row Expander for a Grid you can define multiple components to show when the row is expanded. The multiple components are displayed in a Tab or Accordion control. Previously, you could only control which components were shown when the row was expanded by assigning a Security Group to the component. Now, you can also define a server-side show/hide expression. This expression can reference session variables.

So for example, your Row Expander might allow the user to view Grid1 and Grid2, but the server-side show/hide expression might be defined for Grid2. Say the expression was:

session.showGrid2 = "Yes"

 

Then at run-time, if session.showGrid2 was 'No', the Row Expander would not show Grid2.

 

Dialog Component - Server-Side Events - OnDialogRender - This event fires after all of the HTML for the Dialog has been computed. It allows you to modify the HTML or Javascript that was computed. You can perform string manipulation operations on e.html, or e.javascript to change the HTML or Javascript that gets rendered.

 

Popup Windows - Optional Window Parts - Headers and Footers and Toolbars - When you use Action Javascript to open a Component in a pop-up window, you can now defined optional parts for the pop-up window. These optional parts include a header, footer and toolbar. Watch Video.

 

Dialog Component - Client-side Expression - Read Only - You can now define a new type of client-side expression to turn on/off the readOnly attribute of a control. Watch Video.


 

 

Build 2516_3893  Mar 16 2012

Bugs

 

Dialog Component - Repeating Sections - Data Binding - SQL Tables - Server Side Action Scripting - Save Records - Entering a new record in a repeating section would fail under certain circumstances. This bug was introduced in the previous patch.

Dialog Component - Control Javascript - Repeating Sections - If you defined 'Control Javascript' for a control, the Javascript was not executing correctly if the field was in a Repeating Section.

Dialog Component - Lookup Grid - User Must Select from Lookup Option - Repeating Section -  The 'User must select from lookup' option was not being honored if the lookup field was in a repeating section.

Dialog Component - SQL Tables - Primary Key Guid - Server-side Action Scripting - Save Record Action -  If you have Dialog component for which Data Binding has been defined and if the primary key of the table you have bound to is a Guid field, if you don't specify a value for the guid when entering data, Alpha Five will now automatically assign a value to the field.

Dialog Component - SQL Tables - Data Binding - Repeating Section - If you had a Dialog with Data Binding defined and you have a Repeating Section and you have indicated that the parent table of the Dialog is read only (but that the tables in the Repeating Section are editable) you were not able to enter a new record in the Repeating Section. It was necessary to set the parent table to be updateable as well, even though you did not intend to perform updates against the parent table.

Dialog and Grid Components - Client-side Enable Expression - Checkbox Control - Firefox and Chrome - If a control should have been disabled by a client-side expression, it was not showing as disabled in Chrome and Firefox. This is now fixed.

Dialog Component - Data Binding - Genie to Create Tables from Dialog Definition - Some improvements were made to this Genie so that you can now reuse if after its initial use.

Grid Component - Lookup Grid - Filling in Values - When making a selection from a lookup Grid, under some circumstances, not all of the mapped fields were being filled in with data from the lookup Grid. The error occurred only if the Grid you were filling in used a mixture of controls - i.e. some label and some textboxes.

Grid Component - Detail View - Hidden Control Type in Grid Part - If a Grid with an editable Detail View had a control with a Hidden control type in the Grid part, adding a new record that included a single quote in the hidden field would cause a Javascript error after the record was updated.

Grid Component - Client-side Conditional Style - Control Level - Edit-combo, Lookup Grid and Date Pickers - The style was not being applied.

 

 

 

Build 2506_3890  Mar 13 2012

Alpha DAO - Postgres - Connection String Builder Dialog Box - Create Table - The 'Create Table' button on the connection string builder was not working for Postgres databases.

Dialog Component - Postgres - Insert Records - Case Sensitive Field Names - If case-sensitive fieldnames were used in the Postgres table, the Insert statement generated by the Dialog would fail.

 

Grid and Dialog Component - HTML Editor - Pop-up Mode - A recent update caused the HTML editor, when it was configured to open as a pop-up, to be incorrectly sized, thereby obscuring the Save and Cancel buttons.

 

Grid Component - Auto-refresh Option - If you turned on this option, you got a Javascript error. This is now fixed.

 

Grid Component - Delete Record Checkbox - Internet Explorer - A change in the previous update to support checkboxes that were configured to display in snaking columns broke the Delete Record checkbox under Internet Explorer. This is now fixed.

Str() Function - This function, which is used to format numbers, is now more robust in that it can take either a numeric or string input. For example:

 

?str(23.2,10,2,"$")

= "    $23.20"


 

'Previously, this would have returned "23.2" (without the $) because the input was not numeric

?str("23.2",10,2,"$")

= "    $23.20"

 

As a result of this change, when creating a Display Format expression in the Grid or Dialog, it is now optional (and no longer mandatory) to include the convert_type() function in the generated function. If you use the Genie to generate the Display Format expression, the Genie will continue to use convert_type() in the generated expression.

Dialog Component - Send E-mail Server Side Action - .Net Methods CC and BCC Addresses - If you use the .Net methods for sending e-mail, the cc and bcc addresses were not being honored. This is now fixed. The same fix here also applies to the email_send_noprofile() function when the .Net methods options is selected.

 


 

Build 2503_3890  Mar 12 2012

Features

Dialog Component - Repeating Sections - e Object - VisibleRows Property - The e object that is passed into Xbasic callback function now has an additional piece of information about each Repeating Section - 'visibleRows'. This property is a crlf delimited list of the physical row numbers of the visible rows in the Repeating Section. For example, if the Repeating Section has 20 physical rows, but some rows were deleted before the Dialog was submitted, the 'visibleRows' property will show the non-deleted rows.

Bugs

Grid Component - MySQL - Updateable Grid based on View - If the primary key of the View was an auto-increment field, you would get an error when refreshing the Grid after an insert.

Build 2497_3888  Mar 10 2012

Bugs

Application Server - SSL - Keep Alive - A limited number of users had reported problems when running the Application Server with both SSL and Keep-Alive enabled. The source of this conflict has been identified and addressed. Any servers which had Keep-Alive enabled as a temporary work-around may now re-enable Keep-Alive for better performance.

Dialog and Grid Component - Client Side Expressions - Reserved Words -  As a result of a change made recently, if your client side expression had fieldnames that included the following strings anywhere in the field, your expression would fail: Group, Order, Having, In, Select, Where

Google Map, Image Gallery and Video Player Component - Arguments - There was an issue where the arguments array was being re-initialized when you saved the component, effectively wiping out any argument assignments that were set within the builder for session, cookie or page variables. This has been fixed.

Tabbed UI - Reports - Prompt for Parameters at Run-time - An issue that caused a Javascript error has been fixed.

Grid Component - Checkbox and Radio Button Controls - Snaking Column Layouts - If checkbox or radio button controls had been configured to display in a snaking column layout, the value in the control was not being read correctly when submitting the Grid.


Features

Grid Component - Dialog Component Data Binding - SQL Tables - A new table picker is being used when you select the table on which the Grid or Dialog is based. The table picker especially useful when working with databases that have a very large number of tables because it allows you to enter wildcard filters to quickly find a table.

Grid and Dialog Component - Control Label - The prompt for the label in the property grid in the builder has been turned into a smart field that allow you to enter high order characters, including Japanese, Chinese and Arabic.

Build 2493-3885  Mar 09 2012

Features

View Settings - Browse - Vertical Scroll Bar - A new option in View, Settings, Preferences allows you to set the option for the browse vertical scroll bar behavior (Desktop applications, .dbf tables).

Previously, you could only set this behavior using the a5.system_mode_set() function. This option controls whether the vertical scroll bar in a browse accurately reflects the current logical position in the browse, or is an approximation. Prior to V9, the vertical scroll bar position was only an approximation of the logical position. In V9 and above, the vertical scroll bar position is an accurate representation of the logical position in the browse. However, it can be slow to compute the accurate logical record number in a large table over a network. You can specify a threshold value. If the browse contains more than the threshold number of records, it will revert to the approximate method.

Bugs

Calendar Component - Create Dialog for Editing Events Genie - Was crashing under certain circumstances.

Dialog Component - Action Javascript - Open a Dialog as an Alternate Editing View For Current Record - Was not working correctly if the record you were editing was in the Grid's Detail View.

Grid and Dialog Component - Client Side Conditional Expressions - As a result of a change made in the last update, client-side conditional expressions failed under a certain very limited set of conditions.

Dialog Component - Data Binding - SQL Tables - One-to-Many Links - If the child table in a one-to-many link had multiple columns in the primary key, the records in the Repeating Section would not populate correctly.

Google Map - Alternate View and Search Part Map - Use SSL - Was not honoring the 'Use SSL flag'.

 

 

Build 2487-3884  Mar 07 2012

Bugs

Grid Component - SQL Tables - Numeric Fields - Treat as Logical - Checkbox - If you had a SQL table with numeric fields and you set the 'Treat as Logical' property to true and then set the control type to 'Checkbox' then when you edited the row in the Grid (if the refresh row on dirty property was set on), the value in the checkbox controls would get refreshed to unchecked.

Dialog and Grid Component - Client-side calculated fields - Could not use any fieldnames in the expression that were SQL reserved keywords, such as Group, Select, Having, etc. This is now fixed.

Dialog Component - Server-side Action Scripting - Save Record Action - SQL Tables - Under certain circumstances, the server-side action to save records to a table was broken by a change made in the previous update.

Grid Component - {grid.object}.setBaseFilter() - If the 3rd parameter (arguments - an optional parameter) was not passed in, this method was broken by a change in the previous update.

Grid Component - Detail View - Date/Time Picker - Internet Explorer 8 and Earlier - A change was made to improve the performance of the Javascript for the Date Picker when. This change should address the issue of  IE8 and earlier displaying a "slow script" error message when opening the Detail View in a Grid when the Detail View contained multiple Date pickers. IMPORTANT: To see the effect of this change, you must edit and resave the Grid.

Grid Component - Arabic Characters - Arabic characters were not displayed correctly in an updateable Grid.

Dialog Component - Load External CSS File Property - Was not being honored if the Dialog was opened on an Ajax callback. Also, if you specified an external CSS filename, Working Preview would occasionally crash.

Grid Component - DBF Tables - Working Preview - Working Preview would fail occasionally to display any content if the table had a large number of records.

 

Features

Dialog Component - Power Search Feature Pack - Now allows you to search on computed columns in a SQL Grid.

Image Gallery Component (IGC)  - You can now control the type of sort used when returning images from the specified image gallery directory. This affects the order in which the thumbnails / images are displayed in the IGC.

Supported sorting includes :

Ascending alphanumeric sort on filename ( A to Z )
Descending alphanumeric sort on filename (Z to A)
Ascending sort on date/time (Oldest to Newest)
Descending sort on date/time (Newest to Oldest)
Ascending sort on date (Oldest to Newest)
Descending sort on date (Newest to Oldest)

All dates are derived by using the "T" option in XBasics' findfile.get() method. As such they represent the time the file was last modified.


All date and time sorts include an ascending sub-sort on filenames.

To take advantage of this new capability, the builder for the Image Gallery now includes the following property :

Image directory sort criteria

 

 

Build 2466-3883  Feb 29 2012

Videos

D39 - Understanding what's in the e.dataSubmitted and e.oldDataSubmitted Objects when the Dialog is Submitted.
D40 - Consuming and processing JSON data from Twitter to display tweets on a Dialog component.

D41- Dynamically Re-populate a DropdownBox Control in a Dialog or Grid Component.

D42- Evaluating Javascript contained in <script> tags in an Ajax response. Applies to both Dialog and Grid.

D43 - Hiding Controls on a Dialog and then Showing them in a Pop-up Window.

D44 - Working with an IFrame on a Dialog

D45 - Add a File Download feature to a Dialog


M45 - Communicating Between Components - Sending Commands from one Component to Another
M46 - Using Xbasic to Generate HTML by Merging Data into Templates - Understanding the a5_mergeDataIntoTemplate

M47 - Dynamically Change the Choices for a Checkbox, Radio Button, or Dropdownbox Control in a Grid.

M48 - Using the Checkbox Column in a Grid to Select Rows and then Opening another Grid Showing the Selected Rows.

() Function.
D_SF_5 - Setting Security on Pages and Components - Using the Page Permissions Genie
 

 

Feature Packs

New Feature Packs have been released. These are

Note: Feature packs are sold individually, but are free to subscribers.

Features

Dialog Component - hideRepeatingSectionColumn() Method - Now also hides the horizontal spacer after the column when the column is hidden.

Reports - Table Layout Reports - Dynamic Styles - Previously, dynamic styles (for example, show the price field in red if the quantity field was above 20) was only supported in Freeform Reports. Now, dynamic styles are supported in Layout Table reports. Furthermore, the dynamic styles are honored when the report is exported to HTML or Excel.


Dialog Component - Lookup Grid - Dynamic Filtering - 'BaseFilter' is now supported as a method for dynamic filtering. Previously, only Link and UserFilter were supported.

Dialog and Grid Component - Edit Combo Control - Scrolling Selected Item into View - When you open the edit-combo, if an entry in the list is already selected, the entry in now automatically scrolled into view. Previously, you had to scroll the selected entry into view by dragging on the vertical scroll bar.

Dialog Component - .setFocus() method - Now allows you to specify a row number inside a repeating section. For example, to give focus to the QTY control on row 3 of a repeating section:

{dialog.object}.setFocus('QTY',3);

 

Dialog Component - System Fields - A new system field has been made available for use in client-side calculations (calculated fields, show/hide, enable, dynamic style expression).

dialog.isDataDirty

 

The dialog.isDataDirty field differs from the existing dialog.isDirty field in that it only goes true if a control that has been bound to a table field (in the Data Binding section) is dirty.

Contrast this with the dialog.isDirty field which goes true when ANY control on the Dialog goes dirty.

Defined Controls - Submit Reset - When you have a Dialog that has been bound to one or more tables, and you then select the Submit/Reset button entry in the Defined Controls section, a new prompt appears asking if you want the enable expression for the buttons to be tied to the dialog.isDirty or dialog.isDataDirty system field.

 

 

Dialog Component - .submit() Method - The Dialog .submit() method now has two new optional parameters:

 

{dialog.Object}.submit([submitType [,additionalData]])


You can optionally include a 'submitType'. If you have multiple buttons on the Dialog that call the .submit() method, by specifying the 'submitType', your code in the DialogValidate and AfterDialogValidate event handlers could test the value of the submitType value.

This value will be available in the e.rv.__submitType' variable.

 

You can also optionally specify additional data to be submitted in the form of a URL query string. For example:

value1=alpha&value2=beta
 

Note: In your Xbasic event handler, the additional data is available in 'e.rv'

Dialog Component - New Method to Get Active Row in a Repeating Section - Returns the row number of the row in a Repeating Section with focus. By default, the physical row number is returned. Deleted rows (which are hidden) are counted. To get the logical row number (which ignores deleted rows), specify true for the optional second argument.

 

{dialog.Object}.getRepeatingSectionActiveRow(sectionName [,flagLogicalRow])

 

Dialog Component - Builder - Client-side Events - When editing client-side events in the Dialog Builder, there is now a 'filter' textbox that allows you to filter the list of events so that you can quickly find a particular event.

Dialog Component - Client Side Events - New Events - New events have been added. These are:

 

onSynchronizeDialog - Fires after a Dialog has been synchronized. (When a button opens a Dialog in a Window, and if the 'caching' option is on, if the window has been previously instantiated, the existing Dialog in the window is simply synchronized, rather than loaded from scratch.) Since the Dialog is not being loaded from scratch, the OnDialogInitialize event event will not fire. This event will fire.

 

canRecordNavigate - Fires before a Data Bound Dialog navigates to a new record. You can test the e.isDataDirty parameter to see if navigation should be cancelled because the user has uncommitted changes. (Note: Requires the Dialog Record Navigation Feature Pack)

 

afterRecordNavigate - Fires after a Data Bound Dialog navigates to a new record. (This event fires before the callback that retrieves the data from the server has completed. See the 'AfterPopulateFromTable' event for more information.)

 

afterPopulateFromTable - Fires after a Data Bound dialog has fetched a record from the server.

 

 

Dialog Component - Date Picker - New properties have been exposed for the date picker. These are:

 

 

Here is how the new properties show up in the builder:

 

 

Here is an example of how the date picker renders with the above settings.

 

Note for advanced users: In the above image, if you check the Has events property, the onItemDraw property is exposed. You can use this property to write any text you want into each date cell. See video FP11_CAL3 for an example.

 

 

 

Navigation Component - On Initialize Javascript Property - New property added that allows you to execute Javascript when the navigation object is initialized. You Javascript code can use the special placeholder {navsys.object} to get a pointer to the Navigation Object.

For example, say you have an item in the Navigation system with an id of 'menu1'. You can hide this menu with this code:

 

{navsys.object}.setDisplay('menu1',false);

 

Here is a more elaborate example:

Say that at run-time you want to hide or show a particular item in the Navigation object. Assume that the Id of the item you want to hide is 'grandChild1', and that the chain of menu items that lead to this item is 'menu1'  (the top level menu), 'child1'. In other words, the path to this item it menu1 -- child1 -- grandChild1.

 

Step 1 - Add this generic function to On Initialize Javascript property of the Navigation Component:


function hideMenuItem(idTopLevelParent,idMenuItemArray) {
    for(var i=0;i<{navsys.object}.data.length;i++){
        if({navsys.object}.data[i].name == idTopLevelParent){
            {navsys.object}.data[i].dropdown.setDisplay(idMenuItemArray,false);
        }
    }
}

 

 

Here is the call to the hideMenuItem() function to hide 'grandChild1')

 

hideMenuItem('menu1', ['child1', 'grandChild1']);

 

 

Desktop Forms and Browses - Date and Time Fields - Date Picker - Internationalization - The date picker that is displayed now automatically honors regional settings on your computer and displays month and day names in the appropriate language.

New Functions for International Month Names and Day of Weeks Name - New functions have been added to retrieve month names and day of week names in the specified culture.

The functions are:

international_months([C Options])

international_days_of_week([C Options])

 

 

The options parameter for the international_days_of_week() function can include a comma delimited list of parameters, such as:

language=cultureCode

short

shortest

start-dayName

 

 

Examples:

? international_months()
= January
February

...

' spanish
? international_months("language=es")
= enero
febrero

...



? international_days_of_week()
= Sunday
Monday

...

? international_days_of_week("start-monday,shortest")
= Mo
Tu

...

' german
? international_days_of_week("language=de")
= Sonntag
Montag

..

 


The months and days returned are in UTF8 , so when dealing with the Web applications, you can take the output as is. However, when working from a desktop application (which assumes ACP) , you will need to call convert_utf8_to_acp()
 


? convert_utf8_to_acp( international_months("language=fr") )
= janvier
février
mars
 

 

AlphaDAO - ListTables() and ListTablesWithTypes() Methods - ListTables and ListTablesWithTypes are now overloaded to accept a single object of type SQL::TableFilter where previously you had to list out a series of logical values as individual arguments.
 

The SQL::TableFilter object allows you to set properties for all of the six flags that the ListTables() and ListTablesWithTypes() methods currently accept, and in addition, allows you to set properties for IncludeAllSchemas and IncludeAllOwners.

 

Note: Although the prototype does not show it, the old signature still works and the autohelp shows the syntax with a note that it is now obsolete.

 
To use the TableFilter argument, simple dimension one and override any default values as below.
 

dim cn as sql::connection
?cn.open("::Name::SQLServerNorthwind")
dim Filter as SQL::TableFilter
Filter.IncludeViews = .t.
Filter.IncludeSystemTables = .t.
 
?cn.listtableswithtypes(Filter)


 

Action Javascript - Action Selector - Now filters out ineligible actions for the current component type, rather than displaying a message after you make a selection telling you that the action is not available for the current component type.

Grid Builder - SQL - Schema Changes - Previously if you changed the data type of a field in your SQL database after you had already added that field to a Grid, you would need to deselect and then reselect the field for the field type change to be recognized. Also if you changed the Grid from being based on a single table, to being based on multiple tables, you would need to deselect a field and then reselect it in order for Alpha Five to recognize that the field needed to be qualified with a table alias when searching or sorting on that field. Now, when you edit the SQL query, or click the 'Refresh fields' icon, Alpha Five automatically fixes the Grid to reflect all schema changes.

Application Server - Internet Explorer - Adobe Acrobat - PDF Files - The Application Server adds new functionality to work-around a bug in Microsoft Internet Explorer which breaks the display of PDFs. The cause of these PDF display problems is a well-documented race condition in IE, going back to at least IE 4.0. (There is a lot of discussion on Adobe's Message Boards concerning this issue.)

Just to be clear: This is NOT an Alpha Five bug.

Up until now, the only work-around for this Adobe/Microsoft bug has been to globally turn off gzip compression at the server level. However, this has the negative side effect of decreasing overall application performance - particularly on a slower network such as those used by mobile devices.

Now, the Application Server will specifically recognize that a PDF has been requested from an IE client, and not compress the output in only this very specific case. If a PDF is requested from any other browser software, the output will still be gzipped since all other browsers properly handle the compressed PDF response.

The Alpha Application Server bypasses the IE bug that is breaking PDF files for some users without impacting the overall server performance as would be done if gzip were to be globally turned off or even turned off for a single file type (PDF) across all browsers. As a result, the Application Server mitigates a bug in Microsoft's code for Internet Explorer with an absolute minimum of impact for non-buggy client software. This goes well beyond the functionality of other servers (such as IIS or Apache) which do not target specific browsers with their gzip compression functionality and thereby reduce performance for all clients because of an IE-specific bug.
 

Xbasic - DIMMing Variables - A change has been made in how Xbasic operates when DIMMing a dot variable. If the user has not explicitly specified the scope in the DIM statement, Alpha Five will now try to see if the dot variable parent container already exists in all scopes (GLOBAL, SHARED, etc. ) and if so, it will DIM the variable in that scope rather than creating a new locally scoped variable.

 

It is possible that this change will break an existing application in some way. We think that chance of this breaking existing applications is extremely small, but if so, the change to your Xbasic to fix the problem will likely be very simple, as explained below.

 

The following example will illustrate the point.

 

dim global myGvarContainer.myvar1 as c = "alpha"

dim myGvarContainer.myvar2 as c = "beta"

 

In the above example, the user was explicit about the scope in the first statement, but not the second statement. As a result, with the previous version of Alpha Five, the following variables were created:

 

myGvarContainer - a pointer variable in the Global name space

myGvarContainer.myvar1 - a character variable in the Global name space

myGvarContainer - a pointer variable in the Local name space (created by the second command)

myGvarContainer.myvar2 - a character variable in the Local name space

 

Now, as a result of the change, the following variables are created by the above two commands:

myGvarContainer - a pointer variable in the Global name space

myGvarContainer.myvar1 - a character variable in the Global name space

myGvarContainer.myvar2 - a character variable in the Global name space

 

In the above example, had the second DIM statement been written as:

dim global myGvarContainer.myvar2 as c = "beta"

 

the the old behavior of Alpha Five and the new behavior would have been identical.

 

To reiterate the point here, if you look at the second DIM statement above, you see that there is no explicit scope. But since Alpha Five can find the variable container ('myGvarContainer') in the Global name space, the new variable ('myvar2') is created as a child of the existing variable in the Global namespace, rather than creating a new variable in the Local name space.

 

In the above example, if you want to preserve the old behavior, you can easily do so by adding this extra DIM statement (shown in red):

 

dim global myGvarContainer.myvar1 as c = "alpha"

dim myGvarContainer as p

dim myGvarContainer.myvar2 as c = "beta"

 

Now there will be two 'myGvarContainer' dot variables - one in the Global name space and one in the Local name space, and the DIM statement for 'myvar2' will create a Local variable (just as it did before this change was introduced).

 

Why was this change made? The reason this change was made is that users were breaking their Web applications by writing code like this

 

dim session.var1 as c  = default ""

 

The reason for doing this was to ensure that a session variable existed before its value was tested. For example:

 

dim session.var1 as c  = default ""

if session.var1 = "value1" then

    'do something

end if

 

This would not work as the user was probably expecting because the DIM statement was actually creating a LOCAL variable called 'session' and then DIMming 'var1' as a child of the LOCAL 'session' variable.

The user was likely expecting the above DIM statement to DIM 'var1' in the Global 'session' object.

Now, as a result of the change made in this build, the above statement will DIM var1 in the Global 'session' object.

Note however, that this code pattern would still be wrong and would lead to errors:

 

dim session as P

dim session.var1 as c  = default ""

if session.var1 = "value1" then

    'do something

end if

 

This would create a LOCAL variable called 'session' that would mask the global 'session' object and 'var1' would have been created as child of the local 'session' variable.

 

Bottom Line: Do not put 'Dim session as p' in your Xbasic code in Web Applications unless (in the incredibly unlikely event) that you actually want to create a local variable of type P in the LOCAL name space.

Bugs

Grid Component - Search Part - The [class.searchPartHeader] abstract class name placeholder was not getting replaced in the Search Part Title if show/hide Search Part had been enabled.

Grid Component - Group Breaks - Computed Columns - Grid did not support breaking on a computed column.

Grid Component - Query by Example - Security - If a column in the Grid was hidden because the user was not in a security group that allowed access to the field, the corresponding field in the QBE row was not hidden, as it should have been.

Grid - Detail View - Pre-fetch - Server-side Events - CanInsertRecord and CanDeleteRecord - If the event cancelled the action, you would get an error. Only happened if Detail View was set to pre-fetch.

DBF Tables - Table.Create() Method - An Xbasic script that used the table.create() method was failing when the number of fields in the table to be created was extremely large (over 800 fields).

Script Editor - Format Code - Capitalization  - The Format Code button, which fixes the indentation on code in the Script Editor, has been changed to not capitalize commands. The reason that this change was made was because the format code button can also be used when editing Javascript code and since Javascript is case sensitive, capitalizing commands in Javascript breaks the code.

Grid Component - Editable Grids - The 'Error Column' - used to show when a row level error has occurred - had two 'style' tags, causing the style attributes in the second tag to be ignored. This is now fixed. You will need to edit and resave your Grids. This is a minor change - most users would never notice the difference.

Dialog Component - .getValue() Method - Client-side Calculated Fields  - Was not reading the value of fields that were set using a client-side calculated expression if the dialog was not dirty. You will need to edit your Dialog component and select the Menu, Recalculate all controls command to before this fix will work in your components.

Dialog - Repeating Sections - Changing the Repeating Section Id - Would cause a Javascript error at run-time unless you recalculated all controls. It is no longer necessary to recalculate all controls.

Dialog Component - Repeating Sections - Action Javascript Actions - Three action in Action Javascript - Zip code lookup from Address, City, State Lookup from Zip code and Lookup and Fill-in - were not working if the source and target fields were in a Repeating Section.

Dialog Component - Lookup Grid - Dynamic Filtering - If dynamic filtering of a Lookup Grid was turned on, and the filter method was changed from Link to User Filter, advanced search operators, such as 'contains any of', 'starts with', etc. were not working correctly.

Dialog Component - Dropdownboxes - Design Time - Unnecessary Recalculation - If you had a large Dialog with a large number of Dropdownbox controls, editing a property in any of the Dropdownbox controls would cause all of the Dropdownbox controls on the Dialog to recalculate. Now, the Dropdownboxes only recalculate if you change the 'Has Cascading Choices' property when editing the Dropdownbox choices.

Dialog Component - Summary Calculated Fields - Repeating Section - Delete Row - The summary calculations were not automatically recomputed after you deleted a row in a Repeating Section.

Dialog and Grid - Edit-combo Box - Displaying Errors - If an error was displayed for a field that was an edit-combo, a red border was not drawn around the control. Only the error-icon was displayed.

Dialog Component - Repeating Section - Control Type of 'Hidden' - If you set the control type of a field in a Repeating Section to 'Hidden' the control does not inject any space in the Repeating Section.

Dialog Component - Label Controls - Repeating Sections - If you placed a Label control in a Repeating Section, it did not honor the width property of the control and as a result, the layout of the Repeating Section was messed up.

USPS Functions  - The following functions have been updated. These function work by 'scraping' the response from a query made to the USPS web site. From time to time the USPS changes the layout of their screens, which result in the need to update the following functions.

USPS_City_From_ZIP()
USPS_CityState_From_ZIP()
USPS_Delivery_Status()
USPS_State_From_ZIP()
USPS_ZipCode_Lookup()

Grid Component - Converting a Grid into a Dialog Component - Fixed a crash if the Grid had a Container control.

AlphaDAO - Export from DBF - SQL Server - Fixed a problem when exporting to older versions of SQL Server.

Grid and Dialog Component - Auto-Suggest Control - Fixed a problem when the user entered an international character.

Grid Component - Tree Control Navigator - Order - Order builder was not working correctly.

Export - SQL Server - Exporting a .dbf table to SQL Server would fail if the SQL Server instance to which you were exporting was an older version of SQL Server.

Grid Component - Fetch More Records Mode - Row Expander Icon - The server-side event to turn off the + icon for the row expander was not being honored in rows displayed in response to clicking the 'Fetch more records' button.

Forms - Sets - One-to-One Links - Sorting - A fix was made to forms based on a set with a one to one link where the child table had an order expression.

Active-Link Tables - Chinese Characters - Some additional fixes for using active-link tables with Chinese characters.

Dialog Component - Checkbox Controls - Show/Hide Client Side Expressions - Occurs() Function - Client-side show/hide expressions that used the occurs() function to test if a particular value in the checkbox was checked were not working correctly.

Grid - Client-side Events - onNewRowsShow Event - This event was firing as soon as the action was executed, but before the new rows were actually shown. Now, it is fired after the new rows have been shown.

Dialog Component - Client-side Calculated Summary Values - New Record Action - Would sometimes cause a Javascript error if you had calculated fields that referenced more than one summary value.

Active-Link Tables - Chinese Characters - Fixed some issues with active-link tables that contained Chinese characters.

Dialog Component - Multiple Repeating Sections - SQL Tables - Server-side Action Script to Save Record - If you used the Server side Action Scripting Genie to generate code to save submitted data to tables, the code generated by the Genie would insert blank records into Repeating Section tables even if the Repeating Section had not been edited. This bug only occurred if you had more than one Repeating Section, and if your Dialog was bound to SQL tables.

Dialog Component - Special {dialog.embedded...} Placeholder - In a recent update a new type of placeholder was introduced for use in Javascript events that allowed you to easily address embedded components in a Dialog. For example:

{dialog.EmbeddedGrid_EMBEDGRID1}

This placeholder was not being resolved when the Dialog was loaded on an Ajax callback. It was also not being resolved if it was used in an Ajax response.

Dialog Component - Date Fields - Javascript Events - If the calendar was set to open when the user clicked an icon (as opposed to giving focus to the field), the Javascript events were not being generated.

Dialog Component - Copy Controls to Clipboard - Would fail if a particular action had two or more event handlers that were defined using Action Javascript.

Forms Based on a Set with One-to-Many Link - Linked Browse for Child Table - Calculated fields on an linked browse were not working - Calculated fields in a saved browse definition are fixed up when the browse is embedded into a form based on a set.

Reports - Table of Contents, Bookmarks and Index - If you added a TOC, Bookmarks, or Index to a Report, it was not possible to completely remove the TOC or Bookmarks if you decided that you no longer wanted them. Now, there is a new item on the menu that allows you to turn off Bookmarks, TOC and Index.

 

 

 

 

Tips

How To Tell What Size Browser A User Has - Say that you have an application in which, after login, you want to redirect to a different page depending on the size of the user's browser window. Here is how you can do this:

After login, redirect to a page like this:

 

<html>
    <head>
        <script>
function getVPSize(){
    if(typeof window.innerWidth == 'number')
        return {width: window.innerWidth, height: window.innerHeight};
    else if(document.documentElement && (document.documentElement.clientWidth ||     document.documentElement.clientHeight))
        return {width: document.documentElement.clientWidth, height: document.documentElement.clientHeight};
    else if(document.body && (document.body.clientWidth || document.body.clientHeight))
    return {width: document.body.clientWidth, height: document.body.clientHeight};
}

function load() {
    var obj = getVPSize();

    if(obj.width < 400) window.location = 'screenSmall.a5w';

    else if(obj.width < 1000) window.location = 'screenMedium.a5w';

    else window.location = 'screenBig.a5w';
}
</script>
</head>
<body onload="load()">
</body>
</html>

 

 

Dialog Component - Client Side Expression - Removing Calculation Order Dependency - In rare situations you might find that client-side calculations do not compute correctly because there is an assumed dependency in the order in which the calculations are done. The Dialog builder does not give you any control over the order in which client-side calculations are performed (other that the order in which the controls are defined).

If you run into a problem (which you cannot solve because changing the order in which the controls are defined in the builder is not an option), you can remove the calculation order dependency by 'fully resolving' all expressions. For example:

Say you have these fields:

Field_A

Field_B

Field_C



The expression for Field_B is:

Field_A * 2

 

The expression for Field_C is:

Field_B * 2

 

Replace the expression for Field_C with:

(Field_A * 2 ) * 2

 

Now, the expression for Field_C does not depend on the expression for Field_B having been computed first.

 

Dialog Component - Calendar Control Feature Pack - How to Set the Calendar High/Low Date Using Javascript - This note describes how you can programmatically set the calendar high and low dates.

Assume that the calendar is bound to a variable called 'DATE_END'.

 

//get a pointer to the calendar object
var d2 = {dialog.object}.getControl('DATE_END');
d2.datePicker.disabledDates.low = '8/2/2012';
d2.datePicker.disabledDates.hgh = '1/1/2014';
d2.refresh();

 


 

Dialog Component - Slider Control Feature Pack - How to Set the Slider Min/Max Using Javascript - This note describes how you can programmatically set the slider min and max values.

Assume that the slider is bound to a variable called 'RATING'.

 

//get a pointer to the slider object
s1 = {dialog.object}.getControl('RATING');
s1.value = 67;
s1.min = 10;
s1.max = 150;
s1.refresh();

 

Client-side Formatting - Initial Focus when Tabbing Into Control - If a control in a Dialog or Grid uses Client-side formatting, when the user tabs into the control, the client-side formatting is temporarily removed so that the user can edit the value. In Internet Explorer, there is 'bug' in that the insertion point is set after the first character in the control. (In other browsers all of the text in the control is selected).

To work around this quirk in Internet Explorer, you can defined the following event handler for the control's onFocus event:

setTimeout(Function('$(\'' + this.id + '\').select();'),1);

 

Clarification

Dialog Component - Server-side Events - RTC Object - Some users have asked questions that indicate some confusion about the use of the 'rtc' dot variables as a technique for passing data from one server-side event to another event. In particular, one user was confused why data set in the rtc object in the OnDialogInitialize was not available in an Xbasic hander for an Ajax callback.

 

The 'rtc' dot variable (named for 'run-time calculation') is passed into all server-side events and is a means for the developer to pass user defined data from one server-side event to another server side event. For example the value set in the rtc dot variable in the DialogValidate event can be read in the AfterDialog event.

Howerver, a value put into the rtc object in (say), the onDialogInitialize event cannot be seen in the Xbasic function that handles a user-defined Ajax callback. Here is why.

Data put into rtc only exists for the duration of the server side code that executes the Dialog. The rtc object is is not persisted between callbacks.

So for example, when the Dialog is initially run the onDialogInitialize event fires then the onDialogExecute fires.

Therefore, if you set a value in rtc in onDialogInitialize, it will be available in onDialogExecute.

Then once the Dialog has been rendered in the browser, if you click a button that does an ajax callback, this is what happens:

The onDialogExecute fires, then the event handler for your event fires. This could be an Xbasic function to handle an Ajax callback, or it could be the DialogValidate or AfterDialogValidate event.

The key issue here is that the onDialogInitialize event does not fire and the other key point here is that this is a new server side action now, completely distinct from the server side action that initially displayed the Dialog.
Therefore values that were set in rtc in the initial onDialogInitialize event are long gone.

Another way of stating this is that you can't use the rtc object as means of storing state. However, the Dialog does have its own ways of storing state and making the saved state available on all subsequent callbacks.

There is a dialog object method called .setStateInfo() that allows you to store any data you want in the Dialog's 'State' object. Information in the Dialog's 'State' object is passed to all server-side events.


You can also put information into the 'State' object from a server side event by setting a property in this object.

 

e._state

 

For example:

e._state.myvar = "alpha"



Having done this, in all subsequent callbacks, you will be able to see e._state.myvar

 

 

 

Build 2373_3862 - Jan 20 2012

Installation Notes

Build 2373_3862 has a known problem creating a CSR (Certificate Signing Request) used for purchasing an SSL certificate from a 3rd party vendor. NOTE This issue was fixed in the subsequent update.

 

http://msgboard.alphasoftware.com/alphaforum/showthread.php?97977-Known-problem-creating-a-CSR-in-Build-2373_3862-Jan-20-2012&p=596176
 

 

libeay32.dll File - Install Location - In the previous patch, the location where the libeay32.dll file (a 3rd party DLL used by many different programs, including Alpha Five) was installed was changed from the Alpha Five Program Folder to the Windows System32 folder. While this is technically the correct location for this file, some users were experiencing problems because the installer was not able to install into System32. As a result, we have decided to favor expediency over theory, and have now reverted to installing libeay32.dll in the Alpha Five Program Folder.

 

Warning Message During Install on XP - When installing this update on an XP machine, you will receive this warning. YOU CAN SAFELY IGNORE THE WARNING. The warning is being displayed when the Amyuni Printer Driver (which we bundle with Alpha Five to do PDF printing and other PDF operations) is being installed. We are shipping a new version of one of the Amyuni DLL files which fixes a bug in the PDF_Append() function. (See 'Bugs' section below).

 

 

 

 

 

Features

 

Dialog Component - Referencing Session Variables on the Client Side - The Grid Component allows you to 'publish' session variables to the client side so that your client side expressions (e.g. show/hide, calc fields, etc.) can reference session variables. The same concept of 'publishing' session variables to the client-side did not previously exist for the Dialog component. Now, the Dialog also allows you to 'publish' the value of session variables.

The Dialog Builder now has a new property: Properties, Other, Published Session Variables where you can define the session variables you want to publish.

When the Dialog is executes, the values of the published session variables are stored in the Dialog Objects' _vars object.

For example, if you publish a session variable called 'VAR1', you can use the following Javascript to read its value (the name is always uppercase):

{dialog.object}._vars.SESSION.VAR1

 

The following example shows how you can set the text of a button control in the Dialog to the value of a session variable (session.var1).

The following code is in the onRenderComplete client-side event:

 

var sVar1 = '';

//check to see
if(typeof {dialog.object}._vars.SESSION.VAR1 != 'undefined') {

     sVar1 = {dialog.object}._vars.SESSION.VAR1;

}

//set the innerHTML of button 'button_1'
if(sVar1 != '') $('{dialog.componentname}.V.R1.BUTTON_1').innerHTML = sVar1;
 

 

 

Dialog Component - Unformat Property - Has been removed as it was not needed since the data can be unformatted in the DialogValidate event. For example, 

e.dataSubmitted.amount = stritran(e.dataSubmitted.amount,"(Dollars)","")

 

 

Dialog .getValue() on a Label Control - Would always return the original value of the label (even if the label's value had been previously changed using the .setValue() method. This is now fixed so that .getValue() will always read the label value from the control itself.

The reason that .getValue() previously worked they way it did was that, generically, the .getValue() method returns the control value from the .originalValues[] array in the Dialog Object if the control is NOT dirty, but reads the control value from the control itself if the control is dirty. When you use .setValue() on a Label, the control does NOT go dirty (because a Label control has no concept of being 'dirty' since it is not an input control).

 

 

 

a5_mergeDataIntoTemplate() Function - Using locally defined Xbasic Functions - The power of the a5_mergeDataIntoTemplate() Function has been significantly enhanced by allowing you to define local Xbasic functions and then reference these functions in your template. The following example code shows how this is done.

 

'Create a string with some locally defined functions

dim xbasic as c
xbasic = <<%code%
    function myxb1 as c (data as c )
        myxb1 = "XXX:" + data
    end function

    function myUT as c (data as c)
        myUT = ut(data)
    end function
%code%
 

'Compile the local functions
dim lf as p
lf = compile_template(xbasic)
 

'The template references the local functions. Note that in order to reference

'a locally defined function, the function name is prefixed with 'lf.'
template = <<%html%
<li>
Name: {lf.myUT(ds.data("firstname"))} {lf.myxb1(ds.data("lastname"))}
</li>
%html%

dim dataSource[0] as p
dataSource[].firstname = "John"
dataSource[..].lastname = "Jones"

dataSource[].firstname = "Richard"
dataSource[..].lastname = "Smith"

 

dim result as p
dim htmlstring as c

'call the a5_mergeDataIntoTemplate() function and pass in a pointer to the

'locally defined functions
htmlstring = a5_mergeDataIntoTemplate(template,dataSource,result,lf)
 

 

 

Htmlstring will look like this:

 

<li>
Name: JOHN XXX:Jones
</li>
<li>
Name: RICHARD XXX:Smith
</li>
 

 

 

Bugs

Grid Component - Detail View - Edit on Demand - When you entered a new record, buttons that had been placed in the Detail View would disappear.

Dialog Component - Embedded Components - Radio and Checkbox Controls -  Duplicate Control Names - .setValue() and .getValue() method - Assume that you had a Dialog with a checkbox control called 'Colors' and that this Dialog contained an embedded Dialog which also had a checkbox control called 'Colors'. Although the 'Colors' control on the embedded Dialog has a unique ID, it does not have a unique name and as a result the .setValue() and .getValue() methods of the Dialog object would not work reliably. This comment ONLY applies to checkbox and radio button controls. This is now fixed.

PDF_Append() Function - The PDF_Append() function (which is based on the 3rd party Amyuni Printer Driver which Alpha Five bundles) was not working reliably for certain PDF files. Amyuni has supplied us with an updated DLL which fixes the problem. The patch installer should install and register the new DLL automatically. If you are still having trouble with the PDF_Append() Function after installing the patch, you should try manually registering the cdIntf.dll file in the AmyuniV4 folder in the Alpha Five Program Folder.

Sybase - SQL Anywhere - The previous update introduced a problem when using SQL Anywhere. This is now fixed.

Grid Component - Detail View - Character Fields - Display Format - Pre-fetch Option - Was not honoring the Display Format property when a record from the Grid Part was selected and displayed in the Detail View part.

 

 

Build 2365_3859 - Jan 16 2012

 

Change in Behavior

Grid Components - Numeric Fields - Regional Settings That use Comma For Decimals - If the regional settings on the server use a comma for decimals, when a Grid is rendered, all decimal places will be rendered as commas, without requiring the developer to define a Display Format for the field. Previously, if you wanted the field to render with a comma as the decimal separator, it was necessary to define a Display Format for the field.

 

Clarification

Dialog Component - DataBinding - Binary Image Data and Linked ImageFields - Some users have reported that they are not able to bind a Dialog Component to a field in a table that contains a binary image, or (in the case of .dbf tables) a Linked Image Field when using the various Genies provided by Alpha Five.

This is NOT a bug.

While it is certainly possible to write your OWN code in the Dialog's onDialogInitialize event to extract the image from a binary field in the table, and set the image source on the Dialog to this value (encoding the binary data appropriately), it is not something that is currently built into the Genies.

If you do not want to write your own code, and you require a component that displays an image that is bound to a field in a table, then you should use the Grid component, where this functionality is available.

 

New Videos

A new series of videos have been released. Click here to see all Videos.

D32 - Dialog Component - Embedding a Grid Component inside a Dialog Component and Executing Methods on the Grid from the Dialog

M39 - Edit-Combo Control - AfterSelect Event -  Using the AfterSelect event in an Edit-Combo to initiate an Ajax callback.

M40 - Action Javascript - Location -  Getting the User's Current Location and Tracking Location Changes using Action Javascript

GM16 - Maps - Zoom Level - Setting the zoom level of a map in an Alternate View on a Grid after the user executes a Query.

D33 - Dialog Component - Duplicate and Copy Rows in a Repeating Section

M41 - Grid Component - Setting Session Variables when a Child Component is Opened using Action Javascript

D34 - Dialog Component - Extended Dialog Demo Showing How Tables Can be Created from the Dialog Definition, and Data Can Be Entered into Repeating Sections

D35 - Dialog Component - Moving rows in a Repeating Section up or down.

M42 - Grid Component -  Displaying the Value of an Argument that Was Passed into a Grid.

D36 - Dialog Component - Sorting rows in a Repeating Section on any column in the Repeating Section.

M43 - Understanding Global Javascript Variables and the 'Window' Namespace.

D37 - Opening a Component and then Executing Javascript Code in the Target Component - Circumventing the Asynchronous Nature of Ajax Callbacks.

M44 - Grid Component - Data can be filtered based on the current logged in user. This video shows how to set a filter in a grid using a session variable. The session variable is then populated on a page containing a login component by finding the current logged in user name and then finding a matching record in a table.

D_SF_4 - Modifying the Security Account of an Existing User and Update Personal Information in a Related Table using a Grid.

 

Features

Dialog Component - Saving Values that are Not Dirty - By default, if you use the Server Side Action Scripting action to save submitted data to a table, only dirty fields are saved when an existing record is edited. In the DialogValidate and AfterDialogValidate event you can not use Xbasic to adjust the list of 'dirty' fields by setting the value of the e.dirtyColumns property. The default function prototype for these two events explains this in more detail.

 

Dialog Component - Methods for Moving Rows in a Repeating Section - The following new methods have been added to the Dialog object:

For more information, see video D35. Click here to see all Videos.

 

Dialog Component - Frames - Modern Style - Javascript Functions - You can now optionally specify the name of a javascript function to call when a Frame is opened or closed.

 

Action Javascript - Open a Component - Set Session Variables - You can now set the value of session variables when you execute an action defined using Action Javascript to open a Grid, Dialog or Custom Component.  See Video M41 for more details. Click here to see all Videos.

 

Grid Component - Client-side Events - New Event - onGridRenderComplete - A new client-side event has been added. The onGridRenderComplete event fires as the very last event when the Grid is rendered. The motivation for adding the event was to make the following easier for developers:

Say you added this code to the onGridInitializeComplete event:

{grid.object}.setValue('G','LASTNAME',1,'Smith')

 

This would not work as expected (the field value would be set, but the row would not be dirty) because the event would fire before all of the system events in the Grid had fired and the system events would cause the Grid to revert to a 'clean' state. The technique that developers would need was to wrap their code in a Javascript setTimeout() function.

Now, with the onGridRenderComplete event, you can simply add the code above to the event, and it will work as expected.

 

Dialog Component - Client-side Events - New Event - onRenderComplete - See discussion of the Grid onGridRenderComplete event.

 

Dialog Component - Repeating Sections - New Methods - Duplicating and Copying Rows

 

{dialog.Object}.duplicateRepeatingSectionRow(repeatingSectionID) - Copies the values in the current Repeating Section row to a new row. The first non-dirty Repeating Section row is used as the target row. If there are no non-dirty Repeating Section rows, a new row is added to the Repeating Section.

{dialog.Object}.copyRepeatingSectionRow(repeatingSectionID, sourceRow, targetRow [, flagPromptIfTargetRowDirty])

Copies the values from one row in a Repeating Section to another. If targetRow = -1, then the current row with focus is the targetRow. If the target row is dirty, a confirmation prompt is displayed, unless flagPromptIfTargetRowDirty is false
 

 

Tabbed UI nd Page Layout Builder - Specifying the Alias for Components - Previously, even if you overwrote the default alias of <DefaultAlias>, Alpha Five would still use a system generated alias for the component. Now, if you specify an explicit alias, it will be used, subject to the following rules:


In the tabbedUI, if you specify an explicit alias, it will be used exactly as specified (converted to upper case). So if you specify 'mygrid' the grid's alias will be 'MYGRID'

In the pageLayout, if you specify an explicit alias, it will be prefixed with the alias of the Page Layout. So if the alias for the pageLayout is 'mypl', the alias for the grid will be 'MYPL_MYGRID'.
 

 

Dialog Component - Hide/Show Column in Repeating Section - A new method has been added to the Dialog object to hide or show a column in a Repeating Section.

Syntax:

{dialog.object}.hideRepeatingSectionColumnName(columnName [, mode]);

 

Values for 'mode' are:

 

Dialog Component - Action Javascript - Open a Dialog to Edit Current Record in Grid Action - When you use this action and the mode is set to 'EditExistingRecord' the Dialog component will now populate a dot variable called 'e.rtc._data' that can be used in the Dialog's 'onDialogInitialize' event to get access to the data that is being loaded into the Dialog Component.

 

Grid Component - Auto-Refresh - You can now specify that the Grid should automatically refresh itself. In the Grid, Properties section in the Grid Builder, there is a new property - 'Auto-refresh Grid'. If you check this property, you can then specify the refresh interval (in seconds). Important: If the Grid is dirty (i.e. a row in the Grid Part, or Detail View Part is currently being edited, the Grid will not be refreshed).

 

In addition, the Grid Object now has two new methods:

{grid.object}.autoRefreshStart(interval) - where interval is expressed in milliseconds. For example, to refresh the Grid every 30 seconds, you would use an interval of 30000. (Note: In build 3844 the method is called .startAutoRefresh(), but it has since been renamed)

{grid.object}.autoRefreshStop() - stop auto-refresh

Also, a new client-side event has been added - onBeforeAutoRefresh - This event is fired immediately before an auto-refresh is performed. If the event returns false then the refresh will not take place (but the next scheduled refresh will still take place)

 

Reports - System Fields - PageCount - A new system field, PageCount has been added to the DragDrop list for reports.

Dialog Component - Embedding Other Components in a Dialog - You can not embed other component types, Reports, .A5w Pages, and PDF Documents in a Dialog component in exactly the same way that you can embed these objects into a Page Layout component. There is a new item in the Other Controls section called Embedded Object. The Dialog Component is now a complete superset of the Payout Layout component.

 

 

When you click the Embedded Object button the standard dialog used in the Page Layout and Tabbed UI component is displayed.

Note that is is possible to embed a Dialog component into a Dialog component!

When you embed a Grid, Dialog or Custom component into a Dialog, the builder allows you to specify the component alias. It is recommended that you override the default suggestion and enter an explicit alias. This alias must be unique to the current Dialog component. The reason for this is that it makes it easier to get the alias of the embedded object so that you can execute methods on the embedded object. For example, you might want a button the parent Dialog to execute a .submitGridPart() method on an embedded Grid. (See section below about new placeholders that can be used in Javascript code.)

Dialog Component - Javascript - Placeholders for Embedded Object Names - When you embed a Grid, Dialog or Custom Component in a Dialog you will likely want to execute methods of the embedded object. You can now use special placeholders in your Javascript. For example, assume that you embedded a Grid component into a Dialog, and you gave the Grid an explicit alias of EMBEDGRID1.

Now, assume you want to execute the .submitGridPart() method of the embedded Grid from a button the Dialog. You could use this code in the event handler for the button's onClick event:

 

{dialog.EmbeddedGrid_EMBEDGRID1}.submitGridPart()

 

TabbedUI - Hide Buttons Pane Completely - A new property has been added to the Tabbed UI to allow you to completely hide the buttons pane. If this property is checked, then you will need to ensure that the tab panes that you want to have opened are opened automatically, by checking the 'Auto-launch on startup' property for each required pane.

TabbedUI - Can Close Tab Pane - A new property has been added to each tab pane allowing you to turn off the close button in the tab pane. If you disable the close button on the tab pane, the user cannot close a tab pane by clicking on the x icon in the top right corner of the tab pane. This means that the only way in which a tab pane could be closed after it has been opened is by Javascript automation.

 

Application Server - Processor Core Usage - As of this build, the default behavior for Alpha Five executables will be to restrict execution of the XBasic interpreter to a single processor, but allow other C and C# code to execute on any processor available to the current process (as determined by the “process affinity mask”). Previously, all code was restricted to a single processor. As a result of this change, you may see improvements in the throughput and responsiveness of the Application Server.

During the course of the testing phase of this pre-release update, we will be trying to identify if there are 'race' conditions which result in unexpected errors in Web applications.

For debugging purposes, the functions below allow you to read and write the global setting that controls this behavior: The default value of ThreadSafetyByProcess() is now FALSE. The functions can be called from any script, function, interactive session or web page and affect the entire process.


SetThreadSafetyByProcess as V (ByProcess = .t.)  - Sets the behavior of Alpha Five (or the application server) limiting all threads (by process) to a single processor. If ByProcess is .t., then all threads are limited to a single processor. If ByProcess is .f., then only Xbasic interpreter threads are limited to a single processor.

ThreadSafetyByProcess as L() - Returns the current state of the environment: true or false. These values correspond to the ByProcess argument in the SetThreadSafetyByProcess() Function.


NOTE: These two functions are temporary, (for the duration of the testing phase of this pre-release update) and will not be documented in the Wiki. They are included so that, if during your testing your run into a situation that appears to be a race condition, you can fall back to the previous behavior to see if that fixes the problem.


The thread transition log now contains an additional value at the end (also in the trace file). This value is the affinity mask of the thread when the event record is being written. The mask is a set of bit values corresponding to each processor on the machine. A value of 1 indicates that the processor can be used to schedule the thread. A value of 0 excludes the processor from scheduling for the thread. The position of the bit (from right to left) corresponds with the number of the processor (beginning with zero on the right).

For example:

128 in binary is 1000 0000 - meaning that processor number 7 (processors are numbered from zero) is the only processor the thread will execute on.
255 in binary is 1111 1111 - meaning that processors numbered 0 through 7 are potential targets for the thread.

Obviously, the number of processors on the system will determine the actual values.

We automatically choose the highest numbered processor and try to avoid having two Alpha processes select the same processor to execute on. If you run two instances of Alpha Five, you will see different processors selected.

 

Grid Component - Detail View - Open Detail View on Row Click or Double Click - Cursor for entire Grid row is now set to a pointer (hand icon).

 

Grid Component - Fetch More Record Navigation Style and 'Pull down' Mode - Bottom Footer is now suppressed when the navigation bar is empty.

 

Dialog Component - Right Click on Controls in Tree List - You can now right click on a control in the tree-view to get a quick list of actions that can be performed.

 

Grid Component - Tree Control Navigator - Complex Query Mode - Session Variables -  If you switch your tree to use complex query mode, you can now use session variables in the SQL statement WHERE clause, or in the case of .dbf tables, in the .dbf filter expression.

For example:

SELECT DISTINCT country FROM Customers where country = session.whatCountry ORDER BY Country

 

Reports - Save as Plain Text - Reports that are based on the new Layout Table metaphor in V11 now can be exported to plain text with dramatically improved efficiency and fidelity because the export no longer uses the Amyuni printer driver. Instead, the report is directly converted to text without going through a printer driver.

 

Grid and Dialog Component - Action Javascript - Getting User's Location - New actions in Action Javascript to get the user's current location and watch changes to the current location. See Video M40 for more information.

 

*If_error(expn,errorExpn) Function - A utility function that returns the result of expn if expn is a valid expression, else returns the value of errorExpn.

 

dim goodvar as c = "alpha"

?*if_error(goodvar,"not found")

= "alpha"

?*if_error(goodvar,"not found")

= "not found"

 

html_to_text() Function - This function now takes an optional length argument. If you specify this value, then the conversion of html to text stops when the specified length of plain text has been reached.

 


Application Server - SSL - The OpenSSL libraries used by the Application Server to enable SSL have been updated to the latest release (1.0.0e). Additionally, the documentation regarding encryption algorithms has been updated with instructions on using your own OpenSSL DLLs (http://wiki.alphasoftware.com/Encryption+Algorithms).
 

Application Server - Performance -  A number of optimizations have been made to the Application Server in order improve the overall server performance.

 

Scroll Wheel - View, Settings, Preferences - Scroll wheel scrolling option can now be set in the View, Settings command.

 

Scroll Wheel - New Xbasic Commands to Control Scroll Wheel Scrolling


' Force three lines of scrolling per wheel increment

a5.System_Mode_Set("edit_scroll_wheel_increment","3")


 

' Force ten lines of scrolling per wheel increment

a5.System_Mode_Set("edit_scroll_wheel_increment","10")


 

' Revert to default

a5.System_Mode_Set("edit_scroll_wheel_increment","0")

 

 

Dialog Component - Data Binding - SQL Tables - Define Primary Key - If a table has multiple columns in the primary key, you can now control the order in which the fields are selected in the Primary Key. This is important because the order in which the fields in the Primary Key are selected is relevant.

 

*html_stritran() Function - Identical to the stritran() Function, but assumes that the input string is HTML text and does not make any replacements in attributes or tag names. This function is useful for highlighting text in an html string.

 

html = <<%html%
<p class="xbasic">Dim txt as c  = "xbasic"</p>
%html%
 

?*html_stritran(html,"xbasic","<span style=\"color:red;\">xbasic</span>")

<p class="xbasic">Dim txt as c  = "<span style=\"color:red;\">xbasic</span>"</p>
 

Application Server - The Logging tab on the Application Server Settings has new buttons to open individual logs as well as the trace log folder.

 

Video Finder - A large number of instructional videos have been recorded for Alpha Five. Finding the video that addresses the issue you need help on can be difficult. Therefore, we have included a new utility to help you find the correct video. Watch Video.

There are two ways in which you can open the video finder: From the Help menu, or by clicking the Video Finder button on the Web Control Panel.

 


Reports - Custom Table of Contents - New Function *parent_report_pagecount() - When you add a table of contents to a report, you have the option of designing a custom table of contents report. Now, when you are designing a custom table of contents, you can use a new function to get the page count in the parent report for which you are defining a table of contents.

toc_pageCount = *parent_report_pagecount()
 

Note: The problem with using the pagecount() functon in the custom table of contents report is that it represents the number of pages in the table of contents report, not in the main report for which the table of contents was generated.

 

 

Dialog Component - Repeating Sections - Sorting Data - A new method has been added to the Dialog Component to sort the data in the Repeating Section by a specified column. See video number D36.

{dialog.object}.sortRepeatingSection(sectionId, columnName, direction)

 

where sectionId is the id of the Repeating Section, columnName  is the name of the column to sort on, and direction is either 'A' or 'D' (ascending or descending).

 

Dialog Component - Builder - Significant improvements in the responsiveness of the Dialog Component Builder when editing very large Dialog Components with multiple Repeating Sections.
 

 

Grid Component - Action Javascript - Open a Dialog - New Property - Use cached Dialog - The Action Javascript action open a Dialog now has a new property that will, in certain circumstances, allow for a significant improvement in performance the SECOND and subsequent time the action is invoked.

A new property allows you to specify that  a cached version of the Dialog should be used the second and subsequent time that the Dialog is opened.

The performance improvement will only be noticeable on large Dialogs.

To see the change, you will need to edit and resave your action.

 

Dialog Component - Compute Data Binding At Design Time - Normally, when you have bound a Dialog to tables using the Data Binding Genies in the Dialog component, the code that is executed by the various Data Binding actions is computed at run-time. In the case of Dialogs that are bound to a large number of tables, this can impose a performance penalty. Now, a new option has been exposed to compute Data Binding code at design-time. The drawback of this is a slightly longer delay each time you save the component while editing it. For most users, it will not be necessary to use this property.

 

 

Layout Table Reports - Report Editor - Copy and Paste Rows - When editing a Table Layout Report, the right click menu exposes new commands to copy and paste complete rows.

 

a5_mergeDataIntoTemplate() Function - Takes a data source (.dbf table pointer, AlphaDAO resultset, Xbasic property array, or string of JSON data) and merges the data into a template.


The syntax is:

c text  = a5_mergetDataIntoTemplate(c template,a dataSource)
 

The template can include any Xbasic function between curly brackets.

To reference a field from the passed-in data source, the template uses this syntax:

{ds.data("fieldname")}

For example, assume that the passed-in data source has a field called 'firstname'. To get the value of the firstname field, your template would use this syntax:

{ds.data("firstname")}

 

To convert firstname to uppercase, you would add the upper() function to the template:

{ut(ds.data("firstname"))}

 

If the template was  HTML and you wanted to escape HTML characters in the data, you would use this:

{a5_html_label(ds.data("firstname"))}

 

You can include expressions in curly brackets that have nothing to do with data, for example, to put today's data in the template:

{date()}

 

You cannot nest curly brackets. For example, say you want to output the value from one field under 'condition a' and the value from another field under 'condition b', you might be tempted to put this in your template:

{ iif({ds.data("testfield")} = "condition1" ), {ds.data("field1"}, { ds.data("field2") } }

 

The above will not work!

Here is the correct syntax:

{iif(ds.data("testfield") = "condition1",ds.data("field1"),ds.data("field2")}

 


The following examples show how to use the function:


template = <<%html%
<li>
    Name: {ut(ds.data("firstname"))} {ds.data("lastname")}

</li>
%html%


dim dataSource[0] as p
dataSource[].firstname = "John"
dataSource[..].lastname = "Jones"
 

dataSource[].firstname = "Richard"
dataSource[..].lastname = "Smith"

'Merge data into the template. Array has a size of 2, so template will appear

'twice (with merged data) in the output.
 

dim htmlstring as c

htmlstring = a5_mergeDataIntoTemplate(template,dataSource)
 

'If you examine htmlstring you see:

<li>
    Name: JOHN Jones

</li>
<li>
    Name: RICHARD Smith

</li>
 

 

 

In this next example, the data source is an AlphaDAO resultset.

 

delete cn
dim cn as sql::Connection
cn.open("::Name::mysql_alphasports")
?cn.Execute("select * from customer where bill_city = 'boston'")
= .T.
rs = cn.ResultSet

dim html as c
html =a5_mergeDataIntoTemplate(template,rs)
 

 

In this next example, the data source is a .dbf table:

 

dim tbl as p

tbl = table.open("customer")

tbl.query_create("bill_city = 'boston' ")

dim html as c
html =a5_mergeDataIntoTemplate(template,tbl)
 

 

In this next example, the data source is a string of JSON data:

 

dim jsonTxt as c

jsonTXT = <<%txt%

{firstname : 'John', lastname : 'Jones'},

{firstname: 'Richard', lastname: 'Smith'}

%txt%

 

dim html as c
html =a5_mergeDataIntoTemplate(template,jsonTxt)
 

 

 

a5_JSON_extractValues() Function - Extracts name/value pairs from a string of jSON data.

Syntax:

c text = a5_JSON_extractValues(c JSONText)

 

For example:

 

?a5_JSON_extractValues("{name:Fred, city: Boston, address: \"123 Main St, Suite 23\", state: MA}")
= name:Fred
city: Boston
address: "123 Main St, Suite 23"
state: MA


 

 

a5_JSON_PopulateArray() Function - Populates a property array with data from an array of JSON data.

Syntax:

a5_JSON_PopulateArray(P array, C jsonText)

 

For example:

 


txt = <<%txt%

[
{firstname: 'Fred', lastname: 'Smith', married: true, kids: 2} ,

{firstname: 'richard', lastname: 'smith'}

]
%txt%

dim arr[0] as p
a5_JSON_PopulateArray(arr,txt)
 

?arr.size()

= 2


?arr[1]
= firstname = "Fred"
kids = 2
lastname = "Smith"
married = .T.

 

Custom Component - OnRenderComplete - New client-side event has been added to the Custom Component

 

Grid - Checkbox Select Column - You can now define bubble help for the checkbox that appears in the title row. This checkbox is used to select/unselect all rows. With bubble help, you can now explain to your users what the purpose of the checkbox is.

 

 

Bugs

Grid Component - Row Expander - Multiple Child Grids - Security - If you had a Row Expander that showed multiple child Grids, and you had set security for some of the Grids, when the Row Expander was opened, if certain Grids had been eliminated because of security restrictions, the tabs in the Row expander would (in some cases), show the wrong Grid.

 

Grid Component - Group Breaks - Summary Values - Session Variable in Grid Filter -  If the Grid had summary values in the Group Header or Group Footer, and if the Grid Filter referenced a session variable, you would get an error when the Grid rendered.

 

Grid Component - Detail View - Entering New Records - Save and Enter Button - Validation Errors - If you were entering new records into a Detail View and you clicked the 'Save and Enter New Record' button (rather than the 'Save' button), if there were validation errors, the validation errors would be shown, but the data that the user had just entered was blanked out.

Form.ViewQueried() - Active Link Tables - Set - If a form was based on a set that was created from active-link tables, the Form.ViewQueried() method was very slow. This was noticeable if the parent table of the set has a lot of records. This is now substantially improved.


Grid Component - File or Image Upload Action - DBF Tables - If performing a file or image upload action in a Grid that was based on a .dbf table, if you had specified an explicit primary key for the table (rather than use the default of 'recno()' ), you would get an error when uploading a file.

 

Dialog Component - Server Side Action Scripting - Data Binding - SQL - Dynamic Connection Strings - Was not honoring dynamic connection strings.

 

Dialog Component - Populate() Method - Was not properly handling lower case object names passed into the data object. For example:


var _d = {};
_d['firstname'] = 'John';
{dialog.object}.populate(_d);
 

 

should have worked identically to:


var _d = {};
_d['FIRSTNAME'] = 'John';
{dialog.object}.populate(_d);


It now does.

 

AlphaDAO - Access - Fillter Clauses in a Join Clause - The following SQL statement would not execute against an Access table if using portable sql:

select * from Customers C inner join Orders O on C.CustomerId = O.CustomerId and O.CustomerID = 'ALFKI'

 

 

The reason was that Access expects parentheses around the ON condition and the Portable SQL generator was not inserting the parentheses. This is now fixed, as shown in the following Interactive window sequence:


dim q as sql::query
?q.parse("select * from Customers C inner join Orders O on C.CustomerId = O.CustomerId and O.CustomerID = 'ALFKI'")
?q.generatenativesyntax("{a5syntax=access}")
= "SELECT * FROM Customers C INNER JOIN Orders O ON ( C.CustomerId = O.CustomerId AND O.CustomerID = 'ALFKI' )



 

Web Security - Incorrectly Reporting that Security Not Active - Under certain conditions, the web security framework would report that security was not active even though the security was active. This typically occurred after a backup process changed the security files archive bit to off. The function filefind.get() used to get data from one of the files would not find the file when using the default "Normal" file attribute if the file archive bit was off and the file was also configured to not allow indexing. Filefind.get() has been fixed to properly find the file under those conditions when searching using the "Normal" file attribute. The security will now correctly report the security status.

 

Grid Component - Printing Reports - currentGridFilter() - In the case of a .dbf grid where the base filter was defined using an argument (e.g. state = :whatstate), the currentGridFilter() function was return the unresolved filter, rather than the resolved filter (e.g. state = "MA"). As a result, the report would fail to print.

 

Forms - Report View Supercontrol - Was not working correctly.

 

PDF Utilities - Certain of the PDF utility functions, such as PDF_Merge() got broken after a recent update in which we switched to a newer version of the Amyuni Printer Driver (V4.5). The reason these functions got broken is that Amyuni changed the program id of the activex object on which the utility functions are based. This is now fixed.

Application Server - Response Protocol -  Under certain circumstances, the Application Server would send a Response using the HTTP/1.1 protocol when the Request that it received was using HTTP/1.0. This has been fixed.

Application Server - Response.SendFile() - MIME Type - Response.SendFile() now properly sets the outgoing MIME type for all known file types.

 

Application Server - Geography/Geometry Fields - Unhandled Exception - Some users have reported that when using a Grid that had a Geography or Geometry field that they were getting an unhandled exception. We believe that this was because the SQL Server data types were not installed on the machine. The SQL Server data types are needed by Alpha Five regardless of whether you are using SQL Server, or some other SQL backend. The App Server install program was installing the .msi installer file, but was not executing it. To correct the problem you can go to the folder where the App Server is installed, and you can execute this file (which comes from Microsoft):

 

SQLSysClrTypesx86.msi
 

 

Installation Location for SSL Files - Previously, the SSL files, libeay32.dll and ssleay32.dll were installed in the Alpha Five program folder. Now, these files are installed in the Windows, System32 folder, overwriting the existing files if the existing files are older. This should prevent a situation where Alpha Five did not start because some other application had already loaded an older version of these DLLs.

 

Upsize Genie - Upsize Genie was not properly handling mapped tables. Also, in certain cases, it was not completing normally.

 

Dialog Component - Repeating Sections - Frames - Modern Style - Initially Hidden - If a Repeating Section was inside a Frame that was initially collapsed, when the Frame was expanded, the columns on the Repeating Section would not be properly aligned. This is now fixed.

 

Grid Component - DBF Tables - Editable Fields - Display Format - If the Grid was set to refresh when the user started editing any field in the row, fields for which a Display Format had been defined were refreshed using unformatted data. Now, these fields are refreshed using formatted data.

Tabbed UI and Page Layout Component - Hyperlinks - Had an unwanted onHover event that made them look like buttons.

Web Applications - Opening a Component in a DIV - When you use Action Javascript to open a component, you have the option of opening the component in a DIV. This feature was not working for all component types that were derived from the Custom Component type. This included the Google Map and Video component.

Grid Component - Write Conflict Errors - In certain cases when the Regional Settings specified a comma as the decimal separator, users could get incorrect write conflict errors when updating a Grid. See 'Grid Components - Display Format - Original Data' for more information.

Web Applications - Session Variables - Deleting - Deleting session variables was not working. The session variable remained defined even after the Xbasic command that deleted it had executed.

Technical Note: The reason for this is that in V11, session is not a standard Xbasic variable - it is a special object that maps to the session object in IIS. As a result, when you want to delete a session variable, you need to call the session object's .remove() method. Now, when you execute an Xbasic command to delete a session variable, behind the scenes, a call to the session object's .remove() method is automatically made.

DBF Tables - Exponent Numeric Fields - Field Rules - Fixed a problem when editing field rules for an exponent numeric field.

Application Server - Previously when selecting Restart Server from the Application Server Settings, the user was prompted to confirm that the restart was desired, but there was no option to indicate that the restart was not desired. The single OK button has been replaced with Yes and No buttons.

 

AuthorizeNet - A bug in AuthorizeNet_Transaction that prevented the processing of credit card transactions has been identified and fixed.
 

Web Applications - Reports - Mapped DBF Tables - User Defined Function - .AEX Files - If a report was based on mapped .dbf tables, and one of the columns in the mapped table used a UDF in its calculated field expression, the report would fail because the UDFs in the .AEX file were not visible inside the report code. This is fixed now.
 

Tabbed UI and Page Layout Components - Linked Javascript Files - Were being loaded from the wrong folder in the webroot. Alpha Five was looking in a Javascript sub-folder folder in the webroot, rather than directly in the webroot.

 

 

Web Applications - Project Properties - File Download - Allowed Folders - Previously, you could specify <UserSessionFolder> or a list of folders, but not both. A change has been made to allow <UserSessionFolder> to be included as a folder in the list in addition to other folders. This will allow you to limit downloads to specific folders and still include the session folder. Now if you want to only allow downloads from any folder named 'images' or 'pdf' and the users session folder, you can enter:


*\images,*\pdf,<UserSessionFolder>
 

 

 

Tip

Tabbed UI Component - Auto-Launch on Startup - Initial Pane Focus - When you add objects to a Tabbed UI component, each object has a property called 'Auto-launch on startup' which causes that tab to be opened automatically when the Tabbed UI is opened. If you have checked this property on several objects, then when you run the Tabbed UI, it will be unclear which tab pane will have initial focus - it will depend on the timing of how long each tab pane takes to complete the Ajax callback that was made to load the tab.

In many cases, even though you have checked this property for multiple tabs, you still want the Home pane to have initial focus. Here is how you can ensure that the Home page has initial focus.

For each tab that is set to auto-launch, add this Javascript to the onChange event in the 'Tab Pane Javascript' section:



if(typeof tbiObj.__pane1 == 'undefined') {
    tbiObj.selectPane('Home');
    tbiObj.__pane1 = '';
}


Change '__pane1' to '__pane2' for the second tab and '__pane3' for the third tab, and so on.

Here is how the code works.
 

  1. When the TabbedUI is loaded, an Ajax callback is made to the server to open the tab.
  2. The response is sent from the server with the necessary Javascript to open the tab and show the component. Since the tab will now get focus, its onChange event will fire.
  3. If this is the first time the tab's onChange event has fired, then tbiObj.__pane1 will be 'undefined' and so the Javascript to set focus to the home page runs. The tbiObj.__pane1 variable is also initialized so that the code in the if() statement never fires again.

Web Applications - Pop-up Windows - Removing the Close Icon - Some users have requested information on how to completely remove the Close icon from the title bar of a pop-up ajax. This is easily done by placing this Javascript in the onShow event of the window:

 

//To remove the x button, but leave the title bar
this.clearTools();


//To remove the title bar completely:
this.setDisplay('title',true);
 

 

 

Build 2291_3841 - Dec 6 2011

New Videos

A new series of videos have been released. Click here to see all Videos.

 

D25 - Dialog and Grid Component  - Grid Lines - Placing Grid Lines on the Dialog Background in Preview Mode to Help Set Control Sizes.

D26 - Dialog Component - In Video D20 we show how you can populate a Dialog with data from one or more tables when it is first opened. In this video we show how you can create an event handler (for a Dialog or Grid) to open a Dialog component and populate the Dialog with data from a table. The primary key of the record to load can be read from controls in the current Component (a Grid or Dialog), or specified by a session variables.

D27 - Dialog and Grid - Locking Controls - A common requirement in Ajax applications is to 'lock' the screen, or a portion of the screen, for the duration of the callback. This prevents the user from performing some action that is not appropriate during a callback. A transparent overlay is displayed over the screen or element to 'lock' it.

D28 - Dialog - Using a Dialog Component as an Alternate Editing View of a Record in a Grid - If you have a lot of columns in an updateable Grid, it can be cumbersome to scroll horizontally when editing data in the Grid. In this video we show how a Dialog Component can be used to edit the data in the Grid row. A button can be inserted into the Grid row. When the button is clicked, the Dialog Component is opened and the current data in the Grid row is filled into the Dialog. The user can then continue editing in the Dialog, and then click an Update button, which closes the Dialog and fills in the controls in the row in the Grid that is being edited.

D29 - Dialog - Creating a new Dialog from a Template - Shows how you can get a quick start when creating a new Dialog by using a template.

D30 - Dialog - e.dataSubmitted - Understanding what's in the e.datasubmitted object that is passed into server side event handlers.

 

D_SF_1 - Dialog Component - Security Framework - Create an Account for a New User - Managing data in the Web Security Framework tables at run-time is a common requirement. This video shows how a Dialog Component can be used to create an account for a new user. The Dialog Component prompts for account information (such as username and password), and enters the data in the tables used by the Web Security Framework.
 

D_SF_2 - Dialog Component - Security Framework - Create an Account for a New User and also Store Personal Information in a Related Table - Shows how you can also add data to a related table at the same time that you create a new user account. The account credentials are stored in the Web Security Framework tables, and the additional information (which could include any data that you choose to collect) are stored in a related table.

D_SF_3 - Dialog Component - Security Framework - Modifying the Account of an Existing User -  Shows how you can use the Dialog Component to retrieve the account information for an existing user into the Dialog component, and then edit that data. For example, you might want to change the Group (i.e. role) to which the user is assigned.

VP1 - Video Player - A series of videos about the Video Player component. The last video in the series shows the new features added to the Video Player in this update.

GM16 - Grid Component Alternate View - Google Map - Shows how a New Marker Can be Added to a Map When Entering New Records into a Grid

 

Bugs

Reports - Calculated Fields with Long Field Names - Under certain circumstances, if you created a calculated field in a report that used a long field name, Alpha Five would crash.

 

Grid Component - File Download - Firefox - Filenames with Spaces - There is a bug in Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=221028) that prevent it from download files with spaces in the name. We have come up with a work around so that it is now possible for Firefox to download files if there are spaces in the filename.

Reports - Table Layout Reports - International Characters - High order characters (internaltional) in the report are now supported.

 

Calendar Component - Session Variables - Binding the 'Calendars to Show' argument to a session variable was not working.

 

Dialog Component - Server Side Action Scripting - Save Data To a Table - If the table had more than one column in the primary key, updates to existing records could fail.

 

Dialog Component - Repeating Sections - Checkbox - Treat Numeric as Logical - A bug with a checkbox control in Repeating Sections has been fixed.

 

Grid and Dialog Components - Open a Component in a Pop-up Ajax Window - Center Contents - Option was not working when the windows was popped up a second time.

Dialog Component - Accordion Control - Repeating Section - If you placed a Repeating Section inside a pane of an Accordion control, you would get a Javascript error. This is now fixed.

 

Grid Component - File Upload - User Defined - Detail View - When performing a File Upload - User Defined action from a button in the Detail View, the e object passed into the server-side event handler did not have the e.primaryKeysArray object.

 

Navigation Component - Vertical Style - Menubar was not using the correct CSS class name.

Dialog Component- Repeating Sections - Adding new Rows - Adding a new row to a Repeating Section was making the dialog clean, when it should not have been doing so.

 

Features

Dialog Component - New Dialog - Templates - When you create a new Dialog, you are now presented with a list of templates to choose from.

 

Dialog Component - Data Binding - DBF Tables - Commands to load data from tables and to save data to tables. Previously the server-side actions, and Action Javascript actions that allowed you to populate a Dialog from data in one or more tables, or save data to tables were only implemented for SQL tables. Now, all of these actions can be used on .dbf tables as well.

Grid Part - Detail View - Row Label Position - You can now select 'None' as a row label position. Previously, the choices were left, right, above, below.

Detail View  - Pop-up Window - Size - You can now define an explicit window size for a pop-up Detail View window.

Grid Component Alternate View - Google Map - Right Click - You can now define an event handler for handling right clicks on the map. The co-ordinates of the point on the map where the user right-clicked are passed into the event handler.

Grid Component Alternate View - Google Map - Adding Markers for New Record Rows - You can now specify that in the case where the Grid allows new records to be entered, if focus is on a new record row and the user right clicks on the map, that a new marker should be added to the map and the co-ordinates of the marker position should be entered into the latitude and longitude fields in the current row. See Video GM16

Dialog Component - Security Framework - New Server Side Actions to make it easier to use the Dialog component for managing user accounts in the Security Framework.  (See Videos D_SF_1 through D_SF_3) Click here to see all Videos. (Note: All of the Dialogs used in these videos can be easily created by simply selecting the appropriate template from the list of available templates when you create a new Dialog).

 

Video Player Component - Several new features have been added to the Video Player Component (You Tube option). New features are listed below. See Video VP1 for more details.

 

Web Projects Control Panel - Recently Selected Projects Button - New button on the toolbar to show the recently selected web projects.

 

 

Web Projects Control Panel - Filter - The Web Control Panel now has a filter prompt. This is useful when you have a large number of files in a web project and you want to find a file quickly.

 

Web Control Panel - Preview Pane - The button for the Preview pane has been removed. The preview pane is no longer supported.

 

Wiki Search Assistant - A new option is available under the Help menu.

 

 

The Wiki Search Assistant opens a dialog showing a list of topics in the wiki. You can search very quickly in this list and then open the selected topic in your browser.

 

 

 

Grid and Dialog Component - Help Topics for Controls - Project Help Table - Previously you had to define the table for your custom help topics in each component that you created. Now, you can define a global HelpTopics table in your Project Properties.

 

Grid Component - File Download - Download Folder - If you specified a relative download folder it was not correctly resolving the folder name to a folder within the webroot.

 

Grid Component - File Download - Client-side Filename - If you specify a client side filename that does not have a file extension Alpha Five will now automatically add the extension of the file you are downloading.

 

Action Javascript - Lock/Unlock Screen or Element - A new action has been to lock, or unlock the screen, or an element. This is commonly done during an Ajax callback. See Video D27

 

Action Javascript - Dialog - Geocode Address - This action is now supported in a Dialog Component. Previously, it only worked in a Grid.

 

Action Javascript - Open Dialog - When you define an action to open a Dialog, you can now specify that the Dialog should be populated with data from a table. (It is assumed that you have defined Data Binding options for the Dialog)

 

Action Javascript - Dialog as an Alternate Record View - New Action for opening a Dialog as an alternate view of the record currently being edited in a Grid - See Video D28.

 

Grid and Dialog Component - Background Grid Lines - When you are designing a Dialog or Grid with a Detail View, it can be helpful to turn on a background set of grid lines to see the dimensions of different object.  To turn grid lines on/off, click the icon highlighted in the screen below. See Video D25

 

 

Here is how the Dialog appears with grid lines turned on.

 

 

 

Dialog Component - Embedded Objects - The Dialog Component is now a full superset of the Page Layout component. You can now embed other objects into the Dialog just as you can in a Page Layout. For example, you can embed a Grid, Dialog, Report, PDF file, .A5w Page, etc. inside a Dialog.

 

 

Reports - Quick Report Genie - Page Mismatch Dialog -  The Page Mismatch Dialog , which used to display when the report was too large for the page, has been removed. Instead, the toolbar, or right click menu now has options for what to do when a mismatch occurs.

 

Dialog Component - Client Side Events - The following new client-side events have been added:

Dialog Component - Server-side Actions to Populate Dialog with Data - DBF Tables - Now support .dbf tables.

 

Dialog Component - Adding Multiple New Controls at Once - A new option on the dialog allows you to save and re-use field lists. See the 'Pre-defined lists' hyperlink in the screenshot below.

 

Dialog Component - Adding Multiple New Controls at Once - Previously, when you added multiple new controls at once to a Dialog using the dialog shown below, the controls were each added on a new line. Now, you can control the layout of the new controls, as shown in the second dialog. By placing multiple (comma delimited) controls on the same line in the dialog, you cause the Controls on the Dialog component to be created with no break after each control, other than the last control on the line. You can also specify the width of the control, by including a width directive in parentheses. The width directive uses CSS syntax. E.g. 2in, 300px, etc.

 

The Firstname and Lastname controls will be on the same line. City, State and Zip will also be on the same line. Company and Address will be 4inches wide.

 

Here is the Dialog created from the above definition:

 

 

Grid Component - HTML Memo Field - Image Upload - Reports - If you have a Grid with an HTML memo field, and you enable image upload in the memo, the uploaded images are stored in a folder that you specify relative to the web root. If you then try to print a report that includes this memo field, the images are currently not displayed because they are referenced in the memo field using a relative filename, and the report writer cannot resolve these relative image names. Now, the report writer will automatically determine the webroot and will try to resolve relative image names using the webroot as the base path.

 

Web Applications - CSS Styles - Navigation Component - For new V11 styles, the CSS used for the menus in the Navigation Component was the same as the CSS for the menus used elsewhere in other components (such as the menus in the QBE search on a Grid). This represented a problem for users who wanted to style the Navigation System menus. Now, the Navigation System menus can optionally be styled independently of the standard menu styles. If you do not define a Navigation menu and Menubar style in the style builder, the Navigation component will continue to use the default menu and menubar styling in V11 styles.
 

Xdialog - Tree Control - Custom Colors for Tree Items - You can now define custom colors for items in an Xdialog tree control.

 

 

Below is the Xdialog code that generates this tree.

 

Notice:

dim treecolors as c = <<%str%
Gray
White,Dark Gray
Blue Gray
Sky Blue
,Yellow
,Green
,Red
,Light Blue
%str%
dim tree as c
dim item as c
tree = <<%str%
{S=1}one.item 1
{S=1}one.item 2
{S=1}one.item 3
{S=1}one.{S=4}footnote
{S=1}two.{S=2}index 1.{S=3}topic a
{S=1}two.{S=2}index 1.{S=3}topic b
{S=1}two.{S=2}index 1.{S=3}topic c
{S=1}two.{S=2}index 1.{S=4}footnote 2
{S=1}two.{S=2}index 2.{S=3}topic a
{S=1}two.{S=2}index 2.{S=3}topic b
{S=1}two.{S=2}index 2.{S=3}topic c
{S=1}two.{S=2}index 2.{S=4}footnote 3
{S=1}two.{S=2}index 3.{S=3}topic a
{S=1}two.{S=2}index 3.{S=3}topic b
{S=1}two.{S=2}index 3.{S=3}topic c
{S=1}two.{S=2}index 3.{S=4}footnote 4
{S=1}three.{S=5}color 1
{S=1}three.{S=6}color 2
{S=1}three.{S=7}color 3
{S=1}three.{S=8}color 4

%str%
tree = remove_blank_lines(tree)
item = word(tree,1,crlf())

dim pHeading as p
pHeading.BodyText = "This example shows how you can define custom foreground and background colors for each item in a tree control. A CR-LF delimited list of colors is passed into the tree control."
pHeading.HeadingText = "Tree Control with Colored Items"
pHeading.Image = "$$large.code.aScript"


ui_dlg_box("Tree Control - Custom Colors",<<%dlg%
{XdialogTitleSection=100,5pHeading};
{lf};
[%S=BLRX;[email protected]%.100,40item^<tree]
%dlg%)
 

Grid Component - Tree Control Navigator - Custom Query Option - You can now specify different display text and item values for the tree by specifying a SQL query that returns 2 columns of data. The first column is the display text, and the second column is the item value.

 

Tips

Dialog Component - Setting Values in Controls - Optimizing for Setting a Large Number of Controls - When a Dialog component is opened, you can write code in the onDialogInitialize event to set the values in the controls in Dialog. The onDialogInitialize event is a server-side event, and so the code in this event handler is Xbasic.

Control values are set by setting properties in the e.control object that is passed into the event handler.

For example:

e.control.firstname = "John"

 

In addition, your Dialog component can also make Ajax callbacks, and the Xbasic function that handles the callback can set the value of controls in the Dialog. This is typically done by setting properties in the e._set object that is passed into the event handler. For example:

e._set.firstname.value = "John"

 

What goes on 'behind the scenes' when you set a property in the e.control, or e._set object is that Alpha Five has to convert the properties that you set into Javascript, which is then emitted to the browser.

If you are setting a large number of controls, it is more efficient to generate the Javascript directly in your event handler.

In your Javascript code, you will create a Javascript object and then pass this object to the Dialog's .populate() method. Using this approach is very efficient, and will allow you to populate a large number of controls very quickly.

For example, here is some Xbasic code that you might put in the onDialogInitialize event. This Xbasic code creates a string (which happens to be Javascript code) and then it sets the e.javascript property so that the Javascript code in the string is emitted to the browser.


'Generate the Javascript to emit

dim jsToSetControlValues as c
jsToSetControlValues = <<%jstxt%
var _d = {};
_d['FIRSTNAME'] = 'John';

_d['LASTNAME'] = 'Smith';

_d['FAVORITECOLORS'] = ['Red','Green'];
{dialog.object}.populate(_d);
{dialog.object}.prepare();
%jstxt%

 

e.javascript = jsToSetControlValues

 

(In the case of an Xbasic function that is handling an Ajax callback, you simply return the generated Javascript - you don't set the e.javascript property)

To set the value of a control in a Repeating section, you follow the control name with :rowNumer, or _a5InstancerowNumber. For example, the following two commands are functionally identical:

_d['QUANTITY:3'] = '4';

_d['QUANTITY_A5INSTANCE3'] = '4';

 

 

 

 

To assist you in generating the Xbasic string that contains the Javascript code, you can use the Xbasic varToJSON() function. This function is very helpful for generating JSON objects from Xbasic. The following Xbasic code is functionally equivalent to the code shown above:

 

dim j as p
j.firstname = "John"
j.lastname = "Smith"

j.quantity_a5instance3 = "4"
dim j.favoriteColors[3] as c
j.favoriteColors[1] = "Red"
j.favoriteColors[2] = "Blue"
dim js as c
js = varToJSON(j)

dim jsToSetControlValues as c
jsToSetControlValues = "{dialog.object}.populate(" + js +");" + crlf()+\

"{dialog.object}.prepare();"

 

 

The Javascript that you generate can also set the number of rows to show in a Repeating Section.

In this next example, we generate Javascript to set the number of rows in a Repeating Section to 7. The ._setRepeatingSectionRowCount() method takes two optional arguments:

focustFirst - if true, focus will be set to the first Repeating Section Row, and if false, focus will be set to the last Repeating Section row.

nullExisting - if true, existing data in the Repeating Section will be nulled out.
 

dim jsToControlValues as c
jsToControlValues = <<%jstxt%
var rows = 7;
var focusFirst = true;
var nullExisting = false;
var rSId = 'CONTAINER_1';
{dialog.object}._setRepeatingSectionRowCoun(rSId,rows,focusFirst,nullExisting);
var _d = {};
_d['B'] = 'alpha'; //set the value of a control called 'B'
_d['E:2'] = 'beta'; //set the value of a 'E' in the 2nd Repeating Section row
_d['G:6'] = ['Red','Green']; //set checkbox 'G' in the 6th row to 'Red' and 'Green'
{dialog.object}.populate(_d);
{dialog.object}.prepare();
%jstxt%

 

 

Open Grid in Pop-up Window - Center - Internet Explorer - Form Style Grid - If you specify that the target Grid should be centered in the pop-up window, in Internet Explorer, the labels for each control are also centered. This is likely not what you would want. To work around this issue, you can set this property on the target Grid:

Table tag inline style

Set this property to:

text-align: left

 

 

Build 2237_3828 - Nov 10 2011

 

Bugs

Dialog Component - Server-side Action Scripting - Populate Dialog with Existing Record - Repeating Section - No Records in Repeating Section - Fixed a bug when you populated a Dialog that had Repeating Sections and there were no records in the Repeating Section.

Dialog and Grid Component - HTML Editor - IE8 -  Fixed a bug that occurred under certain conditions in IE8 when making selections from the Style dropdown menu.

Tabbed UI Builder - Reports - Prompt for Arguments at Runtime - Button Text - If you tried to change the text on the button that was displayed when you were prompting for arguments at runtime, the text would revert back to its previous value after you tabbed out of the field.

 

Features

New variable_exists() Function - Previously, developers have used the eval_valid() function in Xbasic code to test if a variable exists. Eval_valid() is a relatively expensive function to execute. In situations where there are a large number of calls to eval_valid(), the time taken by eval_valid() can become noticeable. As a result, a new function variable_exists() has been created specifically to test if a variable exists.

Contrast eval_valid() which tests if an entire expression is valid (for example: eval_valid("firstname + lastname") ) with variable_exists(), which merely tests if a variable exists or not. When the 'expression' tested by eval_valid() iis simple (e.g. "Firstname"), then eval_valid() is functionally equivalent to variable_exists().

 

Examples:

 

dim arr[1] as p
arr[1].foo.bar = "hello"
? variable_exists("arr[1].foo.bar")
= .T.
 

indx = 2
? variable_exists("arr["+indx+"].foo.bar")
= .F.


indx = 2
? variable_exists("arr[indx].foo.bar")
= .F.

 
p = form.load("customer information")

 

?Customer_Information.window_title
= "Customer.dbf : Form View (Customer Information)"
 

'Variable_exists() Cannot be used on certain Alpha Five objects
?variable_exists("Customer_Information.window_title")
= .F.

 

'Note that eval_valid() for the same argument is .t.
?eval_valid("Customer_Information.window_title")
= .T.
 

'On the other hand if we test p.window_title (since p is just an xbasic variable),

'variable_exists() can be used
? variable_exists("p.window_title")
= .T.

 

 

Build 2235_3826 - Nov 9 2011

New Videos

A new series of videos have been released. Click here to see all Videos.

D20 - Dialog Component - When a Dialog component is first opened, you might want to automatically populate the dialog with data from one or more tables. This video shows how you can use Server Side Action Scripting to automatically populate a Dialog with a Repeating Section with data.

D21 - Dialog Component - After a Dialog Component has been opened, you might want to have a button that does an Ajax callback to populate the dialog with data for a specific record. This video shows how you can use Action Javascript to define the code for a button that will populate the Dialog. The primary key of the record you want to retrieve is read from a control on the Dialog.

D22 - Dialog Component - Sending E-mail - A very common pattern in Web Applications is to display a form to capture some information (for example, name and address information), and then when the user clicks on the Submit button, store the submitted data in a table and then send an e-mail confirmation to the the user.

This can be easily done with the Dialog component. Using Server-side Action Scripting, the entire process can be handled without having to write any code. The Alpha Five Genies will write all of the code for you.

The videos show how the email message can be sent immediately, or queued in a 'WorkQueue' table.

D23 - Dialog Component - Understanding the 'Prevent Container Float' Property on a Container Control.

D24 - Dialog Component - Using a Dialog Component to Edit a Record in a Grid Component, or Enter a new Record into a Grid Component

IG5 - Image Gallery - By default, when you open an Image Gallery, all of the images in the specified folder as shown. However, the Image Gallery supports a filter property that allows you to apply a filter to the list of files in the folder. For example, if you specify a filter of image_bathroom_*,image_kitchen_*, then only images that start with 'image_bathroom' or 'image_kitchen' will be shown in the Image Gallery.

M37 - Grid and Dialog Component - Advanced Client-Side Show/Hide Expressions - Calling a User Defined Javascript Function when a Show/Hide Event Fires.

M38 - Tabbed UI on a Mobile Device - Shows how the Tabbed UI component can be rendered on a mobile device.

Cal4 - Calendar Component - Opening the Calendar Component and Showing a Selected List of Calendars.

Cal5 - Calendar Component - Opening the Calendar Component and Showing a List of Related Calendars

Bugs

Grid Component - Export to Excel/Ascii - Language Tags in Column Headings - If you specified a language tag in a column heading, but you did not define a replacement string for the language tag, the column was not exported.

Grid Component - Search Part - Auto-suggest - Auto suggest in the Search Part was not working.
 

Grid Component - Group Breaks - Search Part - Grid is Initially Hidden - If a Grid used Group Breaks, and the Grid part was hidden until there was an active Search, then when a search was executed and the Grid was rendered, the initial sort settings on the Grid were not honored.

Reports - Linked Reports - If you defined a Report that had a Linked Report embedded in it, if the child report (i.e. the linked report) was based on a .dbf table, Alpha Five was storing the linked report definition using a fully qualified filename for the table. This meant that if the report was used in a Web application where the tables were stored in different folders than on the development machine, the report would fail. This is now fixed. The child report table filename is now stored with a path alias. If this situation applies to you, you will need to edit your report, then edit the linked report to cause Alpha Five to regenerate the correct link definition.

Web Applications - Navigation Component - Fallback URL - Was not honoring the 'fallback url' property if a new, V11 style was used.

Dialog Component - .setValue() Method - HTML Controls - This method was not working correctly for HTML fields. The value in the control was being set, but was not visible until you opened the HTML editor and edited the value. If you have a lookup field that filled data into an HTML field, the fill-in, after the lookup, would appear to fail because of this error. This is now fixed.

Calendar Component - Switching between Views - International Regional Settings - For users in countries where the date format is dd/mm/yyyy, there was a bug in the Calendar Component. When you switched from one calendar view to another, the events that you had defined in the original view were not shown in the new view.

Importing Ascii Files - If the file being imported has double quotes in the data, it was automatically, and erroneously, assumed that the user wanted to specify that the data was delimited.
 


Features

 

Calendar Component - Debugging Information  - A new option in the Calendar Component builder allows you to turn on debugging information. If this option is enabled, debugging information is written to the Trace folder (see Application Server control panel for information on where the Trace folder is located).

Calendar Component - Previously, when a Calendar Component was opened from a button on a Grid or Dialog, you could configure the button to show either all calendars, or a hard coded subset of calendars. Now you can easily specify a dynamic list of calendars to show. See video number Cal4.  Click here to see all Videos.

 

Calendar Component - Read-Only Calendars - There are now more options for specifying read-only calendars. Previously, you could only specify that the entire calendar was read only. Now, you can specify individual calendars as read-only. For example, say you are displaying a Calendar Component for a doctor (Dr. Jones) , and 2 of his associates (Dr. Smith and Dr. King). You might want the calendar for Dr. Jones to be updateable, but the calendars for his associates to be read-only.
In order to accomplish this, there is a new property in the Calendar builder that allows you to specify the IDs of the calendars that should be read only.
In the above example, you might set the IDs of the calendars to display to (say) 5,8,9 (the Ids of for the 3 calendars to display), and the IDs of the read-only calendars to 8 and 9 (the Ids of 2 read-only calendars).
 

 

PDF Printing - Amyuni Printer Driver - New Version - Version 4.5 - We have updated the version of the Amyuni PDF Printer Driver that is bundled with Alpha Five. We now bundle V4.5 of the Amyuni Printer Driver. Amyuni's web site claims that this version performs better on 64 bit operating systems. It also removes the limitation that watermarks were not working when using a 64 bit operating system. After you install the update, you will notice that the Printers folder in the Windows Control Panel now has a new printer called 'AlphaFivePrinterV4p5'. The original printer installed by V11, 'AlphaFivePrinterV4' can be left there. This printer will be used by V10 if you have V10 and V11 installed on the same machine.

 

XPS Printer Driver - PDF Options -  For users who are using the Microsoft XPS printer to create PDF files, rather than the Amyuni PDF printer, certain of the PDF options, such as password, are now honored. The most significant PDF option that is not honored is the watermark option.


Image Gallery - Live Preview - When you do a Live Preview of an Image Gallery Component, the images in the specified folder in the Image Gallery are now automatically published to the Live Preview folder.

Web Applications - Action Javascript - Binding Arguments - Javascript -  When you use Action Javascript to open a Grid, Report, Dialog, Custom Component, etc. you often need to bind the value of an argument to a value from the parent Component. For example, you might bind the value of 'arg1' to the value of the Lastname field in the current Grid row.

Now, instead of binding an argument to the value of a field in the Grid or Dialog, you can specify an arbitrary Javascript function to execute. The argument is bound to the value that this Javascript function returns.

Watch Video (M36)

 

Image Gallery Component - .PNG Files - Now supports .png images in addition to .jpg images.

Image Gallery - Filter Argument - The Image Gallery now supports a new 'filter' argument. The image gallery shows images in a specified folder. Previously, all of the images in the specified folder were shown. Now, you can supply an optional filter. Only the images that satisfy the filter will be shown in the Image Gallery. The filter is a comma delimited string of filenames. Any of the filenames in the filter can include the * and ? wildcard characters. For example:

img_house.jpg,img_bathroom_*.jpg,img_kitchen_*.jpg

 

This filter will select all of the .jpg files that start with 'img_bathroom_' or 'img_kitchen_' as well as the image called 'img_house.jpg'.

 

The default value for the filter is blank. If a blank filter is supplied, then all of the images in the specified folder are shown.

When you use Action Javascript to open an Image Gallery, you will be able to specify a value for the Filter argument.

The ability to specify a filter argument, combined with the ability to bind the filter at runtime to the result of an arbitrary Javascript function (described above), it extremely powerful. If now gives you great flexibility in controlling exactly which images are shown in the Image Gallery.

 

 

Web Applications - Component Builders - Live Preview - When you select Live Preview from any of the Component Builders, Alpha Five displays a prompt if the Application Server in the current Alpha Five instance is not running. However, in some cases you might have a running Application Server in another Alpha Five instance, or the stand alone Application Server might be running, and you would like to use that server to handle the Live Preview. The dialog that is display when you go to Live Preview has therefore been redesigned as follows:

Note: You can go to Project Properties - Design-time Properties pane to suppress this dialog from appearing.

 

 

Dialog Component - Data Binding - NULL if Blank - A new property was added to the Data Binding section of the Dialog Component. The Server Side 'Save data' Action Script will honor this property.

 

Uisng the XPS Printer Driver - Additional Information - Some users have reported that when using the Microsoft XPS printer driver in place of the Amyuni PDF printer driver (see release notes for build 2211-3815), if they checked the option to convert the resulting XPS file to PDF, they would get this error:

 

Could not open OLE object 'cdintfex.document.4'

 

This error is because the Amyuni ActiveX controls are not properly registered.

 

You can fix this issue by opening a Command Window as an administrator and then running a batch file that Alpha Five installs (Registerfiles.bat, or RegisterFilesVistaWin7.bat).

Here is how you do this on:

 

Forms - Control Libraries - Grouping Controls - When you add controls in a Desktop Form to a Control Library, you now have the option of grouping the controls.

 

 

 

Grid Component - Linked Grids - Getting a Pointer to a Linked Grid - There may be situations when you want to execute some Javascript automation code on a linked Grid (i.e. a Grid opened in a Linked Content Section, or in a cell that displays a linked Grid). This can be difficult, because the parent Grid does not know the ID of the child Grid.
Now, when a parent Grid opens a child Grid in a Linked Content section, the ID of the Child Grid is now registered in the parent Grid's Grid Object.
For example, say you have a linked content section called 'X1' and you open two Grids in this Linked Content Section (the two Grids will be shown in a tab or accordion object). You can now execute this Javascript in the parent Grid to get the names of the aliases for each of the child Grids:
 

 

var alias1 = {grid.object}._linkedGrids['X1'][0];

var alias2 = {grid.object}._linkedGrids['X1'][1];

 

Dialog Component - Server-side Action Scripting - New Actions - Four new actions have been added to the available list of Server-side actions that can be used in the Dialog Component. These are:

Populate a Dialog with data from one or more tables - Allows you to populate the controls in a Dialog with data from one or more tables. (Only for Dialogs bound to SQL tables at present). See video D20 for more details. Click here to see all Videos.

Load Web Security Values - Allows you to load data for a particular user from the Security Framework into controls in a Dialog component.

Validate Web Security Values - Allows you to validate data before saving it back to the Security Framework tables.

Save Web Security Values - Allows you to save submitted data to the Security Framework tables.

 

Dialog Component - Action Javascript - New Action - Populate Controls in a Dialog Component with data from Tables - Allows you to make an Ajax callback to retrieve data from one or more tables and populate the controls in a Dialog.  (Only for Dialogs bound to SQL tables at present). See video D21 for more details. Click here to see all Videos.

 

Grid Component - Action Javascript - New Action - Open a Dialog Component to Edit Current Record in Grid or add a new Record - (Only for Dialogs bound to SQL tables at present). See video D24 for more details. Click here to see all Videos.

 

 

a5ws_GetGroupsDialog() Function - Return a list of security groups defined for the current project. It has no input parameters and should be used in place of the a5ws_Get_Groups in the V11 Dialog component.


a5ws_GetCurrentUser() Function - Get the 'UserName' (i.e. Userid) of the current logged in user.

 

Tabbed UI Component - Hide Tab Buttons Property - The Tabbed UI now has a new option to hide the tab buttons that appear above the open panes.

 

 

 

Tabbed UI Component - Mobile Devices - A new property allows you to change the way the Tabbed UI is configured so that it is more appropriate for a mobile device. See video M38.

 

The new 'Layout mode' property allows you to select 'DesktopBrowser' or 'MobileDevice'.

 


 

Here is how the Tabbed UI renders when the 'MobileDevice' option is selected:

Notice that a 'mobile' style is being used (MobBlue in this case). The mobile style renders all text slightly larger.

The menu buttons take up the whole screen.

When you select an item, the menu buttons go away and the selected component is shown (second screen).

Clicking on the Menu button in the top toolbar returns to the Menu page.

 

 

 

 

 

 

Build 2211_3815 - Oct 26 2011

Videos

A new video has been released. Click here to see all Videos.

D19 - Shows how you can defined field level validation in a Dialog's DialogValidate event.

 

Bugs

Grid and Dialog Component - HTML Editor - Internet Explorer - Fixed some issue with the HTML editor for Textarea controls in a Grid and Dialog component.

Calendar Component - W2CView - When viewing events in the W2CView, if you add a new event by clicking the column of a particular person, the dialog box now shows the correct person name in the Calendars dropdown box.

 

 

Features

Web Applications - PDF Printing - Microsoft XPF Printer Driver - When you print a report is a Web Application, the printing is done using the Amyuni Printer driver, which Alpha Software licenses from Amyuni. With this update, we are releasing another way to get PDF reports. You can now specify that you want to use the Microsoft XPS printer driver. This driver is typically automatically installed as part of Windows. If you use the Microsoft printer driver then Alpha Five will, by default (unless configured otherwise - see below), convert the resulting XPS file to a PDF file using the xps_to_pdf() function.

If you want to use the XPS printer driver you must specify so in the Web Project Properties dialog.

 

 

If you select to use the XPS printer, you have a second option to convert the resulting XPS files to PDF before sending them to the browser. If you choose not to convert to PDF, then the XPS file will be sent to the browser. Only Internet Explorer can open XPS files inline. Other browsers will typically download the XPS file and then open it with the associated XPS viewer on the client machine (if there is one).

VERY IMPORTANT: When using the XPS printer you must go to the Printer Properties for the printer and make sure that the 'Automatically open XPS document using the XPS viewer' is not checked.

 

 

XPS_to_PDF() Function - Converts an XPS file to a PDF file.

 

Grid Component - OnGridInitialize  and onGridExecute  Methods - The Grid Component exposes an OnGridInitialize and an onGridExecute method. The onGridInitialize event fires once, when the Grid is initially rendered. The onGridExecute event fires when the Grid is initially rendered, and on every Ajax callback. However, it is important to note that the onGridExecute event fires before the onGridInitialize event when the Grid is initially rendered. In some applications, this can be a problem if you were expecting the onGridInitialize to have fired before the onGridExecute is fired. Therefore, a new property is exposed in the onGridExecute event.

e.ajaxCallback

 

This property is .f. when the Grid is being rendered initially, and is .t. on all Ajax callbacks. With this property, you don't need to use the onGridInitialize event at all. You can put all of your code in the onGridExecute event and wrap the portion of the code that should only execute when the Grid is initially rendered in a code block like this:

if e.ajaxCallback = .f. then

    'code that must only be run once when the Grid is initially rendered

end if

 

 

Dialog Component - DialogValidate Event - Field Level Validation - You can now define field level error messages in the DialogValidate event. Previously, all error messages returned by this event were displayed in a message area at the top of the Dialog. Now, you can display the errors next to the fields in error. For example, here is some sample code that you might put into the DialogValidate event:

 

dialogValidate.hasError = .t.
dialogValidate.errorText = "Your dialog has errors"

dim dialogValidate.fieldErrors[0] as p
dialogValidate.fieldErrors[].varname = "FIRSTNAME"
dialogValidate.fieldErrors[..].errorText = "Error message for the FIRSTNAME field"

dialogValidate.fieldErrors[].varname = "QUANTITY:3"
dialogValidate.fieldErrors[..].errorText = "Error message for the QUANTITY field in the 3rd row of a Repeating Section"
 

If you have defined field level error messages, you might want to suppress the global message. You can do this by setting dialogValidate.errorText to "No Message" (requires build 3816 or above)

Build 2209_3813 - Oct 25 2011

Bugs

Grid Components - Security - Child Grid - Child Grids (i.e. Grids opened in a Row Expander, Linked Content Section, pop-up Ajax windows, etc.) were not correctly honoring security framework restrictions.

.Net Framework Integration - The .Net type System.Byte was incorrectly mapped to the Xbasic type P. It should have been mapped to a type N.

Web Applications - Live Preview - Publishing Support Files - When you do a Live Preview of a Grid, all support files (CSS, Javascript, etc.) are published regardless of whether they have been published before. Now, the other components (Dialog, Tabbed UI, Page Layout, etc) behave similarly.

Calendar Component - Was not honoring the 'readonly' flag.

 

Build 2207_3811 - Oct 24 2011

New Videos

Several new videos have been released. Click here to see all Videos. New videos are:

D18 - Putting images on buttons in a Dialog

Cal3 - Automatically creating new records in the Calendars table in the Dialog Component

Bugs

 

Application Server - The Response to a HEAD Request will now never include a message body, as required in the HTTP protocol specification.
Application Server - The error message and logging has been enhanced when the server receives a Request that includes an unsupported protocol. The exact protocol requested will be included in the logged and returned messages.
Grid Component - Action Buttons - Animation on Show/Hide - Action buttons now support animation on the client-side show/hide expressions.

Grid Component - Master Template - Custom - Pre-defined Templates - The generated Javascript did not use syntax appropriate for V11 Styles.

Calendar Component - Work Week Default View - Gave an error when selecting 'Work Week' as the default view.

Dialog Component - Dropdownbox - Session Variable - Setting a Dropdownbox Choice List to a session variable was not working.

Calendar Component - Calendar Table - GroupId Field - Changed the definition of the GroupId field in the Calendar table. This field is no longer an auto-increment field. This change was necessary to support the feature to automatically create new calendar records (described below).

Grid - Alternate View - Centering Map - Google Map -If you turned off the 'Scale map to show all markers' property the map was always centered on Burlington, MA (Alpha's headquarters) - regardless of what you set as the map center point. This is now fixed.

 

Features

Tabbed UI - Tree Control - You can now set security on tree branches.

Dialog Component - Buttons - Styling -  You can now have many more options for styling buttons. See video 'D18'

Below are examples of buttons with images where the image has been set to the left of text and then above text.

 

Calendar Component - Automatically Create New Record in Calendar Table - When the calendar is opened from a Javascript action, you can specify the Id of the calendar to show. If there are no calendars that match the specified calendar Id to show, you can now optionally automatically create a new entry in the 'Calendars' table. When you define the action that opens the calendar, you will be able to set the value of the 'DescriptionForNewCalendar' argument, which will set the 'Description' field in the new calendar record that is created.  See video 'Cal3'.

IMPORTANT: If you want to use this feature and you have already defined your Calendar table, you must edit the table definition, and turn off the auot-increment property for the Calendar table. You will also need regenerate the Dialog component for editing events.
 

Build 2199_3810 - Oct 20 2011

Bugs

Navigation System - V11 Styles - CSS - Some of the CSS that was being applied to the menu items was incorrect, resulting in some items in the menu appearing pressed after you had moved the mouse out of them.

Features

Buttons - UI Feedback - Buttons in Grids, Dialogs, Tabbed UI and Page Layout Components now give visual feedback when moving the mouse over them, or clicking them. NOTE: This comment does not apply to Action Buttons in Grids which have always given visual feedback.

Property Grids - Smart Fields - DoubleClick Action - Many of the properties in the Property Grids used throughout Alpha Five have smart fields (little button with three dots on them). Clicking the button opens some type of helper. Previously, the only way to open the helper was to click on smart field button. Now, you can also double click on the property name to open the helper. In addition, if the property value is read only - i.e. you can't type a value, you have to change the value using the helper - you can also double click on the property value to open the helper.

 

Build 2197_3808 - Oct 19 2011

Bugs

Grid Component - Form Layout - Snaking Columns - If there were no records in the Grid you would get an error about the 'flagHasGroups' variable not being found.

Grid Component - Fixed Width Columns - Detail View - If you had a Grid with a Detail View, and you had set fixed width columns in the Grid part, the Detail Part was also rendered using fixed with settings. This was incorrect. You will need to make the Grid dirty and then resave to see the fix.

Image Gallery Component - If an Image Gallery was opened from a button in a Grid, it would display correctly the first time it was opened, but not display when opened subsequently.

Features

NetMailer and ReportMailer - Install for V11 -  The install programs for both NetMailer and ReportMailer have been updated to allow installation for V11. You will need to download the applications again using the same link you used to download them originally.

Component Builders - Selecting a Style - Previously when you clicked the smart field to select a Component Style, you would get a dropdown menu prompt whether you wanted to select a style or edit a style. The menu is now eliminated. Instead the 'Select a style' option is automatically assumed. The 'Select a style' dialog has been enhanced and now has a button to edit  a style.

Web Application - jQuery Libraries - Protocol - If you have specified in the Web Project Properties that jQuery should be loaded from Google or the jQuery web site, the HTML markup that is generated to link the jQuery libraries now no longer includes the protocol (http:) in the link. This prevents browser warnings from appearing if the host page is using the https protocol.

Web Applications - Project Properties - Image Gallery - You can now specify that the Image Gallery Javascript libraries should not be loaded.

Reports - Layout Table Reports - CSS -   The CSS used for Layout Table Reports has been updated.

Build 2195_3808 - Oct 18 2011

New Videos

Several new videos have been released. Click here to see all Videos. New videos are:

DT4 - Charting - The charts that you embed on a Form or Report can plot summary data. The charts can either be defined declaratively, or you can use custom Xbasic. These videos show how a chart that summarizes attendees at a seminar by state can be defined using the built-in Chart Genie, or using Xbasic.

 

Bugs

Tabbed UI - Footer not positioned properly in IE.

Filefind.get_recurse_low() Function - Was not working properly when the FILE_FIND_NOT_DIRECTORY argument was used.

Dialog Component - Dynamic Choices Lists - Dropdownbox, Radiobutton, Checkbox - Was broken by a change in the previous update. This is now fixed.

Reports - Memo Fields - If a report had memo fields data, the data in the memo field was not shown in the first record printed in the report.

Settings Dialog (View, Settings Command) - Was not saving changes that were made.

 

Features

Calendar Component - A new version of the Web2Cal Javascript library is included (Build 67).

HTML Reporting - The CSS style sheets used for HTML reports have been improved. The reports now look nicer.

Web Control Panel - New Toolbar Buttons - New buttons on the Control Panel allow you to:

Component Builders - Most of the component builders now have a new button on the toolbar to open the Web Style Builder.

 

Build 2193_3805 - Oct 17 - 2011

New Videos

Several new videos have been released. Click here to see all Videos. New videos are:

 

SB11 through SB17 - More videos showing how to use the new Style Builder in V11.

D17 - Adding a Row Number to Each Row in a Repeating Section in a Dialog Component.

Features

Calendar Component - Calendars to Show and Initial Date Arguments - When you open a Calendar Component from an Action Javascript button, or from a button on a Tabbed UI or Page Builder component, you can now set the value for two arguments that the Calendar Component exposes. The 'CalendarsToShow' argument can be set to 'All', or a comma-delimited list of the calendar Ids that you want to show. The 'InitialDate' argument can be set to 'Today' or an explicit date value.

 

Build 2191_3805 - Oct 16 - 2011

Features

 

Dialog Component - Repeating Sections - Row Numbers - You can now display row numbers for each row in a Repeating Section.

 

Calendar Component - License number - You can not optionally specify the Calendar Component license number in the Project Properties dialog, rather than in the component itself.

 

Grid Component - Toolbar Button to Export to Excel/Ascii - Additional properties have been added to the builder. You can now specify the setting for 'Export Hidden Columns' and 'Use Column Headings'. Previously, if you wanted control over these properties you had to use the Export action in Action Javascript.

 

Grid Component - SQL Tables - Primary Key - Auto-increment - Generally, when you build a Grid that is based on a table or SQL select statement, Alpha Five automatically figures out what the primary key of each table is, and whether that primary key is an auto-increment field or not. However, in some cases, when the Grid is based on a view, it is not possible for Alpha Five to determine what the primary key of the view is. In these cases, you need to specifically tell Alpha Five what the primary key is. The dialog in which you specify the primary key has been enhanced to also allow you to specify if the primary key is an auto-increment field.

 

 

Bugs

Calendar Component - If you set an appointment to 'All Day' the 'AllDay' fields in the Events table was not getting updated. To get the update, you must regenerate the Dialog Component used to update Events. Also, an updated version of the Calendar Javascript has been included. This update fixes a bug that occurred when clicking on a date value in the Week View. To get the updated Javascript, simply edit the Calendar component - this will copy the updated Javascript from the Alpha Five, 3rdPartyComponents folder to your Web Project. Be sure to also clear your browser cache.

 

A5W Page - Multiple Grids on Page - Styles - If you had a .a5w page that contained multiple Grid components, each of which used a different style, Tabs and Accordion controls on the second and subsequent Grid did not render correctly.

 

Grid Component - Dropdown Boxes - 'No selection value' - The 'No selection value' which should have been displayed when there was no current selection in the dropdown box was not being handled correctly.

 

Grid Component - HTML Editor - File Upload Button - Was not working correctly.

 

Grid Component - Export - Use Column Headings - If you defined an export operation to use column headings for the fields in the export file, if you had used the HTML <br> tag in your column heading, the exported file showed 'br' in the field name, rather than a space.

Grid Component - Search Part - Checkbox and Radiobutton Controls - Snaking Layout - Was not working correctly.

 

 

Build 2187_3801 - Oct 14 - 2011

Features

Calendar Component - Check for Existing Record in 'Calendar' Table - When you create a new Calendar component, at the time you save the component, Alpha Five now checks to see if there is at least one record in the 'calendar' table. If not, it offers to create a sample record. This is helpful because, for the calendar to operate correctly, there must be at least one record in the calendars table.

 

Calendar Component - Foreign Languages - The Calendar component comes with language files for English, French, Italian and Spanish. These files are in the Javascript\Local folder in the Web Project Folder. The filenames are of this form: locale_FR.js. You can make copies of these files (using a two letter abbreviation for the language code) and then specify the language code in the Calendar builder.

New Videos

Several new videos have been released. Click here to see all Videos. New videos are:

R3 - Adding a chart to the summary Invoice report in Alphasports

IG1 - Getting started with the new Image Gallery component

SB4 through SB10 - More videos on using the new Style Builder.

 

 

Build 2185-3799 - Oct 13 - 2011

New Videos

Several new videos have been released. Click here to see all Videos. New videos are:

SB1 - Introduction to the Style Builder

SB2 - Creating a New Style from a Template

SB3 - Adjusting the Colors in an Existing Style

 

M35 - Understanding Abstract CSS Class Names

Features

Dialog Component - 'Label' for Button, Static Text, Hyperlink and Image - These control types now have a 'Label' property as shown in the image below (see 'Control Label' heading).

As a result of this new property, when you have labels and input controls on the same line, and the input controls have their labels above the control, the controls now line up better, as shown below (assuming the Label Position property on the buttons is set to 'Above')

 

Previously, this is how the controls would have lined up. This is now equivalent to setting the Label Position property to 'None'

 

 

 

Bugs

Dialog Component - Repeating Sections - HTML Editors - HTML Editor was not working for controls in a Repeating Section.

 

Build 2183-3798 - Oct 12

 

Features

Grid Component - Group Breaks - Collapse - If collapse a Group Break, then navigate to a new page, then return to the original page, the Group Break is still shown as collapsed. Previously, it was shown as expanded.

Bugs

Components - <ProjectStyle> - Fixed issues with inserting components into pages when the component used <ProjectStyle> as the style name.

 

 

Click here to see the Release Notes from the Version 11 Beta Test Period