4

I want to add many instances of a composite component to one jsf view. Each composite component should have a dedicated/not shared cdi (handler) bean. If i make the handler bean viewscoped/request scoped every composite component on the view would call to same instance. Is there an easy solution to this problem?

I use jsf 2.2 with primefaces on wildfly 10 server.

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
mojoo-de
  • 501
  • 5
  • 20
  • 1
    Are you sure you need a dedicated/not shared cdi (handler) bean or do you need a composite component with a dedicated backing bean (http://balusc.omnifaces.org/2013/01/composite-component-with-multiple-input.html) ? A dedicated 'handler' bean per component instance is sort of not the best design and in many cases not needed (you can e.g. detect which component initiated a request in another way). So might be running into an http://xyproblem.info here. – Kukeltje Aug 08 '18 at 06:38
  • I am sorry i do not really understand the difference between your two points. The composite component would be complex and i dont want one handler to manage a lot of them. Sure i could pass some parameter to one handler to determine the cc instances but why should i do that myself if the cointainer could do that by creating a dedicated handler for each cc. – mojoo-de Aug 08 '18 at 06:53
  • Did you find a solution for this? I have a composite component with input fields, and each input should be handled by a dedicated handler instance. – wutzebaer Nov 27 '18 at 13:15
  • No i didnt. I made one Handler and needed to pass an identifier from each composite component to the handler. – mojoo-de Nov 28 '18 at 05:44

0 Answers0