Comments
Matt McLarty wrote: For more info... Follow me on Twitter See our website
Cloud Expo on Google News


2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
SYS-CON.TV
Top Links You Must Click On


Slick Tricks
Slick Tricks

Setting Column Attributes at Runtime
If you want your DataWindows to look consistent, you have two basic choices. The first one - always code the DataWindow expressions the same in all your DataWindows. However, there are drawbacks to this: you have to make sure your entire development team is aware of the standards, and you have to have methods to ensure their use and document the standards for future developers. In spite of such precautions, it's likely your DataWindows will stray from the standards you've set up. The second and better approach is to put the standards in your base DataWindow. Randy Howie of the American Skiing Company has done this with a function to set the protection and background mode on DataWindow columns at runtime. His function takes two arguments, as_columnName and as_expressions. The expression is the same kind you would use in the DataWindow column. For example, if you wanted to prevent users from modifying the last name of an employee in department 100, you would put the following expression on the emp_lname column for protection: if (dept_id = 100 , 0, 1). Since it's a good idea to give the user visual clues, you might also want to set the background.color to something like "silver" if the field isn't editable. You'd then need an additional statement for the color attribute such as: if (dept_id = 100, 12632256,rgb[255,255,255]) which would make the column silver or white.

The good thing about doing this in a function, of course, is that if you decide to change the color scheme later on, you have to change the code in only one place. Randy's code sets the protection of the column and the background.mode (transparency) property. The function (see Listing 1) first attempts to set the background mode. If it succeeds, it then proceeds to set the protection property. Clearly you can modify this function to set other properties to create a consistent "object-oriented" look to your DataWindows.

Listing 2 shows some sample calls to the function.

Randy Howie is a technical manager at American Skiing Company. He can be reached at rhowie@steamboat-ski.com

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

Register | Sign-in

Reader Feedback: Page 1 of 1

Enterprise Open Source Magazine Latest Stories . . .
New tools and services for swift software-as-a-service integration in the cloud lowers the barrier to SaaS adoption for SaaS providers and developers. MuleSoft this week launched Mule iON SaaS Edition, providing a broad set of new tools and services for swift software-as-a-Service (Sa...
All the buzz surrounding OpenStack over the past few months may beg the question of whether Openstack can repeat for Cloud what Linux has done for server operating systems over the past several years. With an enthusiastic following and a compelling, if not industry-leading set of funct...
Virtual Desktop Infrastructure (VDI) has been a hot topic in the IT community for years but delivery models have limited its use. Today there are real options for using the technology to truly replace the existing desktop infrastructure to realize tangible benefits. Today’s cloud-sourc...
VMware hypervisors of the ESX family (3.x, 4.x and 5.0) are fully, out-of-the box supported by the latest versions of OpenNebula(3.0+). If you have a server farm based on any of the ESX versions, then you can make use of OpenNebula to better manage your physical (and virtual) resources...
Data centers today are stretched to the limits with fast-paced business demands. On top of that, integrating and managing IT infrastructures can pose major challenges. Organizations need a new solution that consolidates servers and workloads without breaking the bank—and Linux, togethe...
Atlantis Computing, a provider of Virtual Desktop Infrastructure (VDI) storage and performance optimization solutions,has announced the release of Atlantis ILIO Diskless VDI 3.2, a solution that enables VMware View customers to deploy virtual desktops with no storage. Atlantis ILIO Dis...
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