lfnxd

          主題: tomahawk與trinidad呈現(xiàn)器沖突問題

              tomahawk與trinidad提供了豐富的控件,但是當(dāng)默認呈現(xiàn)器設(shè)置成org.apache.myfaces.trinidad.core時,tomahawk中的dataScroll不能正常工作。如果不設(shè)置默認呈現(xiàn)器,trinidad又不能工作,所以這是個矛盾,需要跟蹤代碼,使這兩個優(yōu)秀的開源JSF控件集能很好的共存。

              解決方法:在eclipse中導(dǎo)入trinidad-1.0.2的源碼,修改包org.apache.myfaces.trinidadinternal.renderkit.htmlBasic中的HtmlCommandLinkRenderer.java。

          public class HtmlCommandLinkRenderer extends Renderer
          {

            ...
            private Renderer renderer = null;   //增加呈現(xiàn)器接口成員變量

            ....
            //增加encodeBegin函數(shù)

            @SuppressWarnings("unchecked")
            @Override
            public void encodeBegin(FacesContext context,
                               UIComponent component) throws IOException
            {
              // The tr:commandLink is not a rendersChildren component,
              // but h:commandLink is.  Hence, the difference in behavior
              renderer = createRenderer(component);
              renderer.encodeBegin(context, component);

              for(UIComponent child : (List<UIComponent>)component.getChildren())
              {
                RenderUtils.encodeRecursive(context, child);
              }
            }

            ...
           

            //修改encodeEnd函數(shù)為當(dāng)前代碼
            @SuppressWarnings("unchecked")
            @Override
            public void encodeEnd(FacesContext context,
                               UIComponent component) throws IOException
            {
              // The tr:commandLink is not a rendersChildren component,
              // but h:commandLink is.  Hence, the difference in behavior
              if(renderer==null)
              {
               renderer = createRenderer(component);
               renderer.encodeBegin(context, component);
           
               for(UIComponent child : (List<UIComponent>)component.getChildren())
               {
                 RenderUtils.encodeRecursive(context, child);
               }
              }
              renderer.encodeEnd(context, component);
            }

            ...
          }

           

          posted on 2008-08-07 10:48 云和山的彼端 閱讀(371) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           

          導(dǎo)航

          <2008年8月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          統(tǒng)計

          常用鏈接

          留言簿(4)

          我參與的團隊

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 德阳市| 南宫市| 四川省| 江达县| 长垣县| 贵州省| 江阴市| 彭泽县| 定陶县| 江达县| 金川县| 马山县| 淅川县| 鹤岗市| 汾阳市| 深泽县| 且末县| 玛纳斯县| 雅江县| 临高县| 仪征市| 顺昌县| 泾阳县| 新田县| 通榆县| 永州市| 安泽县| 济源市| 房产| 汉寿县| 洛浦县| 台山市| 丘北县| 中西区| 正安县| 什邡市| 石阡县| 兴安县| 巴塘县| 大渡口区| 合阳县|