DEFINING AN ABL FORM AND BINDING SOURCE

Similar documents
SORTING DATA WITH A PROBINDINGSOURCE AND.NET CONTROLS

USING APPSERVER SUPPORT IN OPENEDGE ARCHITECT

UPDATING DATA WITH.NET CONTROLS AND A PROBINDINGSOURCE

CREATING AND USING THE CLIENT-PRINCIPAL

CALLING AN OPENEDGE WEB SERVICE

BUILDING AND USING WEB APPLICATIONS

LOADING DATA INTO TENANT TABLES

USING THE OEBPM API. John Sadd Fellow and OpenEdge Evangelist Document Version 1.0 May May, 2012 Page 1 of 15

Lecture 18 Tao Wang 1

Creating a new CDC policy using the Database Administration Console

The Backend of OE Mobile in OpenEdge Mike Fechner, Consultingwerk Ltd. PUG Challenge Americas, June 2013

Managing Data in an Object World. Mike Fechner, Director, Consultingwerk Ltd.

TIBCO ActiveMatrix Adapter Service Engine for Files Examples. Software Release 6.0 April 2009

ADO.NET 2.0. database programming with

SDMX self-learning package No. 5 Student book. Metadata Structure Definition

Chapter 10 Introduction to Classes

VB.NET Web : Phone : INTRODUCTION TO NET FRAME WORK

ArtOfTest Inc. Automation Design Canvas 2.0 Beta Quick-Start Guide

CSC 330 Object-Oriented

How to use data sources with databases (part 1)

Session Overview. Stand Tall with the. Paul Guggenheim. Paul Guggenheim & Associates. UltraWinTree Overview Uses Features

Getting Started with Web Services

USE QUICK ASSIST TO REMOTELY TROUBLESHOOT A FRIEND S COMPUTER

Getting Started with Web Services

TIBCO Kabira Adapter Factory for SNMP Installation. Software Release December 2017

BASICS OF SPATIAL MODELER etraining

Database Binding Component User's Guide

Designing the staging area contents

OPENEDGE TRAINING SYNOPSES course synopses for OpenEdge Training.

Written by John Bell for CS 342, Spring 2018

Creating Your First Web Dynpro Application

WDJ: Adaptive Web Service Model Controller Coding Explained

Telerik Corp. Test Studio Standalone & Visual Studio Plug-In Quick-Start Guide

Apply a Design Pattern

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

CA Clarity Project & Portfolio Manager

Oracle Java CAPS Database Binding Component User's Guide

opensap TEXT ANALYTICS WITH SAP HANA PLATFORM WEEK 1

Chapter 10. Database Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

CS 61B Data Structures and Programming Methodology. July 7, 2008 David Sun

Lucrare pentru colocviu de practică

How to Get Started. Figure 3

Getting Started with FPM BOPF Integration (FBI)

Oracle Warehouse Builder 10g Release 2 Integrating Packaged Applications Data

Advanced Reporting in the Online Report Designer Administration Guide

OOPS Viva Questions. Object is termed as an instance of a class, and it has its own state, behavior and identity.

ActiveVOS Fundamentals

User s Manual. for. Diagram Consistency and Validation in agenttool III

TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON Installation. Software Release 1.0 November 2012

C#.NET TRAINING / /

Configuring Oracle Java CAPS Master Index (Repository) Connectivity and Environments

Talend Open Studio for MDM Web User Interface. User Guide 5.6.2

Exposing CICS Transactions to WLE

M Introduction to Visual Basic.NET Programming with Microsoft.NET 5 Day Course

Creating custom reports is for advanced users only. It is the sole responsibility of the user to debug any custom reports.

Database Management System Dr. S. Srinath Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No.

CIM University: Using Enterprise Architect Schema Composer

Data Validation in Visual Composer for SAP NetWeaver Composition Environment

Oracle Cloud. Using the Oracle Mapper Release 16.4 E

Connector for Microsoft SharePoint Product Guide - On Premise. Version

Importing an SNA Custom Handshake Class

HPE.NET Add-in Extensibility

CA ERwin Data Modeler

Classes, interfaces, & documentation. Review of basic building blocks

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

GraphWorX64 Productivity Tips

SAP Workforce Performance Builder

<Insert Picture Here> The Latest E-Business Suite R12.x OA Framework Rich User Interface Enhancements

Importing source database objects from a database

namespace Tst_Form { private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components;

ArcGIS Pro SDK for.net: An Overview of the Geodatabase API. Colin Zwicker Ling Zhang Nghiep Quang

MIS2502: Data Analytics MySQL and SQL Workbench. Jing Gong

EMC Documentum Forms Builder

inside: THE MAGAZINE OF USENIX & SAGE August 2003 volume 28 number 4 PROGRAMMING McCluskey: Working with C# Classes

Stop! Don t throw away that ADM2 code just yet. Jeff Ledbetter Product Architect, Roundtable Software

K2 blackpoint Release Notes

Microsoft Power BI Tutorial: Importing and analyzing data from a Web Page using Power BI Desktop

Building Java Persistence API Applications with Dali 1.0 Shaun Smith

HPE WPF and Silverlight Add-in Extensibility

Visual Structure Manager Administration Guide

An Introduction to C++

Work with Variables in SAP NetWeaver Visual Composer Version 1.00 May 2006

Week 2 Unit 3: Creating a JDBC Application. January, 2015

1. Introduction. 2. Technology concepts

Moving to Altium Designer from PADS Layout and OrCAD capture. Contents

Oracle Adaptive Access Manager. 1 Oracle Adaptive Access Manager Documentation. 2 Resolved Issues. Release Notes Release 10g (

127 Church Street, New Haven, CT O: (203) E: GlobalSearch ECM User Guide

Server Extension User s Guide SAP BusinessObjects Planning and Consolidation 10.0, version for the Microsoft platform

02 Features of C#, Part 1. Jerry Nixon Microsoft Developer Evangelist Daren May President & Co-founder, Crank211

Lampiran B. Program pengendali

Oracle Retail Accelerators for WebLogic Server 11g

TIBCO ActiveMatrix BusinessWorks Plug-in for OData User's Guide

David Peake Product Manager Oracle Application Express. October Copyright 2013, Oracle and/or its affiliates. All rights reserved.

This video is part of the Microsoft Virtual Academy.

C++ Inheritance and Encapsulation

To build shapes from scratch, use the tools are the far right of the top tool bar. These

msolutions Messenger Customization Options

2559 : Introduction to Visual Basic.NET Programming with Microsoft.NET

Data Structures (list, dictionary, tuples, sets, strings)

Creating your first JavaServer Faces Web application

Transcription:

DEFINING AN ABL FORM AND BINDING SOURCE Fellow and OpenEdge Evangelist Document Version 1.0 November 2009 Using Visual Designer and GUI for.net Defining an ABL Form and Binding Source December, 2009 Page 1 of 8

DISCLAIMER Certain portions of this document contain information about Progress Software Corporation s plans for future product development and overall business strategies. Such information is proprietary and confidential to Progress Software Corporation and may be used by you solely in accordance with the terms and conditions specified in the PSDN Online (http://www.psdn.com) Terms of Use (http://psdn.progress.com/terms/index.ssp). Progress Software Corporation reserves the right, in its sole discretion, to modify or abandon without notice any of the plans described herein pertaining to future development and/or business development strategies. Any reference to third party software and/or features is intended for illustration purposes only. Progress Software Corporation does not endorse or sponsor such third parties or software. These notes accompany the first in a series of presentations to introduce you to the Visual Designer in OpenEdge Architect, and to the principles of using the support for GUI for.net in OpenEdge 10 to provide a modern and compelling user interface for your ABL applications. This is the first of two sessions on Creating a Form and a ProBindingSource. In this first session, I create a new ABL Form, add a ProBindingSource control to it to provide data to the user interface, and take a look at the code that gets generated to support the form and its binding source. Starting out in the Editor Perspective in Architect, I select the File menu and select New ABL Form. This creates a new ABL class file to support the creation of a form that I can then drop.net controls onto, along with my own supporting ABL code. December, 2009 Page 2 of 8

I call the class CustomerForm, so the file name will be CustomerForm.cls. I can enter a Description for the form, which will appear in the comments section up at the top. And you can see there are other options for the initial code generation for the class that are left set to their defaults for now. I just click Finish to complete the wizard. Because I created a new Form, Architect automatically opens that form in Visual Designer, which has a visual design canvas for the form and any controls I drop onto it. In addition to manipulating controls visually, I can see and set their properties in the Properties View. I can change the form s Text property, which controls its title, and see that the change is reflected in the form as it s displayed. But I can also switch back and forth between the design and the code that is being generated to create the form at runtime, by pressing F9 or bringing up the context menu and selecting View Source. December, 2009 Page 3 of 8

The first control I add to the form is a non-visual control to manage data for visual controls that can be added later on. It s one of the built-in controls created specifically as part of OpenEdge to support ABL applications, so I expand the list of OpenEdge controls and select the ProBindingSource, dragging it onto the form. As soon as I drop the control onto the form, the ProBindingSource Designer opens, so that I can define the data I want the control to manage. I can get that data definition from an XSD file an XML schema definition file that I could create very easily from ABL, to correspond to a temp-table or ProDataSet definition for instance. Or I can select the DB icon and create schema for the binding source directly from a connected database. In this case I have the AutoEdge sample database connected, so I can expand that selection and pick the Customer table as the one I want the control to manage, and then click OK. December, 2009 Page 4 of 8

If in fact I don t want to use all the fields in the table, I can delete the ones that the form won t need to display. In the Designer I can also change the order of fields so that the default display order for fields in a grid control, for instance, will be the way I want them, just by selecting a field and then the Move Up or Move Down buttons. Now my binding source is set up to manage fields from the Customer table in the database and make them available to any visual controls I add to the form that are data bound, that is, controls that have properties to display data from the binding source. So this is a very powerful feature of our support for GUI for.net, that a standard data source property of many visual controls is satisfied by a specialized control provided as part of OpenEdge. Reviewing the code that results from creating the form and dropping a ProBindingSource onto it, you first see a comment section at the top with the file name, description, and other information. /*------------------------------------------------------------------------ File : CustomerForm Purpose : Syntax : Description : Simple form to display Customers in a grid Author(s) : john Created : Wed Aug 19 09:11:36 EDT 2009 Notes : ----------------------------------------------------------------------*/ The class inherits from the top-level Progress.Windows.Form class. The USING statement identifies the package the Form class is in so that it can then be referenced by its simple name. USING Progress.Lang.*. USING Progress.Windows.Form. CLASS CustomerForm INHERITS Form : December, 2009 Page 5 of 8

Next is a variable definition for the binding source instance. This is the part of the generated code that s outside of the InitializeComponent method, so be careful not to change or delete these lines in the main block of the class. DEFINE PRIVATE VARIABLE BSCustomer AS Progress.Data.BindingSource NO-UNDO. Visual Designer defines a variable named components which acts as a collection for some kinds of controls that it wants to make sure get disposed of properly when the form exits; there s no need to understand more than just to leave the definition alone when you start adding your own code to the form. DEFINE PRIVATE VARIABLE components AS System.ComponentModel.IContainer NO-UNDO. There s a default constructor that runs the method InitializeComponent, and default error handling code that reflects some of the options in the New Form wizard. CONSTRUCTOR PUBLIC CustomerForm ( ): SUPER(). InitializeComponent(). CATCH e AS Progress.Lang.Error: UNDO, THROW e. END CATCH. END CONSTRUCTOR. InitializeComponent is where all the generated code goes that describes the form and its controls, and Visual designer relies on this to be able to reconstruct the form when you re editing it. As the comment notes, you shouldn t edit this method directly. Your own code can go in other parts of the class file. METHOD PRIVATE VOID InitializeComponent( ): /* NOTE: The following method is automatically generated. We strongly suggest that the contents of this method only be modified using the Visual Designer to avoid any incompatible modifications. Modifying the contents of this method using a code editor will invalidate any support for this file. */ Annotations such as this one provide design time information for Visual Designer, and should not be touched: @VisualDesigner.FormMember (NeedsInitialize="true"). The TableDesc and ColumnPropDesc objects are used by Visual Designer to identify at design time what tables and fields the binding source manages. They don t really affect behavior at runtime but they re needed when you add controls to the form at design time that use fields in the binding source, so like all the code in this method, be careful not to touch it: DEFINE VARIABLE tabledesc1 AS Progress.Data.TableDesc NO-UNDO. tabledesc1 = NEW Progress.Data.TableDesc("Customer"). And here is the NEW statement that creates an instance of the binding source. THIS-OBJECT:BSCustomer = NEW Progress.Data.BindingSource(). December, 2009 Page 6 of 8

Similar to SuspendLayout and ResumeLayout for the form, there are methods called BeginInit and EndInit defined in the ISupportInitialize interface that let the code set all of a control s properties before it s displayed. CAST(THIS-OBJECT:BSCustomer, System.ComponentModel.ISupportInitialize):BeginInit(). The SuspendLayout and ResumeLayout methods are a standard convention to prevent the controls from being displayed when they re in the middle of being initialized. THIS-OBJECT:SuspendLayout(). Here you can see property settings for three ProBindingSource properties that have initial values. Two of them appear in the Properties View. The third one, Position, is a good example of another important thing to understand about controls. Part of the design of a control is determining which properties even get displayed in the Properties View, and in this case the control developer has decided that Position is not one of them. So some properties that a control supports may not appear in the Properties View, perhaps because the developer does not expect them to be set by the user. Some may have default values; some may have initial values that are explicitly set and so result in these lines of code being generated. Visual Designer queries each control at design time to determine both what code to generate and what properties to expose for use. /* */ /* BSCustomer */ /* */ THIS-OBJECT:BSCustomer:MaxDataGuess = 0. THIS-OBJECT:BSCustomer:NoLOBs = FALSE. THIS-OBJECT:BSCustomer:Position = 0. Next comes more code used at design time to define the database fields that become columns in the ProBindingSource schema. @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true"). DEFINE VARIABLE arrayvar0 AS "Progress.Data.TableDesc[]" NO-UNDO. arrayvar0 = NEW "Progress.Data.TableDesc[]"(0). tabledesc1:childtables = arrayvar0. @VisualDesigner.FormMember (NeedsInitialize="false", InitializeArray="true"). DEFINE VARIABLE arrayvar1 AS Progress.Data.ColumnPropDesc EXTENT 6 NO-UNDO. arrayvar1[1] = NEW Progress.Data.ColumnPropDesc("CustomerID", "Customer ID", Progress.Data.DataType:CHARACTER). arrayvar1[2] = NEW Progress.Data.ColumnPropDesc("CustomerFirstName", "First (Given) Name", Progress.Data.DataType:CHARACTER). arrayvar1[3] = NEW Progress.Data.ColumnPropDesc("CustomerLastName", "Last (Family) Name", Progress.Data.DataType:CHARACTER). arrayvar1[4] = NEW Progress.Data.ColumnPropDesc("CustomerBirthCountry", "Birth Country", Progress.Data.DataType:CHARACTER). arrayvar1[5] = NEW Progress.Data.ColumnPropDesc("CustomerBirthdate", "Date of Birth", Progress.Data.DataType:DATE). arrayvar1[6] = NEW Progress.Data.ColumnPropDesc("CustomerGender", "Gender", Progress.Data.DataType:LOGICAL). tabledesc1:columns = arrayvar1. THIS-OBJECT:BSCustomer:TableSchema = tabledesc1. December, 2009 Page 7 of 8

The code sets the ClientSize property to determine the size of the form, the Name property, which corresponds to the class file name, and the Text property for the form s title. /* */ /* CustomerForm */ /* */ THIS-OBJECT:ClientSize = NEW System.Drawing.Size(292, 266). THIS-OBJECT:Name = "CustomerForm". THIS-OBJECT:Text = "Customers". And here at the end is the EndInit method that signals that initialization of the control is complete. CAST(THIS-OBJECT:BSCustomer, System.ComponentModel.ISupportInitialize):EndInit(). THIS-OBJECT:ResumeLayout(FALSE). CATCH e AS Progress.Lang.Error: UNDO, THROW e. END CATCH. END METHOD. There s also a destructor that cleans up the components object. DESTRUCTOR PUBLIC CustomerForm ( ): IF VALID-OBJECT(components) THEN DO: CAST(components, System.IDisposable):Dispose(). END. END DESTRUCTOR. END CLASS. This completes the presentation on creating a form and adding a ProBindingSource to it. In the next session on Adding a Grid Control to a Form, you ll see how easy it is to attach your binding source to the controls that display and update the data in your form. December, 2009 Page 8 of 8