Page 1 of 1
(RPG)Reload MainMenu programatically
Posted: Wed Mar 27, 2013 7:22 pm
by MegumiSawada
Hi
I think it is possible to terminate the programs with following code:
if (RequestACTION = 'XXXXXX');
RequestPROGRAM = 'SYS-EXIT';
RequestACTION = 'SYS-EXIT';
Iter;
endif;
But you need to touch reload button to show the MainMenu.
Is it possible to reload MainMenu programatically?
Thank you in advance.
Best Regards,
Megumi
Re: (RPG)Reload MainMenu programatically
Posted: Thu Mar 28, 2013 7:45 am
by tsupartono
So you'd basically want the main menu to appear when you don't have any form to show?
We can adjust LongRange to do that.
Re: (RPG)Reload MainMenu programatically
Posted: Thu Mar 28, 2013 9:10 am
by MarkDuignan
Are you trying to just close the 5250 session or using secondary (multi-user per device) logon/off scenario?
If you are designing a secondary logon/logoff scenario then please look at these building blocks in the LRNG_PROJ/QRPGLESRC source file (latest RV11 server version)…
LOGOFFUSER – Logs a user off
LOGONUSER - Performs a secondary logon
This pair of programs are designed to work together - but any program can logically log off this way.
The relevant lines are in LOGOFF
If ( DynamicMenusAreBeingUsed <> 0 );
// Now transfer the request to log on again
RequestPROGRAM = SecondaryLogonPROGRAM;
RequestACTION = 'DEFAULT';
// Otherwise get the Longrange driver program to terminate any active 5250 session
Else;
RequestPROGRAM = 'SYS-EXIT';
RequestACTION = 'SYS-EXIT';
Endif;
And when the secondary logon program is used it does this every time it starts:
LRNG_SetBoolProperty('System.Status.SchemaInitCompleted':False);
And when the user successfully signs on this is done to cause the menu to appear allowing the logged on user to select what they want to do,
LRNG_SetBoolProperty('System.Status.SchemaInitCompleted':True);
Re: (RPG)Reload MainMenu programatically
Posted: Fri Mar 29, 2013 5:15 pm
by MegumiSawada
Hi Tony,
Thank you. However,you don't need to do so.
Hi Mark,
Our customer doesn't use logon/off scenario,but expect to share one device with many people.
They'd just like to show menu after terminating currently working formview.
I have looked at LOGONUSER and LOGOFFUSER, but I'm not sure what to do.
You told that
LRNG_SetBoolProperty('System.Status.SchemaInitCompleted':True);
will cause to menu to appear,however, I cannot make my program to do that.
Does it work over there?
Regards,
Megumi
Re: (RPG)Reload MainMenu programatically
Posted: Tue Apr 02, 2013 9:13 am
by MarkDuignan
LRNG_SetBoolProperty('System.Status.SchemaInitCompleted':True); should work if you present an empty screen – but definitely not if what you do next is a SYS-EXIT operation - immediately after setting the property. When you do that the 5250 session is ended – so your SchemaInitCompleted property setting change never gets sent out to the client device.
Can you describe exactly what the customer wants to do?
Re: (RPG)Reload MainMenu programatically
Posted: Thu Apr 04, 2013 3:13 pm
by MegumiSawada
Hi Mark,
What the customer would like to do is as follows:
There're two formviews under the MainMenu.
A couple of users will use the same device.
They would like to show MainMenu when user finish operation either of formviews for next operation(or for next user).
They wouldn't use User/Password scenario for the formviews, but they will request and check the password when user do some operation on the formview.
I suggest them they can use a formview(e.g."TOP MENU")which shows two buttons to switch to each formviews to achieve their requirements (and I think that is more user-friendly) .
However I wanted to know if it is possible to show menu programatically.
Thank you for your support.
Best Regards,
Megumi
Re: (RPG)Reload MainMenu programatically
Posted: Thu Apr 04, 2013 5:58 pm
by MarkDuignan
I don’t think you could. You would need the user to interact with a FormView to cause the menu reset (and display) request to be send out to display the menu - which is why it works with a sign on operation.
I think your solution to use form view as their menu or homepage is the best solution. This can be plugged in as the startup formview and they can switch back to it programmatically whenever they want to. With RV11 they can also make it the target of their ‘back buttons’ on the title bar. In effect they would not bother to use the LongRange menu structure because the application is so simple.
Note: You can define form views in LR Studio that are not attached to any left hand LR main menus.
Go to the “Form Views” entry in the main LR Studio tree. Right click and choose “New Form View”. Define your form view and make sure it is given a symbolic name at the bottom. You can attach commands to it in the usual way. Working this way you can have your own menu / homepage and many form views navigating amongst themselves – all without using the LR left hand menu structure at all. The LR left hand main menus are optional.
The concept of a ‘home page’ or ‘main menu’ is common in mobile applications. Typically these look like miniature desktop with large easy to select icons – sometimes overlaid with some sort of short summary (eg: messages waiting count) or something to attract a user’s attention to something they need to look at.
Here is an example of a Dutch demonstration ‘home page’ done using LongRange (it was set up to mimic the home page of real application as part of a proof of concept exercise) …

- shot1.png (47.88 KiB) Viewed 8474 times
Re: (RPG)Reload MainMenu programatically
Posted: Fri Apr 05, 2013 12:39 pm
by MegumiSawada
I see.
I'll recommend them to use 'homepage' instead.
Thank you for your advice!