mrc Documentation
michaels, ross & cole, ltd.
http://www.mrc-productivity.com/
|
|
Adding
a Pop-up Calendar to your Report/Maintainer
When
your end user needs to enter a date into a form (Either a maintainer or the
prompt page of a report), I am sure your cringe. What if they enter the date in
the wrong format? What if they try to put slashes into an all numeric date
field? All in all, you are asking for trouble. With this in mind, m-Power gives
you the ability to add, quite easily, a date pop-up calendar to your servlet.
In
the example below, we will add a Pop-Up Date Calendar to a maintenance
application.
Build
your maintenance application as you normally do. After specifying files,
fields, and sequencing, select the Preformat link. Select the field to which
you wish to add the Pop-Up Calendar functionality.

Notice
we have added a “C” to the User Defined Field Control. Note: Due
to the flexibility of m-Power, you do
not need to specify a “true” date field. Any numeric or alpha field will
work.
Click
“Accept” and Build/Compile your application.

Selecting
a date, will close the pop-up box and place the value into the form.

A
common question – Your date utilizes
MM/DD/YY, what if I want YY-MM-DD or YYYYMMDD. Is this possible?
Yes
– it is quite easy to accomplish. In this example, let’s say my “Order Date”
field was an 8 numeric field. We could display the date from the calendar as
YYYYMMDD. We will need to make this change within the Painter. Open the Source
mode within m-Painter.
Click
the
and search for “onclick.”
This will take us directly to the line we need to modify
![]()
Change
the ‘mm/dd/yy’ to a standard form that better suits your needs. In our case:
![]()
Click
the “Save and Deploy” icon and run your application.
Now,
when I click on the calendar, my output looks like this:
