[richfaces-issues] [JBoss JIRA] Commented: (RF-8470) MenuItems doesn't work after Ajax-Requests

Dustin Peterson (JIRA) jira-events at lists.jboss.org
Thu Mar 4 06:22:10 EST 2010


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

Dustin Peterson commented on RF-8470:
-------------------------------------

included page:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html 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:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">
	<h1><h:outputText value="#{msgmod.analyse}" /></h1>
	<h:form>
		<rich:dataTable cellpadding="0" cellspacing="0" width="98%"
			var="analysis" value="#{modAET.analyseTool.currentAnalysis.dataList}">
			<f:facet name="header">
				<rich:columnGroup>
					<rich:column rowspan="3">
						<h:outputText value="YTD - Prior YTD" />
						<br />
						<h:outputText
							value="#{modAET.analyseTool.currentAnalysis.dataMonth}/#{modAET.analyseTool.currentAnalysis.priorYear} - #{modAET.analyseTool.currentAnalysis.dataMonth}/#{modAET.analyseTool.currentAnalysis.currentYear}" />
					</rich:column>
				</rich:columnGroup>
			</f:facet>
			<rich:column> 
				<a4j:commandLink limitToList="true" ajaxSingle="true" immediate="true"
					styleClass="command analysistable" reRender="toolbar,dataGroup" actionListener="#{modAET.analyseTool.analyseMC}">
					<f:param name="id" value="#{analysis.mc.identifier}" />
					<h:outputText styleClass="command analysistable"
						value="#{analysis.mc.datacode} #{analysis.mc.en}" />
					<rich:componentControl for="dataPanel" operation="show"
						event="onclick" />
				</a4j:commandLink>
			</rich:column>
		</rich:dataTable>
		<br />
		<h:commandLink styleClass="command text" value="#{msgmod.back}"
			action="#{modAET.accessAnalysis}" />
		<h:outputLink target="_blank" styleClass="command text"
			value="#{modAET.dir}/excelexport.jsp">
			<h:outputText value="#{msgmod.export}" />
		</h:outputLink>
	</h:form>

	<!-- DATA PANEL  -->
	<rich:modalPanel id="dataPanel" width="300" autosized="true">
		<f:facet name="header">
			<h:panelGroup>
				<h:outputText value=" !!!"></h:outputText>
			</h:panelGroup>
		</f:facet>
		<f:facet name="controls">
			<h:panelGroup>
				<h:form>
					<h:graphicImage value="#{contentmanager.iconClose}"
						id="hideDeletePanel">
						<rich:componentControl for="dataPanel" operation="hide"
							event="onclick" />
					</h:graphicImage>

				</h:form>
			</h:panelGroup>
		</f:facet>
		<br />
		<br />
		<h:form>
			<h:panelGroup id="dataGroup">
				<h:outputText value="Wa: #{modAET.analyseTool.currentAnalysingMC}" />
			</h:panelGroup>
		</h:form>
	</rich:modalPanel>
</ui:composition>


bean code for the ajax method:

    public void analyseMC(ActionEvent event){
        Map<String, String> parameters = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
        String id = parameters.get("id");
        if(id!=null){
            this.setCurrentAnalysingMC(Long.parseLong(id));
        }
    }


Additionally I found out, that the problem does not belong to the reRender-process (so if I reRender components but don't have an actionListener everything works properly). Only if I add actionListener, the problem happens.

> MenuItems doesn't work after Ajax-Requests
> ------------------------------------------
>
>                 Key: RF-8470
>                 URL: https://jira.jboss.org/jira/browse/RF-8470
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-menu
>    Affects Versions: 3.3.2.SR1
>         Environment: Windows XP SP3
> Internet Explorer 6, Firefox 3.6, Chrome 4.0, Opera 10.10
> Apache MyFaces 1.2.6
> Richfaces 3.3.2
>            Reporter: Dustin Peterson
>            Assignee: Nick Belaevski
>
> I'm using rich:toolbar in connection with ui:include or a4j:include (the effect is the same).
> The MenuItems below toolbar set variables, which page to include and the include-component includes this page - does work well.
> But if I use e.g. a4j:commandLink or rich:progressBar, the ActionEvents of the MenuItems won't be fired. The JSF Lifecycle is working properly.
> I have to do one request on the toolbar and in the next request everything works fine again, so i have to press the toolbar item twice. 
> It sounds to me like a bug.
> Anyway, the normal JSF commandLink or commandButton does work well and their ActionEvents are fired, so the problem should be anywhere in toolbar, menuitem or dropdownmenu.
> Here's the code of the main page:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!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:h="http://java.sun.com/jsf/html"
> 	xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"
> 	xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">
> 	<f:view locale="#{contentmanager.locale}" id="mainview">
> 		<head>
> 			<title><h:outputText value="#{msg.title}" /></title>
> 			<link rel="stylesheet" href="style.css" />
> 			<ui:insert name="script" />
> 		</head>
> 		<f:loadBundle basename="local.bundle"
> 			var="msg" />
> 		<f:loadBundle basename="#{contentmanager.currentResourcePath}"
> 			var="msgmod" />
> 		<body>
> 			<rich:panel headerClass="panelHeader" bodyClass="panelBody">
> 				<f:facet name="header">
> 					<h:form>
> 						<rich:toolBar styleClass="toolbar" width="100%"
> 							binding="#{contentmanager.toolbar}" contentClass="toolbaritem"
> 							itemSeparator="line" id="toolbar">
> 							<rich:toolBarGroup location="right">
> 								<h:commandLink action="#{contentmanager.changeCurrentLocale}">
> 									<f:param name="locale" value="de" />
> 									<h:graphicImage styleClass="language"
> 										value="#{contentmanager.iconGerman}" />
> 								</h:commandLink>
> 								<h:commandLink action="#{contentmanager.changeCurrentLocale}">
> 									<f:param name="locale" value="en" />
> 									<h:graphicImage styleClass="language"
> 										value="#{contentmanager.iconEnglish}" />
> 								</h:commandLink>
> 							</rich:toolBarGroup>
> 						</rich:toolBar>
> 					</h:form>
> 				</f:facet>
> 				<h:panelGroup rendered="#{contentmanager.moduleConfigurationChanged}">
> 					<br /><p class="text"><h:graphicImage value="#{contentmanager.iconNewMail}" style="height:24px;vertical-align:middle;align:left" /><h:outputText styleClass="richpadding" value="#{msg.moduleconfigchanged}" /></p>
> 				</h:panelGroup>
> 				<h:messages styleClass="removeliststyle" errorClass="error"
> 					infoClass="success" />
> 				<!-- INCLUDED PAGE -->
> 				<ui:include src="#{contentmanager.currentInclude}" id="includewindow"/>
> 				<br />
> 			</rich:panel>
> 		</body>
> 	</f:view>
> </html>
> In the backing bean, the toolbar items are created with the specific MenuItems and ActionListeners on the MenuItems.
> For example if I click that link:
> <a4j:commandLink actionListener="#{module.analysation}" reRender="dataGroup">
> 					<f:param name="id" value="#{module.identifier}" />
> 					<h:outputText
> 						value="test" />
> 					<rich:componentControl for="dataPanel" operation="show"
> 						event="onclick" />
> 				</a4j:commandLink>
> dataGroup is a panelGroup in the modalPanel.
> After clicking this link and the corresponding hide-link for the modalpanel, the next time I click on a menuitem the ActionEvents aren't fired.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list