Fórum

rich:tree toggle ajax not working with liferay faces bridge

thumbnail
Supratim Bandyopadhyaya, modificado 11 Anos atrás.

rich:tree toggle ajax not working with liferay faces bridge

New Member Postagens: 10 Data de Entrada: 07/06/12 Postagens Recentes
Hi,
I have the following code in the facelet. I am using liferay 6.0.5 with richfaces 4.2.0 final and liferay-faces-bridge-impl-3.0.0-RC2-20120604.163520-2.jar. The toggleType="ajax" does not work. But toggleType="client" always works.
I have inspected that toggleType="ajax" fires request and gets response the entire html of the parent portal page.


						<rich:tree id="tree" var="item" togglenodeevent="click" toggletype="ajax" selectiontype="ajax">
							<rich:treemodelrecursiveadaptor roots="#{act.children}" nodes="#{item.children}">
							</rich:treemodelrecursiveadaptor>
						</rich:tree>



and using the following managed bean for the tree .



/**
 * 
 */
package com.jsfportlet.managedbeans;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;

/**
 * @author Supratim Bandyopadhyaya
 * 
 */
@ManagedBean(name = "act")
@SessionScoped
public class Act implements Serializable {

	// serialVersionUID
	private static final long serialVersionUID = 2947548873495692163L;

	private String name;

	private List<act> children;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<act> getChildren() {
		return children;
	}

	public void setChildren(List<act> children) {
		this.children = children;
	}

	@PostConstruct
	public void init() {
		this.name = "Assam acts 98w34/347";
		List<act> listSubAct = new ArrayList<act>();
		
		Act subAct = null;
		Act subsubAct=null;
		for (int i = 0; i &lt;= 10; i++) {
			subAct = new Act();
			List<act> listSubSubAct = new ArrayList<act>();
			for (int j = 0; j &lt;= 10; j++) {
				subsubAct = new Act();
				subsubAct.setName("Act ::" + Math.random());
				listSubSubAct.add(subsubAct);
			}
			subAct.setChildren(listSubSubAct);
			subAct.setName("Act ::" + Math.random());
			listSubAct.add(subAct);
		}
		
		this.setChildren(listSubAct);

	}
	
	
	public String toString(){
		return this.name;
	}

}


</act></act></act></act></act></act></act>


What am I doing wrong? I have been following the sample richfaces portlet project from liferay.
Thanks in advance.
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: rich:tree toggle ajax not working with liferay faces bridge

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
If you have kept the verbose logging found in the richfaces4-portlet in your custom portlet, then please let me know if you see something like the following in the servler log when toggleType="ajax" is specified:

BridgePhaseRenderImpl [DEBUG] execute(RenderRequest, RenderResponse) portletName=[xyz] portletMode=[view]


If you see a RenderRequest happening, then that might explain why the entire portal page HTML is coming back.
thumbnail
Supratim Bandyopadhyaya, modificado 11 Anos atrás.

RE: rich:tree toggle ajax not working with liferay faces bridge

New Member Postagens: 10 Data de Entrada: 07/06/12 Postagens Recentes
Hi,
thanks for the reply.
Yes, I am getting that in the log.


19:28:34,236 DEBUG [BridgePhaseRenderImpl:73] execute(RenderRequest, RenderResponse) portletName=[testjsfportlet] portletMode=[view]


Here is the log I get when ajax is fired.


19:28:34,234 DEBUG [BridgePhaseRenderImpl:39] ----------------------------------------------------------------------
19:28:34,236 DEBUG [BridgePhaseRenderImpl:73] execute(RenderRequest, RenderResponse) portletName=[testjsfportlet] portletMode=[view]
19:28:34,237 DEBUG [BridgeRequestScopeManagerImpl:235] No value found for render parameter name=[testjsfportletcom.liferay.faces.bridge.bridgeRequestScopeId]
19:28:34,240 DEBUG [BridgeRequestScopeManagerImpl:253] Caching bridgeRequestScopeId=[testjsfportlet:::7DEA05B903F5DFC51CB31D1AC071F967:::1339097314239] bridgeRequestScope=[com.liferay.faces.bridge.scope.BridgeRequestScopeImpl@e6050b2]
19:28:34,242 DEBUG [PortletContainerLiferayImpl:115] Detected Liferay build number 6006
19:28:34,243 DEBUG [PortletContainerLiferayImpl:161] User-Agent requested URL=[http://localhost:8080/web/guest/cmc-portal]
19:28:34,246 DEBUG [RequestHeaderValuesMap:191] Adding acceptHeader=[Accept: text/html] to header map
19:28:34,248 DEBUG [RequestHeaderMap:45] Adding javax.portlet.markup.head.element.support=[L[true]] to header map
19:28:34,250 DEBUG [RequestHeaderMap:45] Adding accept=[L[Accept: text/html]] to header map
19:28:34,252 DEBUG [BridgePhaseRenderImpl:200] portletName=[testjsfportlet] facesLifecycleAlreadyExecuted=[false]
19:28:34,254 DEBUG [BridgeContextImpl:758] portlet.xml viewId=[/views/portletViewMode.xhtml] portletMode=[view]
19:28:34,255 DEBUG [FacesViewImpl:90] Attempting to determine if viewId=[/views/portletViewMode.xhtml] is extension-mapped to urlPattern=[*.xhtml]
19:28:34,257 DEBUG [ServletMappingImpl:100] Testing match for servlet-mapping url-pattern=[*.xhtml] EXTENSION=[.xhtml] uri=[/views/portletViewMode.xhtml] match=[true]
19:28:34,259 DEBUG [BridgePhaseRenderImpl:209] Executing Faces lifecycle for viewId=[/views/portletViewMode.xhtml]
19:28:34,261 DEBUG [BridgeDebugPhaseListener:64] BEFORE phaseId=[RESTORE_VIEW 1] viewId=[null]
19:28:34,262 DEBUG [BridgeContextImpl:1034] requestPathInfo=[null] EXTENSION=[.xhtml] viewId=[/views/portletViewMode.xhtml]
19:28:34,264 DEBUG [BridgeContextImpl:1081] requestServletPath=[/views/portletViewMode.xhtml] extensionMapped=[.xhtml] viewId=[/views/portletViewMode.xhtml]
19:28:34,266 DEBUG [ViewHandlerImpl:54] Creating view for viewId=[/views/portletViewMode.xhtml]
19:28:34,269 DEBUG [BridgeDebugPhaseListener:48] AFTER phaseId=[RESTORE_VIEW 1] viewId=[/views/portletViewMode.xhtml]
19:28:34,271 DEBUG [BridgeNavigationHandlerImpl:128] fromPortletMode=[null] toPortletMode=[view]
19:28:34,272 DEBUG [LifecycleIncongruityManager:88] congruousTaskList.size()=[0]
19:28:34,274 DEBUG [BridgePhaseRenderImpl:39] Executing Faces render
19:28:34,276 DEBUG [BridgeDebugPhaseListener:64] BEFORE phaseId=[RENDER_RESPONSE 6] viewId=[/views/portletViewMode.xhtml]
19:28:34,284 DEBUG [BridgeContextImpl:299] encodeResourceURL fromURL=[/testjsfportlet-portlet/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.0.Final/Packed/DEFAULT/skinning.css]
19:28:34,286 DEBUG [PortletContainerImpl:39] createResourceURL fromURL=[/testjsfportlet-portlet/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.0.Final/Packed/DEFAULT/skinning.css]
19:28:34,289 DEBUG [PortletContainerImpl:229] Added parameter to portletURL name=[javax.faces.resource] value=[org.richfaces.staticResource/4.2.0.Final/Packed/DEFAULT/skinning.css]
19:28:34,291 DEBUG [LiferayBaseURL:245] Appended param to URL name=[_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_javax.faces.resource] parameterValue=[org.richfaces.staticResource%2F4.2.0.Final%2FPacked%2FDEFAULT%2Fskinning.css]
19:28:34,293 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_col_count] parameterValue=[2]
19:28:34,295 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_col_id] parameterValue=[column-1]
19:28:34,297 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_id] parameterValue=[testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF]
19:28:34,299 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_lifecycle] parameterValue=[2]
19:28:34,301 DEBUG [HeadResponseWriterLiferayImpl:39] Added resource to Liferay's ... section element=[<link rel="stylesheet" type="text/css" href="http://localhost:8080/web/guest/cmc-portal?_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_javax.faces.resource=org.richfaces.staticResource%2F4.2.0.Final%2FPacked%2FDEFAULT%2Fskinning.css&amp;p_p_col_count=2&amp;p_p_col_id=column-1&amp;p_p_id=testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF&amp;p_p_lifecycle=2">]
19:28:34,303 DEBUG [BridgeContextImpl:299] encodeResourceURL fromURL=[/testjsfportlet-portlet/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.0.Final/Packed/DEFAULT/packed/packed.css]
19:28:34,305 DEBUG [PortletContainerImpl:39] createResourceURL fromURL=[/testjsfportlet-portlet/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.0.Final/Packed/DEFAULT/packed/packed.css]
19:28:34,307 DEBUG [PortletContainerImpl:229] Added parameter to portletURL name=[javax.faces.resource] value=[org.richfaces.staticResource/4.2.0.Final/Packed/DEFAULT/packed/packed.css]
19:28:34,309 DEBUG [LiferayBaseURL:245] Appended param to URL name=[_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_javax.faces.resource] parameterValue=[org.richfaces.staticResource%2F4.2.0.Final%2FPacked%2FDEFAULT%2Fpacked%2Fpacked.css]
19:28:34,311 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_col_count] parameterValue=[2]
19:28:34,315 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_col_id] parameterValue=[column-1]
19:28:34,323 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_id] parameterValue=[testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF]
19:28:34,325 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_lifecycle] parameterValue=[2]
19:28:34,327 DEBUG [HeadResponseWriterLiferayImpl:39] Added resource to Liferay's ... section element=[<link rel="stylesheet" type="text/css" href="http://localhost:8080/web/guest/cmc-portal?_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_javax.faces.resource=org.richfaces.staticResource%2F4.2.0.Final%2FPacked%2FDEFAULT%2Fpacked%2Fpacked.css&amp;p_p_col_count=2&amp;p_p_col_id=column-1&amp;p_p_id=testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF&amp;p_p_lifecycle=2">]
19:28:34,330 DEBUG [ResourceImpl:310] Removed extension=[.xhtml] from requestPath=[/testjsfportlet-portlet/javax.faces.resource/jsf.js?ln=javax.faces&amp;stage=Development]
19:28:34,335 DEBUG [BridgeContextImpl:299] encodeResourceURL fromURL=[/testjsfportlet-portlet/javax.faces.resource/jsf.js?ln=javax.faces&amp;stage=Development]
19:28:34,337 DEBUG [PortletContainerImpl:39] createResourceURL fromURL=[/testjsfportlet-portlet/javax.faces.resource/jsf.js?ln=javax.faces&amp;stage=Development]
19:28:34,346 DEBUG [PortletContainerImpl:229] Added parameter to portletURL name=[javax.faces.resource] value=[jsf.js]
19:28:34,347 DEBUG [PortletContainerImpl:311] Copied parameter to portletURL name=[ln] value=[javax.faces]
19:28:34,349 DEBUG [PortletContainerImpl:311] Copied parameter to portletURL name=[stage] value=[Development]
19:28:34,354 DEBUG [LiferayBaseURL:245] Appended param to URL name=[_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_ln] parameterValue=[javax.faces]
19:28:34,356 DEBUG [LiferayBaseURL:245] Appended param to URL name=[_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_stage] parameterValue=[Development]
19:28:34,363 DEBUG [LiferayBaseURL:245] Appended param to URL name=[_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_javax.faces.resource] parameterValue=[jsf.js]
19:28:34,365 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_col_count] parameterValue=[2]
19:28:34,367 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_col_id] parameterValue=[column-1]
19:28:34,369 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_id] parameterValue=[testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF]
19:28:34,371 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_lifecycle] parameterValue=[2]
19:28:34,374 DEBUG [BridgeContextImpl:299] encodeResourceURL fromURL=[http://localhost:8080/web/guest/cmc-portal?_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_ln=javax.faces&amp;_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_stage=Development&amp;_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_javax.faces.resource=jsf.js&amp;p_p_col_count=2&amp;p_p_col_id=column-1&amp;p_p_id=testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF&amp;p_p_lifecycle=2]
19:28:34,376 DEBUG [HeadResponseWriterLiferayImpl:39] Added resource to Liferay's ... section element=[<script src="http://localhost:8080/web/guest/cmc-portal?_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_ln=javax.faces&amp;_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_stage=Development&amp;_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_javax.faces.resource=jsf.js&amp;p_p_col_count=2&amp;p_p_col_id=column-1&amp;p_p_id=testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF&amp;p_p_lifecycle=2" type="text/javascript"></script>]
19:28:34,379 DEBUG [BridgeContextImpl:299] encodeResourceURL fromURL=[/testjsfportlet-portlet/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.0.Final/Packed/jquery.js]
19:28:34,381 DEBUG [PortletContainerImpl:39] createResourceURL fromURL=[/testjsfportlet-portlet/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.0.Final/Packed/jquery.js]
19:28:34,382 DEBUG [PortletContainerImpl:229] Added parameter to portletURL name=[javax.faces.resource] value=[org.richfaces.staticResource/4.2.0.Final/Packed/jquery.js]
19:28:34,384 DEBUG [LiferayBaseURL:245] Appended param to URL name=[_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_javax.faces.resource] parameterValue=[org.richfaces.staticResource%2F4.2.0.Final%2FPacked%2Fjquery.js]
19:28:34,386 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_col_count] parameterValue=[2]
19:28:34,389 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_col_id] parameterValue=[column-1]
19:28:34,392 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_id] parameterValue=[testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF]
19:28:34,394 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_lifecycle] parameterValue=[2]
19:28:34,396 DEBUG [HeadResponseWriterLiferayImpl:39] Added resource to Liferay's ... section element=[<script src="http://localhost:8080/web/guest/cmc-portal?_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_javax.faces.resource=org.richfaces.staticResource%2F4.2.0.Final%2FPacked%2Fjquery.js&amp;p_p_col_count=2&amp;p_p_col_id=column-1&amp;p_p_id=testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF&amp;p_p_lifecycle=2" type="text/javascript"></script>]
19:28:34,399 DEBUG [BridgeContextImpl:299] encodeResourceURL fromURL=[/testjsfportlet-portlet/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.0.Final/Packed/packed/packed.js]
19:28:34,401 DEBUG [PortletContainerImpl:39] createResourceURL fromURL=[/testjsfportlet-portlet/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.0.Final/Packed/packed/packed.js]
19:28:34,402 DEBUG [PortletContainerImpl:229] Added parameter to portletURL name=[javax.faces.resource] value=[org.richfaces.staticResource/4.2.0.Final/Packed/packed/packed.js]
19:28:34,404 DEBUG [LiferayBaseURL:245] Appended param to URL name=[_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_javax.faces.resource] parameterValue=[org.richfaces.staticResource%2F4.2.0.Final%2FPacked%2Fpacked%2Fpacked.js]
19:28:34,406 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_col_count] parameterValue=[2]
19:28:34,408 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_col_id] parameterValue=[column-1]
19:28:34,410 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_id] parameterValue=[testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF]
19:28:34,411 DEBUG [LiferayBaseURL:245] Appended param to URL name=[p_p_lifecycle] parameterValue=[2]
19:28:34,413 DEBUG [HeadResponseWriterLiferayImpl:39] Added resource to Liferay's ... section element=[<script src="http://localhost:8080/web/guest/cmc-portal?_testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF_javax.faces.resource=org.richfaces.staticResource%2F4.2.0.Final%2FPacked%2Fpacked%2Fpacked.js&amp;p_p_col_count=2&amp;p_p_col_id=column-1&amp;p_p_id=testjsfportlet_WAR_testjsfportletportlet_INSTANCE_4iqF&amp;p_p_lifecycle=2" type="text/javascript"></script>]
19:28:34,433 DEBUG [BridgeDebugPhaseListener:48] AFTER phaseId=[RENDER_RESPONSE 6] viewId=[/views/portletViewMode.xhtml]
19:28:34,435 DEBUG [BridgePhaseRenderImpl:39] ----------------------------------------------------------------------

thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: rich:tree toggle ajax not working with liferay faces bridge (Resposta)

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
Thanks for getting back to me. Similar to RF-12263, I think this is another JavaScript bug in RichFaces.

I just opened RF-12315 as a new issue in order to track this problem. I'll contact the folks at JBoss and bring it to their attention.