-
1. Re: Change style when commandLink is selected
ilya_shaikovsky Jan 18, 2010 11:36 AM (in response to timgozag)such conditional stlye implemented and works fine at richfaces-demo (in main vertical menu) you could download sources and check the impl. -
2. Re: Change style when commandLink is selected
timgozag Jan 18, 2010 11:42 AM (in response to ilya_shaikovsky)Thanks for the quick response. Do you have an url to download the rich-demo? Thanks a lot! -
3. Re: Change style when commandLink is selected
chris55 Jan 18, 2010 1:44 PM (in response to timgozag)Again, any progress on providing the demo link for commandlink style change onClick? -
4. Re: Change style when commandLink is selected
timgozag Jan 18, 2010 1:58 PM (in response to chris55)Here is what I found:
http://www.jboss.org/richfaces/download/milestones.html
to download richfaces-demo.
About the changing style, I have made it work (I haven't checked out the richfaces-demo yet so I don't know if it is similar to what they did). I created a function in the backing bean to check what value is selected then change the style. It works like a charm
<c:forEach items="#{testBean.productNames}" var="productName" varStatus="linkStatus">
<a4j:commandLink value="#{productName}" styleClass="#{productName == testTaskBean.productSelected() ? 'productSelectedStyle': 'productStyle'}"
actionListener="#{testBean.doSomething()}"
reRender="productLinkPanel">
<f:param name="selectedProduct" value="#{productName}"/>
</a4j:commandLink>
</c:forEach>Backing bean:
public String productSelected(){
FacesContext context = FacesContext.getCurrentInstance();
Object value = context.getExternalContext().getRequestParameterMap().get("selectedProduct");
String productSelected = (value == null) ? "Product 1": value.toString();
return productSelected;
} -
5. Re: Change style when commandLink is selected
chris55 Jan 18, 2010 2:03 PM (in response to timgozag)Tim,
Cool. That is the same road I started down. FYI I also starting to make use of a4j:log which is very helpful for assessing ajax responses from such actions (commandlink onClick(), etc.). Peace...
-
6. Re: Change style when commandLink is selected
ilya_shaikovsky Jan 19, 2010 5:03 AM (in response to chris55)link for checkout sources from svn: