Hi all,
Still learning custom components, trying to build my dynamically adding email panel, where clicking a + sign adds a new input field without refreshing the entire page, and pressing - removes one, and submitting the form properly stores all the emails entered into the dynamic fields.
So, I am reading from Core
JSF 3rd edition, chapter 11 custom components. Also some stuff online. From what I read I thought I just declare a FacesComponent and provide the encodeBegin, encodeEnd and decode methods in this one class, to handle adding/rendering the dynamic email components, as well as (in decode) when the form is submitted reading the request parameters and populating the POJO email object. But, looking at their example of TabbedPane, it renders children (tabs) and uses a Renderer implementation. So I am trying to make sense of it all. If a @FacesComponent can override the encode/decode methods, why would I need a separate renderer class with those methods and the component class is pretty much empty?
I am attempting to do this the right way, but perhaps there is more than one way this can be done correctly?
Also, since my component basically needs to be wrapped in a container, does it make sense to extend UIPanel as opposed to UIINput?
Thanks.