YOUR FEEDBACK
Two great PDF creators
Michael Jahn wrote: related to the snapscan - are their an samples of the ...
SOA World Conference
Virtualization Conference
$50 Savings Expire May 23, 2008... – Register Today!


2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
POWERBUILDER LINKS YOU MUST CLICK ON


TreeView DataWindow Presentation Style
A welcome addition

Digg This!

One of the first things you'll notice when you open up the File -> New -> DataWindow dialog is the new TreeView DataWindow presentation style (see Figure 1). The first thing you'll actually notice is that all of the IDE icons have more of an XP style, but then you'll notice the new presentation style. Once you've double-clicked on that you'll see the same series of dialogs that you're already familiar with from the other presentation styles, in which you select the data source, the tables to use, the columns in the tables, etc.

That is, it will be familiar until after you've finished defining the SELECT statement. Once you leave that, you encounter a new Report Definition dialog (see Figure 2). Here you indicate whether you want the TreeView DataWindow to be a Grid Style or not and which columns from the SQL statement should be associated with the first level on the TreeView. You can add other levels to the TreeView after it has been created, similar to the way you create additional group breaks in a group DataWindow (see Figure 3).

For the purposes of walking through the implementation of a TreeView presentation style DataWindow, we're going to use the DEPARTMENT and EMPLOYEE tables from the EAServer demo database supplied with PowerBuilder. The SQL statement we'll end up using is shown in Listing 1.

The result is shown in Figure 4. That figure also shows the new TreeView properties for the DataWindow. You'll notice that I have open and closed folder icons for the TreeView items. Those aren't provided by default. Instead, check the "Use Tree Node Icon" on the DataWindow and then specify the icons you want to use for each band in the "Expanded Tree Node Icon File" and "Collapsed Tree Node Icon File" for each group band (see Figure 5) or as the "Tree Node Icon File" on the detail band. The display of lines between the child elements are controlled by the "Connect Leaf Nodes" property. If the "Show Lines" option is turned off, no lines will show including the lines between child elements and the lines from the root to the first level items. The "Expand to Level by Default" shows how far down the TreeView the items are already expanded when the DataWindow is first retrieved. The "Indent Value" determines how far the icon is from the +/- characters and the "State Icon Align Mode" value determines the vertical position of the icon ( top, centered or bottom ) within the band.There are a couple of items to note about the TreeView presentation style. A native TreeView control only allows a single text label for the nodes. With the TreeView DataWindow presentation style, you can provide many columns of detail information, each with its own edit mask that the user can update. And, like most other DataWindow presentation styles, the TreeView DataWindow is updateable!

The grid form of the TreeView presentation style (the one shown here) also allows for column headers and column resize and movement - much like the standard Grid DataWindow presentation style. In a way, it's like a cross between a TreeView and a ListView. The non-grid version also allows for column headers, but column resizing and movement is not permitted (more like a tabular DataWindow presentation style). The non-grid version is a bit better if you want to display multiple columns of information in a non-detail band, because it won't attempt to force the columns to fit the confines of the detail column layout. However, as with group DataWindows, you can't set a tab order in a non-detail band of the DataWindow. Therefore, the data in any band other than the detail band is not directly editable by the user. As with a group DataWindow, there is a header and trailer band for each level, a header and footer band for the entire DataWindow, as well as a footer band.

You can get a feel for how much of a normal TreeView control's operation is supported by the new TreeView Presentation Style DataWindow by comparing the events, properties, and methods of both. The TreeView events and the corresponding DataWindow events are listed in Table 1. (Note that not all of the DataWindow events are listed, just those corresponding to TreeView events.) The vast majority of TreeView events are supported; there are only six events that are not supported. Most of those events represent actions that you as the developer will need to code support for (e.g., DeleteItem, Sort), so you'll have the opportunity to add events for those actions if you choose. Note that some of the event names begin with "pbm_dwn". Those events are defined in the Event ID list, but don't have assigned events. That means if you want to code the event, you'll need to define a user event and map it to the Event ID. Also note the Event IDs that have an asterisk behind the name. Those events are new in PowerBuilder 10.5 to support the new TreeView Presentation Style DataWindow.

Table 2 shows the TreeView functions and the corresponding DataWindow functions. Once again, not all of the DataWindow functions are listed, just those that correspond to the TreeView function. Once again, the functions that have been added beginning with PowerBuilder 10.5 are marked with asterisks. One thing that becomes obvious is that the TreeView Presentation Style DataWindow does not support the PictureName or StatePictureName arrays. Instead, the developer just specifies the expanded and collapsed icons for each level and a single icon for the detail band. Of course, developers can add as many icons as they want to the DataWindow, but it does mean that many of the picture manipulation functions of the TreeView are not supported.

Table 3 lists the TreeView properties and the corresponding DataWindow properties. The list is not complete as far as DataWindow properties, and new DataWindow properties are shown with an asterisk. Also note that in some cases the corresponding property is on the DataWindow Control, in other cases it is on the DataWindow Object or a control within the DataWindow object. The main difference is that the TreeView DataWindow Presentation Style does not support the PictureName or StatePictureName arrays, so many of the TreeView picture-related properties are not supported. In other cases, the functionality implemented by a particular TreeView property is not directly supported, but is easily added by the developer.

The one area where the native TreeView does provide some capability beyond that offered by the TreeView DataWindow Presentation Style is in flexibility with regard to data sources. The TreeView DataWindow Presentation Style is essentially built on the Group DataWindow Presentation Style. As a result, there is a single data source (the one select statement) and the data for all levels is retrieved on the initial retrieve of the DataWindow. With the native TreeView control, the data source for the various levels, and perhaps even the various items, could be independent of one another. For example, in the PFC version of the TreeView it was possible to assign a different data source (e.g., DataWindow object) for each level of the TreeView. In addition, the data retrieval for each level of the TreeView, or even each branch, could be delayed until the user wanted to see the data. The former feature is important for presenting very complex data sets, whereas the latter feature is important for presenting very large data sets. Perhaps some future version of PowerBuilder will give us a second TreeView DataWindow presentation style. The one introduced here could be the "Group" version, and we might end up with another based more on the Nested DataWindow Presentation Style that might allow for more variety in data sources and more control over the timing of the retrieval of the underlying data.

Until then, however, the TreeView DataWindow Presentation Style does provide near-native TreeView control functionality in all other regards, and expands on them with the ability to display multiple columns of updateable data. All in all, a welcome addition to the DataWindow presentation style capabilities.

About Bruce Armstrong
Bruce Armstrong is a development lead with Integrated Data Services (www.get-integrated.com). A member of TeamSybase, he has been using PowerBuilder since version 1.0.B. He was a contributing author to SYS-CON's PowerBuilder 4.0 Secrets of the Masters and the editor of SAMs' PowerBuilder 9: Advanced Client/Server Development.

PBDJ LATEST STORIES . . .
3rd International Virtualization Conference & Expo: Themes & Topics
From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in midtown
The PB Future: More on Graphs in PowerBuilder 11.5
Last week I posted a screen shot of the new 3D Rendering capabilities being added to some of the 3D graphs in PowerBuilder 11.5. It was met with mixed reviews on the PowerBuilder Futures newsgroup (forums.sybase.com) so I went back to the drawing board to see what I could come up with.
BluePhoenix Expands Modernization Collaboration with Microsoft
BluePhoenix announced that it has expanded its collaboration with Microsoft on legacy modernization projects. The collaboration provides customers moving their applications or databases to .NET-based environments the best in both modernization services and technical support. BluePhoeni
Sybase PowerBuilder Delivers AJAX and .NET Enhancements Enabling Rich Internet Application Development
Sybase announced that AJAX development capabilities and further Microsoft .NET enhancements have been added to the latest version of Sybase PowerBuilder 11, the premier 4GL rapid application development (RAD) tool. PowerBuilder 11.2 represents another milestone in the PowerBuilder road
PowerBuilder 11.2 Released: Sybase's Flagship IDE
Sybase has released the production version of its flagship .NET development tool - PowerBuilder version 11.2. This latest release of its premier IDE for RAD includes not only standard fixes but also a good list of new features. Here is the 'Coles Notes' version of these new features.
PowerBuilder Takes You To .NET
In June of 2007, Sybase released PowerBuilder 11. PowerBuilder developers can now deploy PowerBuilder components as .NET Assemblies or as .NET Web Services. A PowerBuilder developer can now create these .NET resources so that those who develop .NET solutions can benefit from PowerBuild
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING POWERBUILDER / SYBASE NEWS
Sybase and Sun Set Guinness World Record for World's Largest Data Warehouse
Sybase, Inc. (NYSE:SY), the largest enterprise software and services company exclusively