terça-feira, 11 de agosto de 2020

DICAS 3011 - WINDEV TUTORIAL 34 - Adicionar e Modificar Janelas - Validacao - PARTE G



https://youtu.be/Us-49OHMQ90

Bom Dia/Boa Tarde/Boa Noite

Esse Ao Vivo vai estrear as 11:00 do dia 24/08/2020 

DICAS 3011 - WINDEV TUTORIAL 34 - Adicionar e Modificar Janelas - Validacao - PARTE G
Tutoriel WINDEV : Leçon 4.2.g. Fenêtres d'ajout et de modification - Validation


ASSUNTOS

ATUALIZAR A TABELA
ENTRAR TABELA E MOSTRAR DADOS ATUALIZADOS
COMANDOS UTILIAZADOS
SCREENTOFILE
HMODIFY
CLOSE
OPEN
TABLEDISPLAY



Video original da Franca

https://youtu.be/840J5StqFD8


Playlist Windev TUTORIAL













Validate the product modifications

Two Buttons controls have been created in the "WIN_Product_form" window:
  • an "OK" Button control to validate changes,
  • a "Cancel" Button control to manage the return to the product list.
We are now going to type the WLanguage code required for them to operate.
  • First of all, display (if necessary) the "WIN_Product_form" window in the editor: click the corresponding button in the open documents bar.
  • We will now write the WLanguage code associated with the "OK" Button control.
    1. Right-click the Button control and select "Code" from the popup menu.
    2. Write the following code in the "Click" WLanguage event:
      ScreenToFile()
      HModify(Product)
      Close()
      Let's take a look at this WLanguage code:
      • ScreenToFile is used to initialize the items with the values of linked controls, for the current record. This function is equivalent to the following code lines:
        Product.Reference = EDT_Reference
        Product.Caption = EDT_Caption
        Product.Description = EDT_Description
        ...
        Our window uses less than 10 controls and the benefit is already there; think of the windows that use a lot more controls: a single code line performs all assignments!
      • HModify is used to update the file data for the current record.
    3. Save the modifications by clicking Save the element among the quick access buttons.
    4. Close the code window (click X at the top right corner of code editor).
  • The modifications performed in the "WIN_Product_form" window must be taken into account in the Table control used to list the products. To do this, we will simply modify the WLanguage code associated with the "Modify" Button control in "WIN_Menu".
    1. Display the "WIN_Menu" window in the editor: click the corresponding button in the button bar.
    2. Select the "Modify" Button control and open the code editor (F2).
    3. Modify the "Click" event as follows:
      Open(WIN_Product_form)
      TableDisplay(TABLE_ProducttaCurrentSelection)
      Let's study this code:
      • TableDisplay is used to update the Table control with the data modified in the product form.
      • The taCurrentSelection constant is used to specify that the Table control must be updated from the position of selection bar.
    4. Save the modifications by clicking Save the element among the quick access buttons.
    5. Close the code window (click X at the top right corner of code editor).

Checking the product modification

  • To check the modification of a product:
    1. Run the project test ( Run project test among the quick access buttons).
      Quick access buttons
    2. WINDEV asks you to select the first project window. In our case, this window corresponds to "WIN_Menu". Select this window and validate.

      Remark

      The first project window corresponds to the first window that will be opened when starting the application. The first project window can be defined:
      • during the project test.
      • when creating the executable.
      • in the "Project explorer" pane: all you have to do is select the requested window, display the popup menu and select "First project window".
      When a first project window is defined, a small red 1 appears in front of the window name in the "Project explorer" pane.
    3. The project starts in test mode and the first window is displayed.
    4. Select a product from the product list (for example the first one) and click "Modify".
    5. The details of the selected product are displayed in the form window.
    6. Modify the price of 100.23 Dollars and enter 200.00 Dollars, then click "OK".
    7. When going back to the list of products, you will notice that the price was updated for this product.
    8. Display the product details again.
    9. Click the "Modify" button below the image. The image picker is displayed. Select an image and validate. The image is displayed in the form.
    10. Click the "Cancel" button. The image modification was ignored in the data file.
    11. Click the cross to close the application





DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C








Nenhum comentário:

Postar um comentário

Teste

Teste
teste