JavaScript error with M04, Liferay, multiple portlets

UI Components for JSF
Post Reply
bobd
Posts: 6
Joined: 23 Oct 2011, 21:18

28 Nov 2011, 03:43

Greetings,
Hopefully I haven't missed someone else reporting this issue, but I get the following JavaScript error:

Code: Select all

Error: $("script[src*=\"/javax.faces.resource/primefaces.js\"]").attr("src") is undefined
Source File: https://www.mysite.com/user/bob/test?_PORTLET_something_INSTANCE_zJ0p_javax.faces.resource=primefaces.js&_PORTLET_something_INSTANCE_zJ0p_ln=primefaces&p_p_cacheability=cacheLevelPage&p_p_col_count=3&p_p_col_id=column-2&p_p_col_pos=2&p_p_id=PORTLET_something_INSTANCE_zJ0p&p_p_lifecycle=2&p_p_mode=view&p_p_state=normal&v=3.0.M4
Line: 1
The error occurs under FireFox 8.0 and earlier, and apparently in IE, Chrome, and Safari since the <p:editor> field is not displayed.

What's also strange is the behavior changes depending on whether the portlet has other PrimeFaces portlets before or after it on the page (these other portlets do not have <p:editor>). If the portlet with <p:editor> is last, the editor box is displayed. If the portlet without <p:editor> appears after the <p:editor> portlet, the JavaScript error occurs and the editor box is not displayed.

Here is the code for the <p:editor> portlet (cut down, including leaving out the Facelets code):

Code: Select all

      	<h:form id="inviteForm">
		<f:loadBundle basename="content.labels" var="labels"/>
			<h:outputStylesheet library="css" name="portlet-override.css" />
			<h:outputStylesheet library="css" name="invite-fields.css" />
          
					<h:messages globalOnly="true" showDetail="true" showSummary="false" layout="table" />
					<h:panelGroup  >
						<h:panelGroup styleClass="tabHeading" >
							<h:outputText value="Testing." />
						</h:panelGroup>
						<div class="row" >
							<h:panelGroup styleClass="label">
								<h:outputLabel for="firstName" value="#{labels['firstName']}" styleClass="required" />
							</h:panelGroup>
							<h:panelGroup styleClass="field">
								<p:inputText id="firstName" alt="#{labels['firstName']}" value="#{bean.firstName}" binding="#{bean.UIFirstName}" />
								<h:message for="firstName" />
							</h:panelGroup>
						</div>
						<div class="row" >
							<h:panelGroup styleClass="label">
								<h:outputLabel for="message" value="#{labels['message']}" />
							</h:panelGroup>
							<h:panelGroup styleClass="field">
								<p:editor id="message" widgetVar="editor" styleClass="messageField" style="width:98%" required="false" rows="3" value="#{bean.message}" />
								<h:message for="message" />
							</h:panelGroup>
						</div>
						<div class="button-group">
							<h:commandButton action="#{bean.doSend}" alt="#{labels['send']}" value="#{labels['send']}" />
						</div>
					</h:panelGroup>
		</h:form>
Any suggestions or workarounds? Thanks.
-----------------------------
PrimeFaces 3.4
Mojarra 2.1.7
Tomcat 7.0.23
Liferay 6.1

ngriffin7a
Posts: 6
Joined: 13 Feb 2012, 19:48

10 May 2012, 23:29

Please refer to FACES-1216 for more information.

jacksmith
Posts: 2
Joined: 04 Jul 2013, 05:25

04 Jul 2013, 05:36

You solve error by using the following steps:
1)From the browser menu bar
2)Select Tools > Options
3)Click Web Features
4)Select the Enable JavaScript checkbox
5)Click OK

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests