Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Inactivating Display Array  (Read 11240 times)
Snorri B.
Posts: 104


« on: March 13, 2008, 12:03:07 pm »

Hi.

I'm using multiple dialogs in 2.10. I have 2 display arrays in the dialog that need to be inactive until users have fetched some data. Is there a way for me to inactivate the whole array? I have tried to inactivate the fields, but to no avail. I want to prevent the arrays gaining focus if they are empty. Is there a way to achieve this?

Best regards,
-Snorri
Reuben B.
Four Js
Posts: 1119


« Reply #1 on: March 16, 2008, 10:46:49 pm »

Hi.

I'm using multiple dialogs in 2.10. I have 2 display arrays in the dialog that need to be inactive until users have fetched some data. Is there a way for me to inactivate the whole array? I have tried to inactivate the fields, but to no avail. I want to prevent the arrays gaining focus if they are empty. Is there a way to achieve this?

Best regards,
-Snorri

Snorri,

I was hoping one of the European based 4Js developers may respond.

In my mind, this is an extension of the issue of how to treat an INPUT ARRAY if no fields are active, do you treat it as a DISPLAY ARRAY and allow access to scrollbars, headers etc.   Then the next step is what if you want to make the DISPLAY ARRAY inactive and prevent access to scrollbars, headers.   (note: when a TEXTEDIT is inactive you still have access to the scrollbars, but with a DISPLAY ARRAY you may want to prevent access to the scrollbars, particularly with an ON FILL BUFFER array)

It is something that should be considered because with the absence of a LISTBOX widget, one way to emulate a LISTBOX with MD is as

DIALOG
   INPUT ...
   DISPLAY ARRAY -- listbox field
   INPUT ...

and just as you can make a field inactive, it is plausible that you would like to make the listbox inactive (ie make the DISPLAY ARRAY inactive).

Anyway one way to prevent access would be to set TABINDEX=0 for the columns in the DISPLAY ARRAY and then the user won't be able to gain access via tabbing, only via explicitly clicking on the array with the mouse.

You could also try something like ...

Code
  1.         BEFORE DISPLAY
  2.            IF arr.getLength() = 0 THEN
  3.               LET fieldname = FGL_DIALOG_GETFIELDNAME()
  4.               CALL DIALOG.nextField(fieldname)
  5.               CONTINUE DIALOG
... although I am not sure if it is correct for FGL_DIALOG_GETFIELDNAME() to still return the value of the previous field at this point, and as you have 2 arrays you'd have to handle the case where FGL_DIALOG_GETFIELDNAME() is blank because you have come from the other array.  As I said I wouldn't be confident that this behaviour is correct (particularly as DIALOG.getCurrentItem() does return the name of the current array at this point), but it may help you out in the short-term.  Maybe there is a need for a DIALOG.getPreviousItem()?

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
.
Posts: 64


« Reply #2 on: March 25, 2008, 12:19:57 pm »

I can only think of two ways that might help:

1) a) Keep a track of where you last were using before field
    b) Use a variable to keep track of whether the display array is active or not
    c) Use BEFORE ROW to check if active and if not use NEXT FIELD to move you back to where they last were, or else a just another part of the input that you want them to go to.

2) The only other way I can think to do this is to cheat! It might struggle with maintaining the screen layout though but might be worth a try if you have a little time to experiment.

Create two tables. Experiment with vertically stacked in one grid, or 2 grids in a VBOX or side by side in an HBOX. The two tables should look identical. One of these is for the active list that you reference in a display array and one inactive not referenced anywhere, except maybe to do a one off display on switching to it if you don't want it empty. In the form HIDE the inactive one (though again, this might keep sizes better if it's not hidden in the form but hidden immediately after initial display).

Then hide the active one and show the inactive one or vice-versa as required.

I have found that for maintaining screen layout it often works best if the initially hidden one is the top one, or the one on the left when side by side. This will probably work best if nothing else is horizontally stacked next to the tables.

Hope it helps and sorry if it doesn't but I'm at a loss as to how else to do it.
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines