-
1. Re: Use rel= property on a4j:commandlink ? Or other way to modify url of richfaces link inside of Portlet/PBridge
masbae Nov 5, 2010 5:42 AM (in response to masbae)id like add some more info about this issue...
if i view the html code i can see the href property of the part generated by a4j commandlink which is currently set to href="#". Changing this to something more meaningful would add something to the Link it seems (tried with firebug) and the action still is working fine (it seems).
Can we alter the behaviour of the href property? a4j:commandlink and h:commandlink seem to support only hreflang
-
2. Re: Use rel= property on a4j:commandlink ? Or other way to modify url of richfaces link inside of Portlet/PBridge
ilya_shaikovsky Nov 8, 2010 3:51 AM (in response to masbae)use outputLink.
-
3. Re: Use rel= property on a4j:commandlink ? Or other way to modify url of richfaces link inside of Portlet/PBridge
masbae Nov 8, 2010 5:00 AM (in response to ilya_shaikovsky)but then i'm going to lose the builtin ajax functionality and cant set an action parameter? plus the urls should not really be called, only shown , the action is being done by action="#{bean...}" of a4j:commandLink
or is there a way to combine these two tags to have both the a4j action performed and the "rewritten" url correctly shown at the bottom and next page)
-
4. Re: Use rel= property on a4j:commandlink ? Or other way to modify url of richfaces link inside of Portlet/PBridge
masbae Nov 8, 2010 6:33 AM (in response to masbae)i have reviewed the richfaces 3.3.3 sourcecode and found one interesting line at
/* */ package org.ajax4jsf.renderkit.html;
public class CommandLinkRenderer extends AjaxCommandRendererBase
Method:
doEncodeBegin(....
getUtils().writeAttribute(writer, "href", "#");
I think being able to change this to a variable value instead of # would solve my requirement. Do you have any idea how to set this value? Or how to overwrite the standard richfaces commandLink to be able to set this attribute?
Thanks
-
5. Re: Use rel= property on a4j:commandlink ? Or other way to modify url of richfaces link inside of Portlet/PBridge
masbae Nov 10, 2010 4:42 AM (in response to masbae)just to complete this thread:
ive found a solution to modify the href attribute. basically what you need to do is to overwrite the doEncodeBegin Method of org.ajax4jsf.component.UIAjaxCommandLink; (just create an extended renderer) and at following line remove the "#" with something useful like getUtils().writeAttribute(writer, "href", component.getAttributes().get("url"));
then you can use the url= parameter to set href.