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 with multiple selection > 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 with multiple selection > In Designer mode

In Designer mode

There is another picking method available: you can pick multiple items at once.

The option to select multiple items is enabled by default in all list forms. But the option to pick the selected items is usually disabled.

To enable the option, let us use the MultipleChoice parameter of the dynamic list form extension. 

  1. In the GoodsReceipt document form, update the Pick command handler as shown in listing 26.4.

    Listing 26.4. Pick button click handler

    &AtClient
    Procedure Pick(Command)
     
        FormParameters = New Structure ("MultipleChoice", True);
        OpenForm("Catalog.MaterialsAndServices.ChoiceForm", FormParameters, Items.Materials); 
     
    EndProcedure
    In the multiple selection mode the form returns an array of items instead of a single item. So you have to iterate through the array in the ChoiceProcessing handler.
  2. Update the ChoiceProcessing event handler as shown in listing 26.5.

    Listing 26.5. ChoiceProcessing event handler for the Materials table

    &AtClient
    Procedure MaterialsChoiceProcessing(Item, SelectedValue, StandardProcessing)
     
        For Each SelectedItem In SelectedValue Do
            NewRow = Object.Materials.Add();
            NewRow.Material = SelectedItem;
        EndDo;
     
    EndProcedure
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.