1Ci Support Help Center home page
Submit a request
Sign in
  1. 1Ci Support
  2. Practical developer guide 8.3
  3. Lesson 27. Form development techniques

Selection list in a text box

  • Lesson 27. Form development techniques
    • Form data and controls
    • Form data types
    • Related lists
    • Formatting rows in list forms
    • Calculated columns in lists
    • Selection list in a text box
    • Choice form for a field with a reference attribute
    • Attribute fill check
    • Using parameterized commands
    • Opening a list form with the specified filter
See more

<< Prev   Next >>

  • In Designer mode
  • In 1C:Enterprise mode

You can use selection lists in text boxes, which improves their usability.

A text box that has a reference type, such as Warehouse or Employee, by default includes a selection button that opens the selection form for a referenced object.

You might need to implement a similar selection from a set of predefined values for fields of other types.

Let us review a very simple example where a user needs to enter customer addresses starting with city names.

In Designer mode

Let us add a selection list to a text box.

  1. In Designer, open the configuration object editor of the Customers catalog.
  2. On the Data tab, add the Address attribute of the String type with length 25.
  3. Open the Customers catalog item form.
  4. Expand its main Object attribute and drag the Address field from the attributes pane to the form controls pane.
  5. In the property palette that is opened, set the ListChoiceMode check box.
  6. In the ChoiceList field, click the selection  button and then use the Add  button to add cities: New York, New Rochelle, and Boston (fig. 27.24).


    Fig. 27.24. Creating a selection list for a text box

In 1C:Enterprise mode

Let us test the text box.

  1. Start 1C:Enterprise in the debug mode and open the customer form.
  2. In the Address field, type n.

    The platform suggests two cities starting with this letter (fig. 27.25).


    Fig. 27.25. Selecting from a set of predefined values in a text box

    The operations that you performed in Designer are also available in 1C:Enterprise script. This means that you can use some algorithm for dynamic generation of a selection list for a text box.

    Moreover, you can use 1C:Enterprise script to modify an automatically generated selection list (for example, a selection list in an automatically generated form). To do so, use the ChoiceDataGetProcessing event handler that is located in the object manager module. For example, to implement picking a catalog item in a text box, you can put the event handler to the catalog manager module.

<< Prev   Next >>

© 2020-2021 1C INTERNATIONAL LLC www.1Ci.com Support policy