Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 自定义用户界面:调试_Jsf_Jsf 2_Facelets - Fatal编程技术网

Jsf 自定义用户界面:调试

Jsf 自定义用户界面:调试,jsf,jsf-2,facelets,Jsf,Jsf 2,Facelets,为了更好地分析组件树,我使用了。 现在我想定制这个调试窗口以优化分析 先决条件 我使用Chrome中的JavaScript控制台添加了以下JavaScript代码 (function () { var newscript = document.createElement('script'); newscript.type = 'text/javascript'; newscript.async = true; newscript.src = 'https://c

为了更好地分析组件树,我使用了
。 现在我想定制这个调试窗口以优化分析


先决条件 我使用Chrome中的JavaScript控制台添加了以下JavaScript代码

(function () {
    var newscript = document.createElement('script');
    newscript.type = 'text/javascript';
    newscript.async = true;
    newscript.src = 'https://code.jquery.com/jquery-1.11.3.min.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(newscript);
})();
用于将jQuery添加到调试窗口和

hideAll = function () {
    $('dd').addClass('hidden').removeClass('visible')
};
showAll = function () {
    $('dd').addClass('visible')
};
hideAll();
$('<span class="toggle toggleButton">toggle</span>').insertBefore('dl:has(dd)');
$('#tree').find('> code').prepend('<span class="toggleButton" onclick="showAll()">showAll</span>').prepend('<span class="toggleButton" onclick="hideAll()">hideAll</span>');

$('<style type="text/css">.hidden {display: none;}.visible {display: block;}.toggleButton{padding-left: 30px;}</style>').appendTo($('head'));
$('.toggle').click(function () {
    $(this).next().children().toggleClass('visible');
}).each(function () {
    $(this).append(' (' + $(this).next().find('dd').length + ' children)')
});
  • 我无法创建自定义标记并重用
    UIDebug
    ,因为函数
    encodeBegin
    facesContext.getResponseWriter()
    此时返回null

  • 我无法侦听
    preRenderView
    -事件,因为打开调试窗口时未调用此事件。但我认为,听一些事件将是有希望的


  • 您对此有什么想法吗?

    小评论(不是解决方案):您的jquery代码已经依赖于实现的AFAIC。Mojarra对调试进行了不同的处理,感谢您的评论。我目前使用Mojarra,但在我知道如何连接到()之后,我将提供一个独立于实现的解决方案
    <render-kit>
        <renderer>
            <component-family>facelets</component-family>
            <renderer-type>facelets.ui.Debug</renderer-type>
            <renderer-class>com.my.CustomDebug</renderer-class>
        </renderer>
    </render-kit>