Dropdown/custom picker (to utilize auto suggestions) with the option to enter new values?

Hello,

I'm looking for an text field (user input) which will auto suggest values (based on a database field). Afaik, that is something dropdown fields and with some more logical a customer picker can provide except they wont allow for new values to be entered.

What would be a good way (if any) to achieve this?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    That requires some tricks. A custom picker field expects a datasubset returned from the suggest function. That datasubset has a field called "identifiers" which is of type ANY. This means that you can put your whole record in it, instead of just the ID.

    When your user now looks for a non-existing item, you just have to add the entered search string to the field "data" and a new record (empty primary key!) to the identifiers field.

    I use this to provide a field to enter keywords mixing existing and new ones.

Reply
  • 0
    Certified Lead Developer

    That requires some tricks. A custom picker field expects a datasubset returned from the suggest function. That datasubset has a field called "identifiers" which is of type ANY. This means that you can put your whole record in it, instead of just the ID.

    When your user now looks for a non-existing item, you just have to add the entered search string to the field "data" and a new record (empty primary key!) to the identifiers field.

    I use this to provide a field to enter keywords mixing existing and new ones.

Children