Problems with Load PickList data

UI Components for JSF
Post Reply
mauroreinehr
Posts: 3
Joined: 26 Jun 2015, 02:28

11 Sep 2017, 13:44

Oi,

I'm having trouble starting a picklist, in the code I have the following structure:

Code: Select all

private List<Fazenda> fazendasRelacionar; // Source
private List<Fazenda> fazendasRelacionadas; // Target
private DualListModel<Fazenda> fazendasDual; // DualListModel
There is a button called "Add" inside a Datatable when it is clicked on it, the method below is invoked:

Code: Select all

public void vincular(Usuario us) {
	try {
		usuario = us;
		fazendasDual = new DualListModel<Fazenda>();
		fazendasRelacionar = fazendaDao.list();
		System.out.println(fazendasRelacionar.size());  //Returns 5 Records.
		fazendasRelacionadas = dao.fazendasVinculadas(usuario);			
		System.out.println(fazendasRelacionadas.size()); // Returns 2 Records.			
		fazendasDual.setSource(fazendasRelacionar);
		fazendasDual.setTarget(fazendasRelacionadas);
	} catch (Exception ex) {
		FacesUtil.addErrorMessage("Erro: " + ex.getMessage());
	}
}
Image
https://imgur.com/H3nIp19
when displaying the picklits on the screen, it gets empty, I added 2 System.out.println () as can be seen in the snippet above the ArrayList have data, what am i doing wrong?

Thanks!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 32 guests