我也做过JSF组件,但不是table类的,是日期类的,可能比table简单些。呵呵,帮你顶,相互学习:msn:[email protected]

解决方案 »

  1.   

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

  2.   

    根本不需要自定义一个datatable组件。
    因为myfaces实现本身带的datatable就能支持h:commandlink! <t:dataTable value="#{setupPage.dataModel}"
    var="aWaste" styleClass="standardTable"
    rowClasses="standardTable_Row" width="100%" cellpadding="1"
    cellspacing="1">
    <t:column width="10%" >
    <f:facet name="header">
    <h:outputText value="Select" />
    </f:facet>
    <h:selectBooleanCheckbox id="selected"
    value="#{aSuInvStkGr.selected}" />
    </t:column> <t:column>
    <f:facet name="header">
    <h:outputText value="Stock Group Code" />
    </f:facet>

    <t:commandLink id="stockgroupLink"
    action="#{setupPage.goUpdateWaste}" immediate="true">
    <h:outputText value="#{aWaste.vo.criteriaCode}"/>
    <t:updateActionListener property="#{setupPage.estWaste}" value="#{aWaste.vo}"></t:updateActionListener>
    </t:commandLink>
    </t:column>