Angular PrimeNG ListBox populating selected values on loading

UI Components for Angular
Post Reply
munipalli siva
Posts: 1
Joined: 19 Jan 2022, 06:20

19 Jan 2022, 09:48

im using list box in reactive forms in angular. Im able to get the multiple selected valules while adding. while editing need to populate the value in the list box, so that user can select different values. i cant use ngModel in reactive forms as its deprecated. Any idea on how to populate value on loading. it will have multiple values which need to displayed as selected on loading.
im using angular 13.0 and primeng "13.0.3". Here is my HTML
<p-listbox [options]="contacts" optionLabel="contact_role_name"
[listStyle]="{'max-height':'75px', 'max-width':'300px'}" (onChange)="getSelectedRoles($event)"
[multiple]=multi formControlName="roleName">
</p-listbox>
Any help would be appreciated.

Amaro
Posts: 9
Joined: 01 Mar 2021, 23:49

02 Feb 2022, 16:46

I am having the same difficulty, did not find anything in the documentation.

But I bet you can "patchValue" as data to pass the data in.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests