Tech Corner
Using mode parameters will make your Web applications easier to use
by Brian Crowley
|
Sometimes an application designer wants more control over the maintenance applications she builds with the mrc-Productivity Series or mrc-Lightning CE.
To make applications more user-friendly, the designer might wish to use functions like single-click add/update/delete, or defaulting values into a form from a previous screen. These functions are accomplished simply by assigning the correct values to existing parameters available in generated applications.
The parameters are slightly different in Web/CGI and Web/Servlet applications, but the functionality is available in both. Please see the tables and examples below to determine what you need.
In the table, Prompt means that the user will see the maintenance screen. Perform means that the maintenance screen is bypassed and the database function is performed automatically, like the single-click update.
Web/CGI Applications
Values for parameters KCMODE/KCTLCD:
| | Add | Update | Delete |
| Prompt | A/APS | U/UVK | D/DVK |
| Perform | A | UURD | D/DDR |
Examples assume:
Only one key field CUSNO.
Only one non-key field CNAME.
Example of add mode with defaulted values:
http://192.168.0.170/mrcjava/mrcworklib/M00010GC.mrc?KCMODE=A&KCTLCD=APS&K001=100300&K002=Test
Example of single-click add:
http://192.168.0.170/mrcjava/mrcworklib/M00010GC.mrc?KCMODE=A&K001=100300&K002=Test
Example of single-click update:
http://192.168.0.170/mrcjava/mrcworklib/M00010GC.mrc?KCMODE=U&KCTLCD=UURD&K001=100300&K002=Testing
Example of single-click delete:
http://192.168.0.170/mrcjava/mrcworklib/M00010GC.mrc?KCMODE=D&KCTLCD=DDR&K001=100300
Note: KXXX is the naming convention for fields in Web/CGI applications where XXX is the field number of the application- for example, 'K001' would refer to field number 001. The field number is determined by its sequenced order within the application as demonstrated on the Preformat screen.
Alternatively, you can choose to not specify KCMODE and KCTLCD and instead specify only @SMLNK:
@SMLNK=U takes user to Maintainer in Update-Only mode.
@SMLNK=D takes user to Maintainer in Delete-Only mode.
@SMLNK=Y takes user to Maintainer in Update mode and Delete mode is available too.
Web/Servlet Applications
Values for parameter action_mode:
| | Add | Update | Delete |
| Prompt | AVK (and slnk=1) | UVK | DVK |
| Perform | AUR | URD | DDR |
Example of add mode with defaulted values:
http://192.168.0.170/mrcjava/servlet/MRCWORKLIB.M00011s?&action_mode=AVK&slnk=1&CUSNO=100300&CNAME=TEST
Example of single-click add:
http://192.168.0.170/mrcjava/servlet/MRCWORKLIB.M00011s?action_mode=AUR&CUSNO=100300&CNAME=TESTING
Example of single-click update:
http://192.168.0.170/mrcjava/servlet/MRCWORKLIB.M00011s?action_mode=URD&CUSNO=100300&CNAME=ABCO
Example of single-click delete:
http://192.168.0.170/mrcjava/servlet/MRCWORKLIB.M00011s?action_mode=DDR&CUSNO=100300
Note that the parameter names for Web/Servlet programs are case sensitive. "CUSNO" is the correct parameter field name while "cusno" is not.
The examples for Web/CGI and Web/Servlet applications are shown as URL invocations of the server program. However, the server program can also be invoked through HTML forms. If you choose to use forms, just include the parameters as hidden fields in the form.
An example single-click update is on the Crazy Bikes demo site here: http://dealer03:dealer03@www.crazybikes.com/dealers/I00120GC.mrc
|
|
 |
 |
 |
 |
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.
To unsubscribe, please just reply to this e-mail with Unsubscribe in the subject line.
View our privacy promise.
|
 |
|