Aller au contenu principal
Version: 20 R6 BETA

On After Edit

CodePeut être appelé parDéfinition
454D View Pro area - 4D Write Pro area - Combo Box - Form - Input - Hierarchical List - List Box - List Box ColumnLe contenu de l'objet saisissable qui a le focus vient d'être modifié

Description

Cas général

Cet événement peut être utilisé pour filtrer la saisie de données dans les objets saisissables au clavier au niveau le plus bas.

Lorsqu'il est utilisé, cet événement est généré après chaque modification apportée au contenu d'un objet saisissable, quelle que soit l'action qui a provoqué la modification, c'est-à-dire :

  • Actions d'édition standard qui modifient le contenu comme les actions coller, couper, supprimer ou annuler;
  • Déposer une valeur (action similaire à coller);
  • Any keyboard entry made by the user; in this case, the On After Edit event is generated after the On Before Keystroke and On After Keystroke events, if they are used.
  • Toute modification apportée à l'aide d'une commande de langage qui simule une action de l'utilisateur (c'est-à-dire POST KEY).

Within the On After Edit event, text data being entered is returned by the Get edited text command.

4D View Pro

L'objet retourné par la commande FORM Event contient :

PropriétéTypeDescription
codeentier longOn After Edit
Descriptiontext"On After Edit"
objectNametextNom de la zone 4D View Pro
sheetNametextNom de la feuille de l'événement
actiontext"editChange", "valueChanged", "DragDropBlock", "DragFillBlock", "formulaChanged", "clipboardPasted"

En fonction de la valeur de la propriété action, l'objet event contiendra des propriétés supplémentaires.

action = editChange

PropriétéTypeDescription
rangeobjectPlage de cellule
editingTextvariantLa valeur provenant de l'éditeur courant

action = valueChanged

PropriétéTypeDescription
rangeobjectPlage de cellule
oldValuevariantValeur de la cellule avant la modification
newValuevariantValeur de la cellule après la modification

action = DragDropBlock

PropriétéTypeDescription
fromRangeobjectPlage de cellule source (qui est glissée)
toRangeobjectPlage de cellule de destination (qui est déposée)
copybooleanIndique si la plage source est copiée ou non
insertbooleanIndique si la plage source est insérée ou non

action = DragFillBlock

PropriétéTypeDescription
fillRangeobjectPlage utilisée pour le remplissage
autoFillTypeentier longValue used for the fill.
  • 0: Cells are filled with all data (values, formatting, and formulas)
  • 1: Cells are filled with automatically sequential data
  • 2: Cells are filled with formatting only
  • 3: Cells are filled with values but not formatting
  • 4: Values are removed from the cells
  • 5: Cells are filled automatically
  • fillDirectionentier longDirection of the fill.
  • 0: The cells to the left are filled
  • 1: The cells to the right are filled
  • 2: The cells above are filled
  • 3: The cells below are filled
  • action = formulaChanged

    PropriétéTypeDescription
    rangeobjectPlage de cellule
    formulatextLa formule saisie

    action = clipboardPasted

    PropriétéTypeDescription
    rangeobjectPlage de cellule
    pasteOptionentier longSpecifies what is pasted from the clipboard:
  • 0: Everything is pasted (values, formatting, and formulas)
  • 1: Only values are pasted
  • 2: Only the formatting is pasted
  • 3: Only formulas are pasted
  • 4: Values and formatting are pasted (not formulas)
  • 5: Formulas and formatting are pasted (not values)
  • pasteDataobjectThe data from the clipboard to be pasted
  • "text" (text): The text from the clipboard
  • "html" (text): The HTML from the clipboard
  • Exemple

    Voici un exemple qui gère l'événement On After Edit :

     If(FORM Event.code=On After Edit)
    If(FORM Event.action="valueChanged")
    ALERT("WARNING: You are currently changing the value\
    from "+String(FORM Event.oldValue)+\
    " to "+String(FORM Event.newValue)+"!")
    End if
    End if

    L'exemple ci-dessus pourrait générer un objet événement tel que celui-ci :

    {

    "code":45;
    "description":"On After Edit";
    "objectName":"ViewProArea"
    "sheetname":"Sheet1";
    "action":"valueChanged";
    "range": {area:ViewProArea,ranges:[{column:1,row:2,sheet:1}]};
    "oldValue":"The quick brown fox";
    "newValue":"jumped over the lazy dog";
    }