Atualização de valor selecionado po-combo #1935
Unanswered
danielscheeren
asked this question in
Angular
Replies: 3 comments 2 replies
-
Boa Tarde @danielscheeren, tudo bem? Iremos analisar e em breve iremos responder sua solicitação. attr. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Encontrei esse mesmo problema usando o angular 19.1.0. Alguém conseguiu solucionar? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Bom dia pessoal, na doc do combo fala sobre o ngModel, por favor verifiquem se isso resolve o problema reportado: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Boa tarde.
Estou implementando um po-combo e realizando algumas tratativas. Uma delas seria adicionar uma das opções como o valor incial (selecionado).
Tentei utilizar o ngmodel para a atualização, porém não surte efeito. O mesmo também não permite fazer uso do two-way binding informando o erro: The property and event halves of the two-way binding 'ngModel' are not bound to the same target..
Estou me baseando no exemplo da documentação:

Ao utilizar o [ngModel] para setar a informação, nada acontece:

produtos-list.component.html
`
<po-page-default p-title="Produtos" [p-actions]="actions" [p-breadcrumb]="breadcrumb">
produtos-list.component.ts
`
import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
// import { ClienteListService } from './produtos-list.service';
import { Router } from '@angular/router'
import { PoPageAction, PoBreadcrumb, PoTableColumn, PoDialogService, PoNotificationService, PoComboOption, PoComboOptionGroup } from '@po-ui/ng-components';
import { lastValueFrom } from 'rxjs'
import { NgForm } from '@angular/forms';
// services
import { ProdutosListService } from './produtos-list.service';
@component({
selector: 'app-produtos-list',
templateUrl: './produtos-list.component.html',
styleUrls: ['./produtos-list.component.css']
})
export class ProdutosListComponent implements OnInit {
@ViewChild('fOption', { static: true }) form: NgForm;
items: Array = [];
page = 1;
disableNext = false;
selectedOption: string = 'Teste1';
public readonly actions: Array = [
{ label: 'Atualizar', action: this.getItems.bind(this), icon: 'po-icon-refresh' },
{ label: 'Novo', action: () => { this.router.navigate(['/client-edit']) }, icon: 'po-icon-plus' },
];
public readonly breadcrumb: PoBreadcrumb = {
items: [{ label: 'Home', link: '/' }, { label: 'Produtos' }]
};
public readonly columns: Array = [
{ property: 'b1_cod', width: '10%', label: 'Código' },
{ property: 'b1_desc', width: '30%', label: 'Descrição' },
{ property: 'b1_grupo', width: '40%', label: 'Grupo' },
{ property: 'bm_desc', width: '40%', label: 'Descrição Grupo' }
]
public readonly options: Array<PoComboOption | PoComboOptionGroup> = [ // para criar agrupadores Array<PoComboOption | PoComboOptionGroup>
{ value: '1', label: 'Teste1'},
{ value: '2', label: 'Teste2'},
{ value: '3', label: 'Teste3'},
{ value: '4', label: 'Teste4'}
];
constructor(
private produtosListService: ProdutosListService,
private poDialog: PoDialogService,
public router: Router,
private poNotification: PoNotificationService,
) { }
ngOnInit() {
this.getItems();
}
getItems(lShowMore = false) {
}
@output() openMultiselectEventHandler: EventEmitter = new EventEmitter();
@output() closeMultiselectEventHandler: EventEmitter = new EventEmitter();
// evento ao selecionar opção do combo
seleciona_opcao(value: any) {
}
}
`
Versão que estou utilizando:

Beta Was this translation helpful? Give feedback.
All reactions