|
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Web Services New Web DataWindow Features in PowerBuilder 7.0.2 C3
New Web DataWindow Features in PowerBuilder 7.0.2 C3
By: Larry Cermak
Jul. 1, 2000 12:00 AM
Since Web DataWindow technology is now used as a building block for many applications, Sybase decided to enhance this functionality and provide some much needed bug fixes. I recently met with the Web DataWindow team to demonstrate what I've been doing for my clients and to discuss some additional functionality that's needed in the Web DataWindow. I'm pleased to say that PowerBuilder 7.0.2 C3 contains many bug fixes that the community has been waiting for as well as four new features. The Sybase staff understands how important this technology is to their customers. While I was there they fixed several bugs that have been around for some time. I provided examples and the bugs were quickly put to rest. These features were added now instead of waiting for PowerBuilder 8. If that doesn't show commitment to making a product successful, I don't know what does! Even though the development staff was very busy, they spent time with me to get the perspective of someone who's building applications for their customers.
Caution
Installation
Overview
Bugs Fixed
JavaScript Caching
Adding up these numbers gives us 3,644 lines in each HTML page that's generated prior to this release. Even considering the comments and Sybase disclaimer lines, this is still a significant number of lines to be downloaded to the browser with each page. Figure 1 shows a simple tabular DataWindow for the product table in the EAS demo database. The HTML generated for this is 98K without the JavaScript Caching turned on. The size of the HTML with caching turned on is 42K, less than half the size! Keep in mind that this is a simple DataWindow; imagine what will happen with larger, more complicated DataWindows. Figure 2 shows a real-world example of an application from one of my clients. This DataWindow is 97K without caching turned on and 25K with it on. If that doesn't demonstrate the strength of this feature, please contact me and show me a better example. JavaScript Caching is implemented with PowerScript Modify calls to set several new HTML generation attributes. These attributes are described in Table 2. The following are sample lines of server-side JavaScript code that makes Modify calls for each of the attributes. dwLocal is the variable that references the HTMLGenerator component. dwLocal.Modify("datawindow.htmlgen.
Appended HTML Syntax/HTML Exits
Figures 3 and 4 demonstrate an example of this functionality. In Figure 3 the Product Description field in the first row contains red text; this occurs when the mouse is passed over the column. When the mouse isn't passing over the column, it contains black text (see Figure 4). This was accomplished with the HTML syntax for the column on the onmouseover and onmouseout HTML events, which generated the following line of HTML. Notice the onmouseover and onmouseout event syntax. <SPAN CLASS=dwMine1A4C STYLE="position:absolute; left:1.616in; top:0.042in; width:1.718in"Once again, this is accomplished with a PowerScript Modify function call. The attribute to be set is objectname. HTML.AppendedHTML. The following code sets these events for the description column. var lv_mod This feature's potential is incredible. I've implemented a technique that displays text when the mouse passes over a particular field. Consider a status field where you want to show a complete description of a status based on the value of the row. This feature can be used to call a client-side event, passing the row number that the mouse is passing over. The client-side event can manipulate HTML layers and make the text in a particular layer visible or invisible. Once you can make the call to a client-side event, you're only limited in what you can do with HTML and client-side JavaScript.
Stand-Alone HTML Syntax
Figure 5 demonstrates some of the syntax by adding formatting with HTML syntax. Notice the various formats. Each of these tags was stored in the field in the database. This technique allows formatting without requiring coding changes. The following syntax was used. HTML Syntax Description This is another feature that's turned on with a PowerScript Modify function call. The property, objectname.HTML. ValueIsHTML, accepts yes or no as the argument. The following line of JavaScript code enabled this feature in the example. dwLocal.Modify("msgtext.HTML.ValueIsHTML='yes'")User-Defined JavaScript File This feature allows a developer to implement a user-defined JavaScript file, which is used to store common client-side JavaScript functions that are coded by the developer. This will help promote code reuse and will work in conjunction with the append HTML and stand-alone HTML syntax features. Consider an application where every field calls a client-side function when the mouse enters and leaves a column. Some simple code will display an alert message for each of these events as shown below. function ClientMouseOver() This code is placed into a file that will be referenced by the generated HTML. This saves the developer from coding the same routines repeatedly. For this example the file will be named html_cermak.js. The reference to this file in the generated HTML is created with a Modify function call as shown below. <SCRIPT LANGUAGE="JavaScript" SRC="http://localhost/articles/html_cermak.js"></SCRIPT>The Modify function call to create this SRC reference uses the HTMLGen.UserJSFile property of the DataWindow. "DataWindow.HTMLGen.UserJSFile='html_cermak.js' "As stated previously, this feature works in conjunction with the appended HTML or stand-alone HTML syntax features. This example uses appended HTML syntax to call the ClientMouseOver and ClientMouseOut events from the description column. It calls these client-side events as the mouse passes over and out of the description column. These events are coded in the html_cermak.js file. The appended HTML syntax to call these events is shown below. lv_mod = "description.HTML.AppendedHTML=' ~t" + lv_quote
Conclusion
If you'd like a copy of this code along with the DataWindow objects, please e-mail me and I'll make it available. Because this example uses the EAS demo database, it's easy to make this example work on any machine. In the future I'll make the code for every article available for download on our Web site, www.ctpartners.com. If you have any ideas on future articles about the Web DataWindow, please e-mail and I'll do my best to write about it. If you have a question about a technique, please contact me. Chances are that others have the same question. In addition, please pass along any comments you have on this new and exciting feature of EAStudio. See you at TechWave! Reader Feedback: Page 1 of 1
Latest Cloud Developer Stories
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week
Breaking Cloud Computing News |
||||||||||||||||||||||||||||||||||||||||||||||||