Extended @FacesComponent as composite interface componentType renders nothing

前端 未结 1 1908
情深已故
情深已故 2020-12-17 05:51

I\'m trying to extend JSF\'s component class (let it be one of h:panelGroup) and render it via composite component:

Step 1:

@FacesCompon         


        
相关标签:
1条回答
  • 2020-12-17 06:28

    The backing component of the composite component must implement NamingContainer and the getFamily() must return javax.faces.NamingContainer. See also description of the componentType attribute in the <composite:interface> tag documentation.

    @FacesComponent(value="customPanel")
    public class CustomPanel extends HtmlPanelGroup implements NamingContainer {
    
        @Override
        public String getFamily() {
            return UINamingContainer.COMPONENT_FAMILY;
        }
    
    }
    

    You can also choose to extend UINamingContainer instead, so that you can omit the getFamily().

    See also:

    • Composite component wiki page
    0 讨论(0)
提交回复
热议问题