Foros de discusión

h:outputscript in not included in the page and ajax call not triggered.

akhil sivapurapu, modificado hace 10 años.

h:outputscript in not included in the page and ajax call not triggered.

New Member Mensajes: 4 Fecha de incorporación: 10/03/14 Mensajes recientes
Hi,

We have multiple portlets in a page and Javascript inside h:outputscript is not included in the page(view source) and the ajax calls we
fire from script are not getting fired.

Having a single porltet in the page works and the ajax calls are triggrered.

We are using liferay-portal-6.2.0, jboss 6.1 and jsf 2.1.17 and primefaces 3.5 jars.


Any help would be much appreciated.

Thanks,
Akhil
thumbnail
Neil Griffin, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Try adding ?p_p_parallel=0 on your portal page URL and see if it works.
thumbnail
Neil Griffin, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Also, please upgrade JBoss to Mojarra 2.1.21 in order to prevent memory leaks. For more info, see the Upgrading Mojarra in JBoss AS wiki page.
akhil sivapurapu, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

New Member Mensajes: 4 Fecha de incorporación: 10/03/14 Mensajes recientes
Hi Neil,

I tried adding ?p_p_parallel=0 but it didn't help us.

Thanks,
Akhil
akhil sivapurapu, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

New Member Mensajes: 4 Fecha de incorporación: 10/03/14 Mensajes recientes
We were initially using JSF 2.1.21 and the ajax calls were not getting triggered for page with single or multiple portlets - so we had to change the version to 2.1.17 and it worked for page with single portlet. But now we are facing problem when we add multiple portlets on the same page.

Could anyone please help us?


Thanks,
Akhil
thumbnail
Neil Griffin, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Do you have both h:head and h:body tags in your Facelet view?

Also, are these portlets added to the page manually (via Add Application) or are they added dynamically?
akhil sivapurapu, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

New Member Mensajes: 4 Fecha de incorporación: 10/03/14 Mensajes recientes
yes, we have both h:body and h:head in the view. These portlets are not added dynamically.
Sasipriya Sakamuri, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Junior Member Mensajes: 31 Fecha de incorporación: 14/11/13 Mensajes recientes
hi Neil,

I was able to reproduce this issue with just a simple war file, and two portlets added to the same page. The xhtml is very similar for both :


<h:head>
<h:outputscript target="head">
		
	    $(document).ready(function() {
	    	var clientId = '#{simpleFacesBean.clientId}';
	    	var link = "#" + clientId + "\\:simpleWidget\\:loadIQSummaryData";
	        $(link).click();
	    });

	   
	</h:outputscript>
</h:head>
<h:body>
	<div class="wlp-bighorn-window-content">
		<h:form id="simpleWidget">

			<p:datatable id="viewDataId" value="#{simpleFacesBean.list}" var="result" scrollable="true" sortby="#{result.serviceId}" sortorder="descending">
			   <p:column headertext="Service ID" width="100" sortby="#{result.serviceId}">
	              <h:outputtext value="#{result.serviceId}" />
			   </p:column>
			   <p:column headertext="Custom Name" width="140" sortby="#{result.serviceAliasName}">
			   		<h:outputtext value="#{result.serviceAliasName}" />
			   </p:column>
			   	<p:column headertext="Service Location" width="270" style="border-right:0px">
			   		<h:outputtext value="#{result.location}" />
			   	</p:column>
			  </p:datatable>
			  <p:blockui block="viewDataId" trigger="loadIQSummaryData">
			      <div class="loading_widgets">
	       	 		<p>Loading simple list..<abbr></abbr> </p>
	       	 	  </div>
	          	</p:blockui>
	          <div class="view_all_tkts">
			   	<h:outputlabel id="showValue" value="#{simpleFacesBean.clientId}" escape="false" />
			   </div>

  		 <p:commandlink value="click me" id="loadIQSummaryData" update="simpleWidget:viewDataId,simpleWidget:showValue" style="display:block" actionListener="#{simpleFacesBean.loadData}" />
		</h:form>
	</div>

</h:body>



and

<h:head>
<h:outputscript target="head">
		
	    $(document).ready(function() {
	    	var clientId = '#{simpleFacesBean2.clientId}';
	    	var link = "#" + clientId + "\\:simpleWidget2\\:loadIQSummaryData2";
	        $(link).click();
	    });

	  
	</h:outputscript>
</h:head>
<h:body>
	<div class="wlp-bighorn-window-content">
		<h:form id="simpleWidget2">

			<p:datatable id="viewDataId2" value="#{simpleFacesBean2.list}" var="result" scrollable="true" sortby="#{result.serviceId}" sortorder="descending">
			   <p:column headertext="Service ID" width="100" sortby="#{result.serviceId}">
	              <h:outputtext value="#{result.serviceId}" />
			   </p:column>
			   <p:column headertext="Custom Name" width="140" sortby="#{result.serviceAliasName}">
			   		<h:outputtext value="#{result.serviceAliasName}" />
			   </p:column>
			   	<p:column headertext="Service Location" width="270" style="border-right:0px">
			   		<h:outputtext value="#{result.location}" />
			   	</p:column>
			  </p:datatable>
			  <p:blockui block="viewDataId2" trigger="loadIQSummaryData2">
			      <div class="loading_widgets">
	       	 		<p>Loading simple list..<abbr></abbr> </p>
	       	 	  </div>
	          	</p:blockui>
	          <div class="view_all_tkts">
			   	<h:outputlabel id="showValue2" value="#{simpleFacesBean.clientId}" escape="false" />
			   </div>

  		 <p:commandlink value="click me" id="loadIQSummaryData2" update="simpleWidget2:viewDataId2,simpleWidget2:showValue2" style="display:block" actionListener="#{simpleFacesBean2.loadData}" />
		</h:form>
	</div>

</h:body>


With jsf 2.1.21, primefaces 3.5, liferay faces 3.2.4 and jboss eap 6.0.1 and liferay 6.2.
The code in the head section is not showing up when I do a view source.
I did try adding p_p_parallel to the url which did not help, neither did adding
layout.parallel.render.enable=false
to the portal-ext.property file.. Any ideas what I would need to do to get the portlets on the page to work together?
thumbnail
Neil Griffin, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
I was able to reproduce the problem with Liferay Portal 6.2.0-ce-ga1 on JBoss AS 7.1.1 but I was not able to reproduce it with Tomcat. That makes me think that it is a JBoss AS compatibility bug in the portal, and not in Liferay Faces Bridge.

When you get a chance, please try it with Liferay Portal 6.2.1-ce-ga2 on JBoss AS 7.1.1 -- there are many bugs fixed in this latest version of the portal, so I think it is worth a try.
Sasipriya Sakamuri, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Junior Member Mensajes: 31 Fecha de incorporación: 14/11/13 Mensajes recientes
hi Neil,

I did not find a ga2 (ee) for download - did you mean liferay SP2? That is the only thing I see in downloads
Sasipriya Sakamuri, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Junior Member Mensajes: 31 Fecha de incorporación: 14/11/13 Mensajes recientes
hi,

I did apply sp2, it did not help.

Thanks,
Sasipriya
thumbnail
Neil Griffin, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Hi Sasipriya,

When you wrote "liferay 6.2" I assumed that you were using the CE version of Liferay Portal. If you are using the EE version, then please open a ticket in LESA and reference this forum thread.

Thank you,

Neil
Sasipriya Sakamuri, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Junior Member Mensajes: 31 Fecha de incorporación: 14/11/13 Mensajes recientes
I already did that, they told me I had better chances of getting my question answered here.. emoticon
thumbnail
Neil Griffin, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Hi Sasipriya,

Liferay Support has reproduced the problem and will be coordinating with the Liferay Faces team in order to resolve the issue as quickly as possible.

Kind Regards,

Neil
Sasipriya Sakamuri, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Junior Member Mensajes: 31 Fecha de incorporación: 14/11/13 Mensajes recientes
what is the difference between using h:outputScript and script tag?

When we use the script tag , the javascript is loading.(Even though when there is a commented out line, and the word wrap is causing everything after that to get commented out, so we should not have any comments in the script section, as far as I can tell)

Thanks,
Sasipriya
thumbnail
Neil Griffin, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Hi Sasipriya,

When the Facelets templating engine encounters plain HTML tags like <script> it simply passes it through to the rendered response.

My best guess is using <script> would be the same thing as using <h:outputScript target="body" />

Perhaps that is a workaround for your use-case?

Kind Regards,

Neil
Sasipriya Sakamuri, modificado hace 10 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Junior Member Mensajes: 31 Fecha de incorporación: 14/11/13 Mensajes recientes
well, seems like it.. thanks for the clarification.
Robert Starzer, modificado hace 9 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

New Member Mensajes: 2 Fecha de incorporación: 13/04/12 Mensajes recientes
seems like a problem with the XMLReaderImpl which thinks the "XXXYYY" is part of an attribute name.

<h:head>
<h:outputScript target="head">XXXYYY</h:outputScript>
</h:head>

Thx
Robert
thumbnail
Neil Griffin, modificado hace 9 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Hi Robert,

You are right! emoticon

Fixed in FACES-1976.

Thanks so much,

Neil
Robert Starzer, modificado hace 9 años.

RE: h:outputscript in not included in the page and ajax call not triggered.

New Member Mensajes: 2 Fecha de incorporación: 13/04/12 Mensajes recientes
Hi,

Could you provide any update on this issue?

Thx
Robert