开发者

JSF ui:insertChildren fine when the component is in the same project, fails when in it is in a taglib

I have a fairly simple JSF component:

<composite:interface>
</composite:interface>

<composite:implementation>
    <mytaglib:jquery-ui/>
    <h:outputScript target="head" library="com.mytaglib.mytaglib" name="dockwidget/dockwidget.js"/>
    <f:subview>
    <div id="${component.clientId}_div">
        <composite:insertChildren/>
    </div>
    <script>
    $(document).ready(function() {
        setTimeout("$(document.getElementById('${component.clientId}_div')).dockWidget();", 50);
    });
    </script>       
    </f:subview>

I've included that in a taglib jar (maven project linked in Eclipse) with the required entry in the mytaglib.taglib.xml. When I use it this way then the insertChildren does not seem to pick up the children. Everything else 开发者_如何转开发renders fine - including a test "Hello World" if I insert it into the div in the control.

If I take the xhtml file and place it under resources/localcontrols and refer to that copy in my page.xhtml it works and the child components are included.

Is this normal?

Thanks - Richard

(As an aside - the setTimeout because my layout javascript was running too early - before the child components had been fully rendered. I wonder if JQuery has a way of solving this properly.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜