incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Böhringer Jochen <Jochen.Boehrin...@tcc-products.de>
Subject AW: Trinidad Table: Disable selection for a row
Date Thu, 28 Dec 2006 13:12:37 GMT
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:Jochen.Boehringer@tcc-products.de] 
Gesendet: Freitag, 8. Dezember 2006 18:19
An: adffaces-user@incubator.apache.org
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


Mime
View raw message