[richfaces-issues] [JBoss JIRA] (RF-13066) a4j:ajax does not work with tomahawk radiobuttons

Andrea Martino (JIRA) jira-events at lists.jboss.org
Fri Jun 21 08:24:20 EDT 2013


    [ https://issues.jboss.org/browse/RF-13066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783576#comment-12783576 ] 

Andrea Martino commented on RF-13066:
-------------------------------------

I have debugged the code and at least I understand why the <a4j:ajax /> behavior is not executed.

When clicking on the radiobutton the component that is executed has type org.apache.myfaces.custom.radio.HtmlRadio (coming from tomahawk). Since this class does not implement ClientBehaviorHolder, org.richfaces.context.RenderComponentCallback#findBehavior(UIComponent) returns null and no update is performed.

In order to work with "spread" layout, org.apache.myfaces.custom.radio.HtmlRadio should probably implement ClientBehaviorHolder and delegate the calls to the "for" radio button.

the org.apache.myfaces.custom.radio.HtmlRadio should be extended as following:
{code}
/**
 * Delegating ClientBehaviorHolder to "for" UIComponent
 */
@Override
public Map<String, List<ClientBehavior>> getClientBehaviors() {
	UIComponent uiSelectOne = findComponent(getFor());
	if (uiSelectOne instanceof ClientBehaviorHolder) {
		ClientBehaviorHolder clientBehaviorHolder = (ClientBehaviorHolder) uiSelectOne;
		return clientBehaviorHolder.getClientBehaviors();
	}
}
{code}

I will create a bug for Tomahawk and see if this could be implemented on their side.






                
> a4j:ajax does not work with tomahawk radiobuttons
> -------------------------------------------------
>
>                 Key: RF-13066
>                 URL: https://issues.jboss.org/browse/RF-13066
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 4.3.0.Final
>         Environment: a4j:ajax does not work inside a tomahawk radiobutton
>            Reporter: Andrea Martino
>              Labels: a4j:ajax
>             Fix For: 5-Tracking
>
>
> for example the following code does not work:
> {code}
> <t:selectOneRadio id="myRadio" value="#{testtest.xxxEnum}" layout="spread">
>   <s:enumItem enumValue="XXX" label="XXX" />
>   <s:enumItem enumValue="YYY" label="YYY" />
>   <a4j:ajax />
> </t:selectOneRadio>
> <div class="ct-radio">
>   <strong><t:radio for="myRadio" index="0"/></strong>
> </div>
> <div class="ct-radio">
>    <strong><t:radio for="myRadio" index="1"/></strong>
> </div>
> {code}
> If I replace <a4j:ajax/> by <f:ajax/> everything works as expected. I would like to user a4j:ajax instead of f:ajax because tooltips are not correctly refreshed when I use f:ajax (there should be already a bug opened for that).
> PS: I'm using tomahawk 1.1.14

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the richfaces-issues mailing list