Desktop version

Main > Knowledge Base > Knowledge Base > Knowledge base > Practical developer guide 8.3 > Lesson 26 (2:00). Picking list items, avoiding modal windows, and generating data based on other data > Picking list items > Picking a single item > In Designer mode > Practical developer guide 8.3 > Lesson 26 (2:00). Picking list items, avoiding modal windows, and generating data based on other data > Picking list items > Picking a single item > In Designer mode

In Designer mode

Let us implement picking a single item.

  1. In Designer, open the GoodsReceipt document form.
  2. On the Commands tab, create the Pick command.
  3. In the command property palette, in the Action field, click the Open  button and specify that the command is executed on the client.
  4. Click the Form tab and drag the command to the form controls pane, to the command bar of the Materials table (fig. 26.1).


    Fig. 26.1. Creating the Pick button
  5. Click the Module tab and add the script shown in listing 26.1 to the Pick command handler.

    Listing 26.1. Pick command handler

    &AtClient
    Procedure Pick(Command)
        OpenForm("Catalog.MaterialsAndServices.ChoiceForm", , Items.Materials);
    EndProcedure
    The procedure opens the MaterialsAndServices catalog selection form, which is subordinate to the Materials table of the GoodsReceipt document (Items.Materials).

    Once a user selects a value from the catalog selection form, the value is passed to the ChoiceProcessing event handler of the Materials table because the table is the owner of the selection form.
  6. Open the property palette of the Materials table and create a ChoiceProcessing event handler (fig. 26.2) that is executed on the client (listing 26.2).

     
    Fig. 26.2. Creating the ChoiceProcessing event handler for the Materials table

    Listing 26.2. ChoiceProcessing event handler for the Materials table

    &AtClient
    Procedure MaterialsChoiceProcessing(Item, SelectedValue, StandardProcessing)
     
        Items.Materials.AddRow();
        Items.Materials.CurrentData.Material = SelectedValue;
     
    EndProcedure
    The procedure adds a row to the Materials table and assigns the value selected in the catalog selection form to the Material column of that row. This value is passed to the handler as the SelectedValue parameter.
Next page: In 1C:Enterprise mode



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.