[gatein-issues] [JBoss JIRA] (GTNPORTAL-2297) GTN Bug: eXo Javascript is conflicting with some JQuery extensions
kien nguyen (Created) (JIRA)
jira-events at lists.jboss.org
Mon Nov 28 23:17:40 EST 2011
GTN Bug: eXo Javascript is conflicting with some JQuery extensions
------------------------------------------------------------------
Key: GTNPORTAL-2297
URL: https://issues.jboss.org/browse/GTNPORTAL-2297
Project: GateIn Portal
Issue Type: Bug
Security Level: Public (Everyone can see)
Reporter: kien nguyen
Priority: Minor
Fix For: 3.2.0-CR01
We test a Portlet that uses:
Jquery 1.5
Ligbox library http://www.balupton/projects/jquery-lightbox
We use the Portlet API to add the CSS and JS files to the HTML header
{code}
protected void doHeaders(RenderRequest request, RenderResponse response)
{
super.doHeaders(request, response);
Element cssFile = response.createElement("link");
cssFile.setAttribute("type", "text/css");
cssFile.setAttribute("href", request.getContextPath() + "/css/jquery/ui/smoothness/jquery-ui-1.8.9.custom.css");
cssFile.setAttribute("rel", "stylesheet");
response.addProperty("javax.portlet.markup.head.element", cssFile);
Element cssFile = response.createElement("link");
cssFile.setAttribute("type", "text/css");
cssFile.setAttribute("href", request.getContextPath() + "/css/jquery/balupton-lightbox/jquery.lightbox.min.css");
cssFile.setAttribute("rel", "stylesheet");
response.addProperty("javax.portlet.markup.head.element", cssFile);
}
{code}
When droping the portlet on a Platform Page or a GateIn page the Jquery effect is not working as expected : Nothing Happened
One of our Javascript is disturbing JQuery and the extension
The Work around is the following:
Modified the portal template "UIPortalApplication.gtmpl"
You can either:
= Move the "var currentContext = '<%=docBase%>' ;: line before the eXo.env.portal.context = "<%=docBase%>" ;
one (do not forget to remove the script tags)
= OR Move the
<%
def headerElements = rcontext.getExtraMarkupHeadersAsStrings();
if (headerElements != null)
{
for (element in headerElements)
{ %> <%=element%> <% }
}
%>
code before the eXo JS declarations
Note:
We need to cleanup our JS code to have less code, documented and sore in JS file not in the HTML code!*
I have attached the sampe portlet
(please refresh the page after droping the portlet on the page, since we have another bug related to adding portlet and do header - will create this bug later)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the gatein-issues
mailing list