You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Brummeline Braaten <br...@gmail.com> on 2007/03/16 15:05:17 UTC

t:commandlink and css

I’ve got at table that consists of a column with links (t:commandlink). 
When I click on one of this links, I would like to change the appearance 
of this link. What happens when I click the link is that another table is 
rendered and shown in the page. What I want is that when this table is shown, 
the link should be shown as active, and not be clickable. My code is connected 
to a CSS. Is it possible to connect a style to the bean? 

My code is like this:
<t:dataTable var="rader" newspaperColumns="5"
value="#{tabnavigering.categoryList}" id="kategorilisten">			<f:facet
name="spacer">								<f:verbatim>  &nbsp; &nbsp; &nbsp; </f:verbatim>
 	</f:facet>
	<h:column id="kategorikolonne">
	<t:commandLink styleClass="category" id="kategorilink"
action="#{tabnavigering.velgKategori}" >
	<h:outputText value="#{rader.categoryName}" id="kategorinavn"/>
	<f:param value="#{rader.categoryName}" name="kategorinavn"/>
	<f:param value="#{rader.categoryId}" name="kategoriid"/>
	</t:commandLink>
	</h:column>
	</t:dataTable>

I’ve tried to change the styleClass=”category” to “#{tabnavigering.linkstyle}” 
and have a public String getLinkstyle() method and change the value of the 
style in the action method before I called the getLinkstyle method, but I 
couldn’t get it to work. 

The code of the action method is like this:
public String velgKategori(){
		kategoriid = Long.parseLong(getFacesParamValue("kategoriid"));
		kategorinavn=getFacesParamValue("kategorinavn");
		super.setnoticeSelection(kategoriid);
		return "";
	}

I’ve seen that the t:commandlink has an attribute called disabledstyle. 
Could that be used for this purpose?