Comments
bruce.armstrong wrote: Somebody just said it better than I did, and with more chops to say it: Open Letter to Mark Zuckerberg, Sheryl Sandberg & Facebook Mobile
Cloud Expo on Google News

SYS-CON.TV
Cloud Expo & Virtualization 2009 East
PLATINUM SPONSORS:
IBM
Smarter Business Solutions Through Dynamic Infrastructure
IBM
Smarter Insights: How the CIO Becomes a Hero Again
Microsoft
Windows Azure
GOLD SPONSORS:
Appsense
Why VDI?
CA
Maximizing the Business Value of Virtualization in Enterprise and Cloud Computing Environments
ExactTarget
Messaging in the Cloud - Email, SMS and Voice
Freedom OSS
Stairway to the Cloud
Sun
Sun's Incubation Platform: Helping Startups Serve the Enterprise
POWER PANELS:
Cloud Computing & Enterprise IT: Cost & Operational Benefits
How and Why is a Flexible IT Infrastructure the Key To the Future?
Click For 2008 West
Event Webcasts
PowerBuilder Cover Story — The DataWindow in PowerBuilder 11 Web Form Targets
Transforming an existing PowerBuilder application into a Web application

PowerBuilder 11 introduces the WebForms target, which lets you transform an existing PowerBuilder application into a Web application with relative ease. While the deployed application will be remarkably faithful to the original client/server deployment in terms of application behavior, the degree of faithfulness is limited by the fact that your application is running as a Web application. The PowerBuilder component where this poses the greatest challenge is the DataWindow.

The aim of this article is to point out where the transformed application will differ in terms of latency, performance, and look and feel and what you can do to minimize these differences.

"New" Features
Other than the fact that the WebForms DataWindow runs in the browser, another source of differences in behavior with respect to the traditional client/server DataWindow is the fact that the underlying implementation is the Web DataWindow. We have narrowed this gap by implementing:

  • True Dropdown DataWindows
  • The Dropdown Calendar
  • The EditMask
  • The TreeView processing style
  • Browser locale
Pagination
In client/server applications, the number of rows appearing in a DataWindow is dependent on the size of the control. The FirstRowOnPage and LastRowOnPage properties give you the rows that are actually visible on the page. Scrolling or resizing the DataWindow changes what rows are visible but the DataWindow makes sure that rows are displayed in their entirety - either they're fully visible or they're not visible at all. The vertical scrollbar ranges all retrieved rows (see Figure 1).

In a WebForm application DataWindow, a "page" comprises the rows that happen to be on the browser at any given time. It's possible for the page to comprise all retrieved rows, but by default the page size is 20 rows. The page size serves as a way to tweak performance by controlling the amount of data received and rendered by the browser. In Figure 2 the 20 rows can be scrolled, but to view rows outside this batch of 20 the page navigation bar at the bottom of the DataWindow is needed.

In a WebForm it's possible to make some rows only partially visible through scrolling or resizing. (The DataWindow in a WebForm application doesn't support the FirstRowOnPage or LastRowOnPage properties.) This is in contrast to the DataWindow in a client/server application where the page by definition is all rows that are visible. Another difference is that the scrollbar doesn't range all retrieved rows, only the rows in the page.

The default number of rows per page is configurable through the Configuration tab in the project painter (see Figure 3).

However, this setting is application-wide. To set the number of rows per page for a given DataWindow, use the Rows Per Page property accessible through the Web Generation tab of the DataWindow property pages (see Figure 4).

Uses Script Callbacks
Pagination doesn't use postbacks - instead it uses script callbacks. This means that only the navigated DataWindow will have its contents updated - there's no overhead of re-rendering the entire page.

The Dropdown DataWindow
The default implementation of the DDDW in a WebForm application uses the HTML select tag. Not only does this introduce something different from the original client/server application, it also doesn't scale well because the exact same tag is repeated for every row in the DataWindow. Having more that one DDDW in the DataWindow compounds the problem.

An option exists to render a dropdown as a true DDDW instead of using the HTML select tag. The technique used to render the dropdown as a DDDW shares data across rows, making it more scaleable (see Figure 5). Setting PBDataWindowEnableDDDW to true in the Configuration tab in the project painter can turn on this option.

You can further optimize the rendering of your DDDWs by loading it only on-demand. Using this option, the DDDW isn't sent to the browser when the DataWindow is rendered; it's sent only when the dropdown is clicked. The DDDW is then sent to the browser using the Script Callback mechanism provided by ASP.NET. Setting PBDataWindowScriptCallbackDDDW to true in the Configuration tab in the project painter can turn this option on.

Sharing Read-only DataWindow Data Across Sessions
PowerBuilder applications deployed as WebForm applications allow the data of read-only DataWindows to be shared among different sessions. Other than sharing the data of the primary, delete and filter buffers, the data of DropDown DataWindows can also be shared.

Sharing the Data of Primary, Delete, and Filter Buffers
To avoid duplicating the same data of read-only DataWindows, it's possible to configure your application to share the data across sessions. The specification of which DataWindows to share is done with the PBCachedAndSharedDWs property. Set its value to a string of comma-delimited names of DataWindow objects to be shared.

Restrictions on DataWindows Shared Across Sessions
The following restrictions apply to DataWindow Controls that have a DataWindow object listed in the PBCachedAndSharedDWs entry.

  • Only a single invocation of Retrieve (which must be without parameters) is allowed.
  • No filtering, sorting, deletions, and insertions are allowed.
  • No modifications to the data are allowed.
  • No invocation of ShareData or ShareDataOff is allowed.
  • No invocation of Update is allowed.
When this form of sharing is used, the retrieval events aren't fired. This is because the Retrieve function only shares the data in the cache, no actual retrieval occurs.

Sharing the Data of DropDown DataWindows
It's also possible to share the data of DropDown DataWindows across sessions. The specification of which DataWindows to share is done with the PBCachedAndSharedDDDWs property. Set its value to a string of comma-delimited names of DataWindow objects to be shared if they're the underlying DataWindow of a Dropdown DataWindow column.

Restrictions on DataWindowChild Object References to DropDown DataWindows Shared Across Sessions
The following restrictions apply to DataWindowChild object references to Dropdown DataWindow columns that have a DataWindow object listed in the PBCachedAndSharedDDDWs entry.

  • No invocation of Retrieve is allowed.
  • No filtering, sorting, deletions, and insertions are allowed.
  • No modifications to the data are allowed.
  • No invocation of ShareData or ShareDataOff is allowed.
  • No invocation of Update is allowed.

About Frederick Koh
Frederick Koh is a Staff Engineer at Sybase, Inc., and has been a member of the PowerBuilder and DataWindow.NET development team since 2005. Frederick has over 14 years of IT industry experience.

About Li, Zhao
Li, Zhao is a senior engineer at Sybase, Inc., and has been a member of the PowerBuilder and DataWindow.NET development team since 2006. Li, Zhao has over 10 years of IT industry experience. Li, Zhao has written articles for various computer science conferences and journals.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Latest Cloud Developer Stories
We’re happy to announce general availability of Intel Cloud SSO IAM-as-a-service today after running it in private beta mode for 2 months with select customers. See press release here. Intel has partnered with Salesforce to develop and run this application …
With Cloud Expo 2012 New York (10th Cloud Expo) now just under three weeks away, what better time to introduce you in greater detail to the distinguished individuals in our incredible Speaker Faculty for the technical and strategy sessions at the conference...
With BigDataExpo 2012 New York (www.BigDataExpo.net), co-located with 10th Cloud Expo, now just three weeks away, what better time to introduce you in greater detail to the distinguished individuals in our incredible Speaker Faculty for the technical and strategy sessions at the ...
In his session at the 10th International Cloud Expo, Marvin Wheeler, Open Data Center Alliance Chairman, will discuss the success the organization has had in charting the requirements for broad-scale enterprise adoption of the cloud and how 2012 is forecast to be the tipping poin...
The move to cloud-based applications has undeniably delivered tremendous benefits. However, the associated distribution creates various challenges from the quality perspective: End-to-end tests need to pass through multiple dependent systems, which are commonly unavailable, evo...
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