.
 News & Views
  The online information source for iSeries and mrc-Productivity Series users
.  January 2002  
Volume 2, Issue 1  
.
. . . . . . . . .
in this issue
.
.
 

How to Add a Built-In Pop-Up Calendar to your Application

by Brian Crowley
By popular demand, our Web/CGI maintenance templates now include the ability to specify a pop-up calendar for an input field. The application builder can customize many features of the calendar including the date format, calendar position, and all colors.

How to use the pop-up calendar
From the Application Options screen, select the Preformat screen (option 5.) Perform option 2 on the date fields in your application. Change the "User defined field control" to "C". Then recompile your application. The template will do the work of creating a pop-up calendar for each date field you have specified this way.

Customizing the functions
After compiling the application, you can modify many parameters controlling the functions of the calendar. Use STRPDM to modify library(Data Dictionary)/file(QHTMLSRC)/member(Mxxxxx) where xxxxx is the application number. Here are those parameters:


Click to enlarge


Some parameters are enclosed in quotes. Please keep those in quotes and the others not. Those in quotes are String values and the others are numeric variables.

Customizing the colors
Modify /mrcjava/mrcclasses/cal.js. Better yet, because mrc ships that file and your changes would be overridden by an update from mrc, copy that file to another name like mycal.js. Then, modify mycal.js and change your QHTMLSRC skeleton to point to mycal.js instead of cal.js. Near the top of the JS file, you'll find these customizable colors:

var bgColor = "#ffffff";
var cellColor = "#ffffff";
var headingFontColor = "#ffffff";
var headingColor = "#006488";
var buttonFontColor = "#006488";
var buttonColor = "#ffffcc";
var borderColor = "#006488";
var selectedColor = "#9c9c9c";

You may use the RGB values as we have or the valid color words. Valid color words include "white", "black", "blue", "green", etc.

Other uses
The calendar has uses beyond maintenance applications. Suppose you've built an inquiry application that contains a date as a sort field, and you wish to include a pop-up calendar for users of that application. No problem. Specifying "C" in the User Defined Field Control forces an extra 4 lines of code into the generated QHTMLSRC skeleton. Copy those few lines from a maintenance application into a retrieval's QHTMLSRC skeleton. Be sure to tell it exactly which form field to return the date value: K001, for example.

To see the calendar running live on the Web, visit our demo site:
http://www.crazybikes.com/employees/I00220GC.mrc and select an order for update.

The pop-up calendar is just another of the many features available to users of the mrc-Productivity Series to help make the best Web applications possible.

 
Take Our Poll

Where is your attention in 2002?

Data Security
Risk Management
IT Spending
Job Security
Application Backlog
Info Accessibility
Other

View Results
View Poll Archive

.
.
.
.
. Quick Links...

Visit mrc's Web site

See a live demo

Get more information

View Latest Newsletter

Last Month's Newsletter

.
.
.
.
. Contact mrc...

U.S. Offices
mrc@mrc-productivity.com

voice: 630-916-0662

www.mrc-productivity.com



U.K. Offices
michaels, ross & cole (UK) ltd

voice (UK): +44 (0)20 8282 1600

mail@mrcuk.com


.
 mrc publishes this newsletter on a monthly basis. Subscription is free of charge. Please send any questions or comments about this newsletter to news@mrc-productivity.com. This newsletter is edited by Heather Gately.

Visit our subscription center to update your subscription or unsubscribe.
View our privacy promise.
.