apply event on browse

mariaProgress

New Member
Hello, I want to apply an event "LEFT-MOUSE-CLICK" on the the selected row in browse by click on the button modify . I didn't find a solution for this problem.

DEFINE BROWSE B_browse QUERY Q_query
DISPLAY
num_Fiche LABEL "N°Fiche":L FORMAT ">>>>9":U
DATE
ENABLE
num_Fiche
DATE
WITH 10 DOWN SEPARATORS CENTERED .


ON 'CHOOSE':U OF btn_modify in frame framef1
DO:
APPLY "LEFT-MOUSE-CLICK":U to num_Fiche in browse B_browse .

RETURN.
END.



thanks.
 

SergioC

Member
Hi, try this:

Code:
[COLOR=#333333]ON 'CHOOSE':U OF btn_modify in frame framef1[/COLOR]
[COLOR=#333333]DO:[/COLOR]
[B][COLOR=#333333]      APPLY "ENTRY":U to num_Fiche in browse B_browse . [/COLOR]
[COLOR=#333333]      RETURN NO-APPLY.[/COLOR]
[/B][COLOR=#333333]END.[/COLOR]

Regards.
 

mariaProgress

New Member
Hi,
After choose btn_modify , when I modify num_Fiche in browse B_Browse and Iwant to save it , it didn't upadte it with the new value of num_Fiche .


thanks .
 

SergioC

Member
Hi Maria, I leave here an example of updating data in a table. This example is in the Programming Handbook. Please read it.

Code:
/* p-br12.p */
DEFINE BUTTON BUTTON-1 
     LABEL "&Modificar" 
     SIZE 15 BY 1.14.


DEFINE QUERY q1 FOR customer SCROLLING.


DEFINE BROWSE b1 QUERY q1 
    DISPLAY custnum name address address2 city 
            state postalcode country contact phone 
            salesrep creditlimit balance
    ENABLE ALL WITH 10 DOWN WIDTH 70 SEPARATORS
    TITLE "Update Customer".


DEFINE FRAME f1
    b1 SKIP(1)
    SPACE(12) BUTTON-1 SKIP(1)
    WITH SIDE-LABELS AT ROW 2 COLUMN 6 NO-BOX. 
        
ASSIGN b1:NUM-LOCKED-COLUMNS = 2
       b1:READ-ONLY = TRUE.  
 
ON 'LEAVE':U OF customer.NAME IN BROWSE b1
DO:
    APPLY 'ENTRY' TO button-1 IN FRAME f1.
    ASSIGN b1:READ-ONLY IN FRAME F1 = TRUE.  
    APPLY 'ENTRY' TO b1 IN FRAME f1.
    RETURN.
END.


ON 'alt-m':U OF FRAME f1 ANYWHERE
DO:
    APPLY 'ENTRY' TO button-1 IN FRAME f1.
    ASSIGN b1:READ-ONLY IN FRAME F1 = FALSE.  
    APPLY 'ENTRY' TO customer.NAME IN BROWSE b1.
    RETURN NO-APPLY.
END.


ON 'CHOOSE':U OF BUTTON-1
DO:
    b1:READ-ONLY = FALSE.
    APPLY 'ENTRY' TO customer.NAME IN BROWSE b1.
    RETURN NO-APPLY.
END.


OPEN QUERY q1 FOR EACH customer NO-LOCK.  




ENABLE ALL WITH FRAME f1.




WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.

Regards.
 
Top