[richfaces-issues] [JBoss JIRA] (RF-12618) a4j:ajax listener not called if prependId is true (with a composite component)

Brian Leathem (JIRA) jira-events at lists.jboss.org
Fri Nov 30 17:50:21 EST 2012


     [ https://issues.jboss.org/browse/RF-12618?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Leathem updated RF-12618:
-------------------------------

    Description: 
If I use a composite component which defines element with id concatenated from {{cc.clientId}}, then {{a4j:ajax}} doesn't call the attached {{listener}}.

{code:title=the attached _label.xhtml_}.
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:cc="http://java.sun.com/jsf/composite">

	<cc:interface componentType="org.jboss.seam.faces.InputContainer">
		<cc:attribute name="label" required="true" />
	</cc:interface>

	<cc:implementation>
		<h:outputLabel value="#{cc.attrs.label} :" for="#{cc.clientId.concat('Input')}">
		</h:outputLabel>
		<h:panelGroup id="#{cc.clientId.concat('Input')}">
			<cc:insertChildren />
		</h:panelGroup>
	</cc:implementation>
	
</ui:composition>
{code}

{code:title=the attached _test.xhtml_}.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:s="http://jboss.org/seam/faces"
	xmlns:a4j="http://richfaces.org/a4j"
    xmlns:co="http://java.sun.com/jsf/composite/components"
	xmlns:f="http://java.sun.com/jsf/core">
	
	<f:metadata>
		<s:viewAction action="#{conversation.begin}" if="#{conversation.transient}" />
	</f:metadata>

	<f:view>
		<h:head />
		<h:body>
			Test
			<h:form id="buttonForm" prependId="true">
				<h:panelGroup id="panelGroup">
					<co:label label="Select">
						<h:selectOneMenu value="#{testAction.selectedLabel}">
							<f:selectItems value="#{testAction.labels}" var="label" itemLabel="#{label.label}" itemValue="#{label}" />
							<s:objectConverter />
							<a4j:ajax event="valueChange" render="second" execute="@this" listener="#{testAction.valueChanged}" />
						</h:selectOneMenu>
					</co:label>
					<h:panelGroup id="second">
						<h:outputText value="#{testAction.selectedLabel.label}" />
					</h:panelGroup>
				</h:panelGroup>
			</h:form>
		</h:body>
	</f:view>
</html>
{code}

That page is using the composite attached {{label.xhtml}} which you must place in your {{webapp/resources/components/}}.

  was:
If I use a composite component which defines element with id concatenated from {{cc.clientId}}, then {{a4j:ajax}} doesn't call the attached {{listener}}.

See the attached {{test.xhtml}}.

That page is using the composite attached {{label.xhtml}} which you must place in your {{webapp/resources/components/}}.


    
> a4j:ajax listener not called if prependId is true (with a composite component)
> ------------------------------------------------------------------------------
>
>                 Key: RF-12618
>                 URL: https://issues.jboss.org/browse/RF-12618
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-a4j-core
>    Affects Versions: 4.2.3.Final
>         Environment: JBoss 7.1.1.Final / Ubuntu 12.04 LTS
>            Reporter: Anthony O.
>              Labels: a4j:ajax, composite
>         Attachments: label.xhtml, test.xhtml
>
>
> If I use a composite component which defines element with id concatenated from {{cc.clientId}}, then {{a4j:ajax}} doesn't call the attached {{listener}}.
> {code:title=the attached _label.xhtml_}.
> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <ui:composition xmlns="http://www.w3.org/1999/xhtml"
> 	xmlns:ui="http://java.sun.com/jsf/facelets"
> 	xmlns:f="http://java.sun.com/jsf/core"
> 	xmlns:h="http://java.sun.com/jsf/html"
> 	xmlns:c="http://java.sun.com/jsp/jstl/core"
> 	xmlns:rich="http://richfaces.org/rich"
> 	xmlns:cc="http://java.sun.com/jsf/composite">
> 	<cc:interface componentType="org.jboss.seam.faces.InputContainer">
> 		<cc:attribute name="label" required="true" />
> 	</cc:interface>
> 	<cc:implementation>
> 		<h:outputLabel value="#{cc.attrs.label} :" for="#{cc.clientId.concat('Input')}">
> 		</h:outputLabel>
> 		<h:panelGroup id="#{cc.clientId.concat('Input')}">
> 			<cc:insertChildren />
> 		</h:panelGroup>
> 	</cc:implementation>
> 	
> </ui:composition>
> {code}
> {code:title=the attached _test.xhtml_}.
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> 		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
> 	xmlns:ui="http://java.sun.com/jsf/facelets"
> 	xmlns:h="http://java.sun.com/jsf/html"
> 	xmlns:rich="http://richfaces.org/rich"
> 	xmlns:s="http://jboss.org/seam/faces"
> 	xmlns:a4j="http://richfaces.org/a4j"
>     xmlns:co="http://java.sun.com/jsf/composite/components"
> 	xmlns:f="http://java.sun.com/jsf/core">
> 	
> 	<f:metadata>
> 		<s:viewAction action="#{conversation.begin}" if="#{conversation.transient}" />
> 	</f:metadata>
> 	<f:view>
> 		<h:head />
> 		<h:body>
> 			Test
> 			<h:form id="buttonForm" prependId="true">
> 				<h:panelGroup id="panelGroup">
> 					<co:label label="Select">
> 						<h:selectOneMenu value="#{testAction.selectedLabel}">
> 							<f:selectItems value="#{testAction.labels}" var="label" itemLabel="#{label.label}" itemValue="#{label}" />
> 							<s:objectConverter />
> 							<a4j:ajax event="valueChange" render="second" execute="@this" listener="#{testAction.valueChanged}" />
> 						</h:selectOneMenu>
> 					</co:label>
> 					<h:panelGroup id="second">
> 						<h:outputText value="#{testAction.selectedLabel.label}" />
> 					</h:panelGroup>
> 				</h:panelGroup>
> 			</h:form>
> 		</h:body>
> 	</f:view>
> </html>
> {code}
> That page is using the composite attached {{label.xhtml}} which you must place in your {{webapp/resources/components/}}.

--
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