Browse and fillins

tej

New Member
Hi All

Bit new to progress so just needed some help on an issue im stuck on.

basically i got a browse which has its columns generated at runtime. This all works fine!

But what i need to do is create fill-ins which represent the data which is currently displayed in the browse.

An example is: i could have 5 out of 10 columns on display. When i move the scroll i will have new columns on screen. So what do i need to do to change the fillin data accordingly to the browse data.

any replies will be much appreciated

cheers
 

bulklodd

Member
Look at the snippet it creates fill-ins for each column under the browse widget

Code:
DEFINE VARIABLE fi AS HANDLE     NO-UNDO.
DEFINE VARIABLE i AS INTEGER    NO-UNDO.
DO i = 1 TO <your browse>:NUM-COLUMNS:
   h = <your browse>:GET-BROWSE-COLUMN(i).
   CREATE FILL-IN fi
      ASSIGN
         FRAME = FRAME f:HANDLE
         X = 0
         Y = <your browse>:X + <your browse>:HEIGHT-PIXELS + i * h:HEIGHT-PIXELS
         HEIGHT-PIXELS = h:HEIGHT-PIXELS
         WIDTH-PIXELS = h:WIDTH-PIXELS
         DATA-TYPE = h:DATA-TYPE
         FORMAT = h:FORMAT
         SCREEN-VALUE = h:SCREEN-VALUE
         VISIBLE = YES
         SENSITIVE = YES.
END.

HTH
 

tej

New Member
Hi

Cheers for that works brillantly now. but i have one more problem. When it goes into the screen, the value changed does not add the data to the relevant fillin. But it does only when i click on another record. Does not happen on the first record!

cheers
 

bulklodd

Member
When it goes into the screen, the value changed does not add the data to the relevant fillin. But it does only when i click on another record. Does not happen on the first record!

cheers

All you need to do is to define 'value-changed' trigger for your browser widget where you should transfer current browser values to the fill-ins.
Look at the updated snippet.

Code:
DEFINE VARIABLE fi AS HANDLE     NO-UNDO.
DEFINE VARIABLE i AS INTEGER    NO-UNDO.
DEFINE VARIABLE h AS HANDLE     NO-UNDO.
DO i = 1 TO <your browse>:NUM-COLUMNS:
   h = <your browse>:GET-BROWSE-COLUMN(i).
   CREATE FILL-IN fi
      ASSIGN
         FRAME = FRAME f:HANDLE
         X = 0
         Y = <your browse>:X + <your browse>:HEIGHT-PIXELS + i * h:HEIGHT-PIXELS
         HEIGHT-PIXELS = h:HEIGHT-PIXELS
         WIDTH-PIXELS = h:WIDTH-PIXELS
         DATA-TYPE = h:DATA-TYPE
         FORMAT = h:FORMAT
         SCREEN-VALUE = h:SCREEN-VALUE
         VISIBLE = YES
         SENSITIVE = YES.
   h:PRIVATE-DATA = STRING(fi).
END.
 
ON VALUE-CHANGED OF  <your browse>
DO:
    DO i = 1 TO <your browse>:NUM-COLUMNS:
       h = <your browse>:GET-BROWSE-COLUMN(i).
       fi = WIDGET-HANDLE(h:PRIVATE-DATA).
       fi:SCREEN-VALUE = h:SCREEN-VALUE.
    END.
END.

HTH
 

tej

New Member
cheers got that working!

another issue now regarding scrolling!

i have created a procedure which checks to see when tabbing that i have reached the last fillin on the screen.

I have also added code which detects if there are more fillins! but my problem is that i have created the following line to check if that is the last field

IF h$field:X + h$field:WIDTH-PIXELS + 19 > browse-3:WIDTH-PIXELS in frame frabrs2 then do:

i can easily change the number 19 to a higher number so its always true but this causes me problems as I need to reach the end field when tabbing and if there are no more fields then dont tab anywhere.

So for example if i change 19 to 125 it works fine and detects on thecolumns in the browse but when it comes to the final one it is still true according to the above if statement!

does anyone have any suggestions?

cheers
 
If just checkin to find out if it is the last fillin / widget, simply set that widget a flag. Do something like;
DO WITH FRAME {&FRAME-NAME}:
ASSIGN
widgetRequiredName:pRIVATE-DATA = 'whatEverFlageg1'
.
END.

Then you can check widget properties. Do a simple check,
IF widgetName:pRIVATE-DATA = 'whatEverFlageg1' THEN this is the last widget ... Manipulate
 

tej

New Member
that worked brillantly! didnt know that private-data is soooo useful thansk for that!

ive also got the tabs working fine for dynamic fillins. But when i reach the last fillin i have made it do return no-apply which does not allow me to move from there unless i save the record. But is there of trapping the last tab but also allowing me to move to a different field if required?

cheers
 
Why not have a circular motion on the widgets?
eg for the last widget for the leave trigger simply place this code (or similar) to create the effect of the circular motion"
APPLY 'ENTRY' TO firstWidgetName
 

tej

New Member
Hi

Thats what i was orginally thinking but the specification states to have it this way! otherwise thats what i was thinking of doing!

cant think of any other way of doing this?

any ideas?

also i dont know if this is a bug with progress but have you come across the following happening?

say when i create a new record which contains 7 fillins of which 4 are visible. So when I enter new data into the first 4 fields and dont display the next 3 as i dont want them to contain info i get an error :

field_options record has no-lock status, update to field not allowed(396) then next error is error number (142) followed by error no. 3131

BUT when i create a new record and enter data in the first 4 fields but also scroll across to the next 3 fields and not enter any data it works fine!

not sure might be a progress bug on queries???

cheers
 
Top