Hello,

I didn't find a clean solution for my problem disabling some rows in a
Trinidad table, but I have a workaround in place which works for me and
perhaps someone has the same requirement:

The first column in my Trinidad table is bound to a backing been using a
component binding:

<tr:column sortable="true" sortProperty="name"
        binding="#{lookupOrganizationController.column}">
        <f:facet name="header">
                <tr:outputText value="Name" />
        </f:facet>
        <tr:commandLink text="#{organization.name}"
                action="#{lookupOrganizationController.acceptAndReturn}"
                disabled="#{not organization.selectable}">
        </tr:commandLink>
        <trh:script rendered="#{not organization.selectable}"
text="document.getElementById('#{lookupOrganizationController.columnSelectId
}').disabled = 'true';" 
        />
</tr:column>

I have a method getColumnSelectId in my backing been calculating the id of
the select checkbox using the getClientId method on the bound column:

        public String getColumnSelectId() {
                if (column != null) {
                        String id =
column.getClientId(FacesContext.getCurrentInstance());
                        //e.g. lsf:_id319:0:_id320 --> lsf:_id319:0
                        int cutPos = id.lastIndexOf(":");
                        if (cutPos >= 0) {
                                return id.substring(0, cutPos);
                        } else {
                                return null;
                        }
                } else {
                        return null;
                }
        }

The script in the column uses this id to disable the checkbox in front of
the table's row. That's it.

If someone knows, I'm still interested in a cleaner approach using Trinidad
component attributes.

Regards
Jochen


-----Ursprüngliche Nachricht-----
Von: Böhringer Jochen [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 8. Dezember 2006 18:19
An: [email protected]
Betreff: Trinidad Table: Disable selection for a row

Hello,

 

is it possible to have a Trinidad Table with rowSelection attribute set to
'multiple' and disable the selection checkbox for some of the rows in the
table?

 

Regards

Jochen

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to