lfnxd

          主題: tomahawk與trinidad呈現器沖突問題

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

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

          public class HtmlCommandLinkRenderer extends Renderer
          {

            ...
            private Renderer renderer = null;   //增加呈現器接口成員變量

            ....
            //增加encodeBegin函數

            @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函數為當前代碼
            @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)  編輯  收藏


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


          網站導航:
           

          導航

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

          統計

          常用鏈接

          留言簿(4)

          我參與的團隊

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 汝南县| 白山市| 调兵山市| 盖州市| 南漳县| 南和县| 北京市| 宽城| 太仆寺旗| 孟连| 来安县| 项城市| 哈巴河县| 韶山市| 德格县| 江西省| 周宁县| 东台市| 巴彦县| 多伦县| 时尚| 黄梅县| 安化县| 五原县| 正蓝旗| 岗巴县| 寻乌县| 镇巴县| 周口市| 九龙城区| 平阴县| 崇左市| 涞源县| 河南省| 红原县| 石河子市| 多伦县| 甘南县| 扬中市| 太和县| 霞浦县|