Page 1 of 1

Using the drop down menu widget

Posted: Mon Nov 30, 2015 1:38 pm
by Wayne C.
Our main Order Entry scanboard used F8 function to cycle thru 6 different views of the orders:
1. Active orders (default version)
2. POD's
3. Billed Orders
4. Posted Orders
5. Quotes
6. Unaccepted Orders.
The problem was that if you're on Billed Orders and you want to go back to Active Orders, you have to press F8 four or five times to get back to Active Orders. We have now assigned a separate function key for each of the above views. Naturally, six function key buttons takes up more real estate than one button. For the time being, we have arranged the 6 buttons at the top to give the screen the appearance of a tab panel. But we were wondering if we could use something like the drop-down menu midget to execute the function keys. Each menu option would really execute a "pressKey("Fx");" instead of the menu/option logic.
Thanx in advance for any help.

Re: Using the drop down menu widget

Posted: Mon Nov 30, 2015 4:56 pm
by Scott Klement
This should be very easy to do.

1) drag a dropdown onto the screen
2) set the 'choices' property to something like this: -- Select --,Active Orders,PODs,Billed Orders,Posted Orders,Quotes,Unaccepted Orders
3) set the 'choice values' property to something like this -,F1,F2,F3,F4,F5,F6

These correspond to each other. So when the user selects the "-- Select --" option, the value is set to "-". When the user selects the "Active Orders" option, the value is set to "F1", when the user selects the "PODs" option, the value is set to "F2", etc.

Then in the "onchange" event for the dropdown, put code like this:

Code: Select all

var choiceVal = get(this);
if (choceVal != "-") {
  pressKey(choiceVal);
}
The idea here is that I've set the value to '-' when the dropdown is on "-- select --", so you do nothing in that case. When it is on any of the other optins, the value will be "Fx" (whatever the function key should be). So you do presskey(the-value) to run it.

Re: Using the drop down menu widget

Posted: Thu Dec 10, 2015 7:15 pm
by Wayne C.
Thanks Scott. That worked like a charm. Just to let you know, Monday I start a week long javascript class thru New Horizons so I won't have to bug you guys as often ;)

Thanks again.

Re: Using the drop down menu widget

Posted: Fri Dec 11, 2015 3:01 pm
by Scott Klement
It's not a problem... hope the class is helpful.

Of course, most people learning JavaScript are coming from a very different angle, that of writing/creating their own web application and using JavaScript for part of it.

So you'll probably learn the basic syntax and theories of JavaScript, but stuff like how it interfaces with Genie and how to use the Genie APIs won't be included, of course.