在JSF 2组件中委派渲染

时间:2012-06-20 13:22:53

标签: java jsf-2

是否可以让自定义组件将其呈现委托给标准JSF组件:

@FacesComponent(value = "compositecomp")
public class CompositeComponent extends UIComponentBase {

    @Override
    public String getFamily() {
        return "composite";
    }

    @Override
    public void encodeEnd(FacesContext context) throws IOException {
        HtmlOutputText hot = new HtmlOutputText();
        // set some attributes here then...

       // delegate rendering
        hot.encodeEnd(context);
    }
}

0 个答案:

没有答案