我自定义了一个组件UICustomTable 我想在UICustomTable中使用<h:commandLink />这个组件。 请高手赐教。以下只是其中的代码片段:public void encodeBegin(FacesContext context) throws IOException
{
  ResponseWriter writer=FacesContext.getResponseWriter();
  writer.write("<f:commandLink id='link' value=\""+vRow.elementAt(k).toString()+"\" onclick=\"return selectThis(this.parentNode.parentNode);\" />");

}

解决方案 »

  1.   

    上面的代码,在客户端只是原样输出了<h:commandLink id='link'  /> 并没有真正调用到commandLink组件。
      

  2.   

    回楼上兄弟的:我肯定是继承UIComponentTag 类呀。难道就没人会吗?。。
      

  3.   

    你必须在你的Tag直接写Commandlink组件
    然后赋予onclick属性
    writer.write是无用的
    因为那根本无法渲染组件
      

  4.   

    CSDN 没有懂的吗?..? 求了几天都没效果。。 晕。 !!!
      

  5.   

    你根本没有必要那样做,你可以使用如下的方法使用link
    <custom:customtable>
    ......
    <f:commandLink id='link' value="" onclick="return selectThis(this.parentNode.parentNode);" />
    ......
    </custom:customtable>
    直接用不就可以了吗?你要是真想写在里面,那就去找到<f:commandLink>的源代码,按照它写的自己从新写一遍.