Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming Tips for .NetUI

Similar presentations


Presentation on theme: "Programming Tips for .NetUI"— Presentation transcript:

1 Programming Tips for .NetUI
Tammy Lonsberry Sr. Programmer/Analyst Sungate Solutions, Inc.

2 About me Tailoring and customizing Progress 4GL code for QAD users since 1995 Most versions (Mfg/Pro 7.3 – QAD EA 2013 SE) All User Interfaces (CHUI, GUI, Desktop, .NetUI) Progress and Oracle db’s Active PEG member Long time consultant with exposure to many different environments, processes, protocols … and lots of really smart people

3 Agenda About .NetUI Data Setup Programming Do’s and Don’ts
Frame Design Considerations Coding Tips and Common Fixes Summary Questions

4 About .NetUI

5 About .NetUI Same 4GL code under the covers
Screens get rendered as HTML-style forms

6 Browser-like navigation
Back, Next buttons Toggle/check boxes for logical fields Mouse clicks, not function keys

7 Seems simple enough, but…
More than just a different look or screen appearance CHUI: Tightly integrated and responsive to keyboard events .NetUI: Stateless, no interaction at the field navigation or keystroke level .NetUI can detect (and therefore respond to) frame events and database events Can: Next button - end of frame or update statement Cannot: Tab, function keys, other navigational keystrokes

8 Data Setup

9 Data setup specific to the UI
Program Information Maintenance Determines which method will be used to display your program

10 Same program, before & after
Without any code changes

11 Programming Do’s and Don’ts

12 Programming Do’s and Don’ts
Not an all-inclusive list, but possibly the most common Biggest offenders; program code that must be changed Without these changes: Program may not function properly or at all Screen may not be displayed correctly or completely Program may hang or crash with no error visible to the user

13 Do not use; not visible in .NetUI
Pause User will not see “Press spare bar to continue” “Processing….” and program appears to hang Can use “pause 0” but not “pause 0 before hide” QAD STD-0039 Can use gpwait.i to pause for display-only frames QAD STD-0300 Help phrase Can display informational text on the screen … more on that later

14 Do not use; not visible in .NetUI
Validate phrase Wrong: Right: update part validate (can-find (pt_mstr where pt_domain = global_domain and pt_part = part), “Item Number does not exist”) with frame a. update part with frame a. if not can-find(pt_mstr where pt_domain = global_domain and pt_part = part) then do: /*ITEM NUMBER DOES NOT EXIST*/ {pxmsg.i &MSGNUM=16 &ERRORLEVEL=3} undo, retry. end.

15 Messages Do not use Progress “message” statement Do not use Alert-box
Do not use mfmsg.i or its variations (mfmsg01.i, mfmsg02.i, etc) Do not use hard-coded message text Always use pxmsg.i (QAD STD-0277) {pxmsg.i &MSGNUM=123 &ERRORLEVEL=3} Always use msg_mstr

16 Field Lookups Do not use scrolling windows
Ex: window.i, sw*.i Do use browses and lookups as created by Browse Maintenance ( ) Browse Maintenance is entirely new in .NetUI Do not use in Chui – always use the .NetUI version Browses can be developed on one database, exported and imported into other db’s Browse export/import will include supporting data Labels, Program Info, etc.

17 Keyboard actions Keystrokes and other cursor movement is not detectable in .NetUI Program logic cannot be based on keystrokes or frame fields Do not use: Keycode, Keyfunction Cursor-left, cursor-right, cursor-up, cursor-down Status default, ststatus Hard-coded “F4” or other keys Can use database trigger events On assign, create, write, etc.

18 Frame Design Considerations

19 Frame considerations Text displayed in frame statements will not appear in .NetUI Field labels will be displayed but not other informational or hard-coded text Watch for “no-label” phrase – this may indicate a frame made entirely of text.

20 Sample frame – classic CHUI

21 Sample frame code form skip(1) "Here is some informational text" at 3 code colon 11 code1 colon 46 label {t001.i} name colon 11 name1 colon 46 label {t001.i} sort-by colon 20 format '9' "1) Customer Number" at 26 "2) Customer Name" at 26 skip with frame a side-labels width 80.

22 Result before code change
Text is missing

23 To display text: Step 1 Define character variables
They will be used to store the text define variable form-text1 as char no-undo. define variable form-text2 as char no-undo. define variable form-text3 as char no-undo.

24 To display text: Step 2 Place the variables in the frame form skip(1)
form-text1 at format 'x(40)' no-label code colon 11 code colon 46 label {t001.i} name colon 11 name colon 46 label {t001.i} sort-by colon 20 format '9' form-text at 26 format 'x(20)' no-label form-text at 26 format 'x(20)' no-label skip with frame a side-labels width 80.

25 To display text: Step 3 Assign text to the variables
form-text1 = "Here is some informational text" form-text2 = "1) Customer Number" form-text3 = "2) Customer Name" . Can also use Label Master or Master Comments to store frame text. Allows for language translation.

26 To display text: Step 4 Display variables with frame a display
form-text1 form-text2 form-text3 with frame a.

27 Result after code change

28 Coding Tips and Common Fixes

29 Determining the run-time mode
{gpiswrap.i} Returns a logical True = .NetUI mode False = Terminal/CHUI mode if {gpiswrap.i} then do: /* Some code here for .Net UI */ end. else do: /* Running in Terminal Mode */

30 “Quick List” for common fixes
To update your existing CHUI custom code and enable for .NetUI, search for these commonly used words These aren’t all indicative of a problem, but will give you a quick jump-start towards finding possible offenders Alert-box Cursor F2, F4 Frame Help Keycode Keyfunction Label Message mfmsg Pause Validate

31 Follow QAD’s coding style
3 types of programs; very specific structure & flow of control Maintenance, Inquiry, Report Follow the recommended program structure for consistent behavior Utilize standard .i include files as much as possible K.I.S.S. – don’t reinvent the wheel or get needlessly “creative”

32 http://www.qad.com/erp/Support/ Get a login, it’s free! Click on:
General Reference Development Standards Review these periodically – refreshers are good; we all forget things over time 

33 Summary

34 Summary Write code for application functionality, not the user’s keystrokes Program Information Maintenance Use “Quick List” for quick conversion of existing custom code Use QAD’s development standards As the application has evolved, it has continually become more and more important to follow these rules Follow the “When in Rome” principle

35 Questions?

36 Contact information For further information or a copy of this presentation: Tammy Lonsberry (847)


Download ppt "Programming Tips for .NetUI"

Similar presentations


Ads by Google