chvd
chvd

Reputation: 11

Primefaces Autocomplete Converter similar to omnifaces.SelectItemsConverter

I am working on a web application using primefaces. I have an autocomplete field that gets its value from a pojo object. I would like to know if there is a converter solution similar to omnifaces.SelectItemsConverter so that I can avoid implementing my own converter.

The omnifaces.SelectItemsConverter iterates through the SelectItem collection of the SelectItems component in order to determine the actual pojo value. Is there a similar way to iterate through the AutoComplete suggestions (or only selected value) to determine the selected pojo value?

Upvotes: 1

Views: 62

Answers (1)

Melloware
Melloware

Reputation: 12039

Why not just use the OmniFaces converter? If not then YES you have to create your own converter for POJO's as that is how JSF/Faces works.

There is this open PF ticket: https://github.com/primefaces/primefaces/issues/10231 which discusses possible adding the same AutoConverter as OmniFaces but it has not been implemented yet.

Upvotes: 0

Related Questions