Foren

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

akhil sivapurapu, geändert vor 10 Jahren.

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

New Member Beiträge: 4 Beitrittsdatum: 10.03.14 Neueste Beiträge
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, geändert vor 10 Jahren.

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

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
Try adding ?p_p_parallel=0 on your portal page URL and see if it works.
thumbnail
Neil Griffin, geändert vor 10 Jahren.

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

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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, geändert vor 10 Jahren.

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

New Member Beiträge: 4 Beitrittsdatum: 10.03.14 Neueste Beiträge
Hi Neil,

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

Thanks,
Akhil
akhil sivapurapu, geändert vor 10 Jahren.

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

New Member Beiträge: 4 Beitrittsdatum: 10.03.14 Neueste Beiträge
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, geändert vor 10 Jahren.

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

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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, geändert vor 10 Jahren.

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

New Member Beiträge: 4 Beitrittsdatum: 10.03.14 Neueste Beiträge
yes, we have both h:body and h:head in the view. These portlets are not added dynamically.
Sasipriya Sakamuri, geändert vor 10 Jahren.

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

Junior Member Beiträge: 31 Beitrittsdatum: 14.11.13 Neueste Beiträge
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, geändert vor 10 Jahren.

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

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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, geändert vor 10 Jahren.

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

Junior Member Beiträge: 31 Beitrittsdatum: 14.11.13 Neueste Beiträge
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, geändert vor 10 Jahren.

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

Junior Member Beiträge: 31 Beitrittsdatum: 14.11.13 Neueste Beiträge
hi,

I did apply sp2, it did not help.

Thanks,
Sasipriya
thumbnail
Neil Griffin, geändert vor 10 Jahren.

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

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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, geändert vor 10 Jahren.

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

Junior Member Beiträge: 31 Beitrittsdatum: 14.11.13 Neueste Beiträge
I already did that, they told me I had better chances of getting my question answered here.. emoticon
thumbnail
Neil Griffin, geändert vor 10 Jahren.

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

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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, geändert vor 10 Jahren.

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

Junior Member Beiträge: 31 Beitrittsdatum: 14.11.13 Neueste Beiträge
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, geändert vor 10 Jahren.

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

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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, geändert vor 10 Jahren.

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

Junior Member Beiträge: 31 Beitrittsdatum: 14.11.13 Neueste Beiträge
well, seems like it.. thanks for the clarification.
Robert Starzer, geändert vor 9 Jahren.

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

New Member Beiträge: 2 Beitrittsdatum: 13.04.12 Neueste Beiträge
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, geändert vor 9 Jahren.

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

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
Hi Robert,

You are right! emoticon

Fixed in FACES-1976.

Thanks so much,

Neil
Robert Starzer, geändert vor 9 Jahren.

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

New Member Beiträge: 2 Beitrittsdatum: 13.04.12 Neueste Beiträge
Hi,

Could you provide any update on this issue?

Thx
Robert