Selection-list CURSOR-UP trigger

jmac13

Member
Hi all,

I'm using open edge 10.2b.

I've got a selection-list and i want to apply entry to something when I do an CURSOR-UP on the first item on the list box. But when i go in to do the trigger and put any code in the CURSOR-UP then it doesn't fire its default action.. e.g moving the selected item cursor up. Wont work, So I wondering what code i have to put in so it will do this if im not on my first item?

any ideas would be great thanks
 
I had just two fields in my frame - a selection list & a fillin field and i wrote this trigger. The Cursor-up action- applied entry to the fill-in field. Is this what you wanted?

ON CURSOR-UP OF cSelectionList IN FRAME DEFAULT-FRAME
DO:
.....MESSAGE 'Cursor-UP Pressed' VIEW-AS ALERT-BOX INFO BUTTONS OK.
.....APPLY 'ENTRY' TO cFillin IN FRAME DEFAULT-FRAME.
.....RETURN NO-APPLY.
END.
 
Hi rzr thanks for the reply..

but the problem is not applying entry to my fill-in its the fact if i put any code in the normal behavouir of CURSOR-UP then moving to the next one in the selection list no longer works. What im trying to do is when I'm on my first item in my list and press CURSOR-UP then go to my fill-in otherwise i want just navigate the list as before.. But it wont with any code in. So if im say 5 in the list and press CURSOR-UP i still want to go up the 4 one etc until i reach the first one then do something
 
not tested, but you can try this. You may need to play around with the apply logic...

Code:
[FONT=Courier New]ON CURSOR-UP OF cSelectionList IN FRAME DEFAULT-FRAME[/FONT]
[FONT=Courier New]DO:[/FONT]
    if cSelectionList:SCREEN-VALUE = cSelectionList:ENTRY(1)
    then do:
[FONT=Courier New]      APPLY 'ENTRY' TO cFillin IN FRAME DEFAULT-FRAME.[/FONT]
        [FONT=Courier New]RETURN NO-APPLY.[/FONT]
    end.
    else do:
       APPLY 'CURSOR-UP' to cSelectionList in frame default-frame.
       return no-apply.
     [FONT=Courier New]end.
END.[/FONT]
 
Hi LarryD,

just applying 'CURSOR-UP' to the selection list doesnt make it do its default action so just does nothing doesnt select the next one up. applying Cursor-up just runs the same block of code again.
 
try this ... define a variable iPosition as INT.... and add the below logic in your "CURSOR-UP" trigger

Code:
ON CURSOR-UP OF cSelectionList IN FRAME DEFAULT-FRAME
 
    iPosition = cSelectionList:LOOKUP(cSelectionList:SCREEN-VALUE).
    IF iPosition <>  1 THEN
       ASSIGN cSelectionList:SCREEN-VALUE = ENTRY(iPosition - 1,cSelectionList:LIST-ITEMS).
 
    APPLY 'ENTRY' TO cFillin IN FRAME DEFAULT-FRAME.
    RETURN NO-APPLY.
END.
 
Back
Top