[gatein-issues] [JBoss JIRA] (GTNPORTAL-2943) Hyphens not allowed in Javascript Modules
Vu Viet Phuong (JIRA)
issues at jboss.org
Mon Dec 23 22:56:33 EST 2013
[ https://issues.jboss.org/browse/GTNPORTAL-2943?focusedWorklogId=12430430&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-12430430 ]
Vu Viet Phuong logged work on GTNPORTAL-2943:
---------------------------------------------
Author: Vu Viet Phuong
Created on: 23/Dec/13 10:54 PM
Start Date: 23/Dec/13 10:54 PM
Worklog Time Spent: 3 hours
Issue Time Tracking
-------------------
Remaining Estimate: 0 minutes (was: 3 hours)
Time Spent: 6 hours (was: 3 hours)
Worklog Id: (was: 12430430)
> Hyphens not allowed in Javascript Modules
> -----------------------------------------
>
> Key: GTNPORTAL-2943
> URL: https://issues.jboss.org/browse/GTNPORTAL-2943
> Project: GateIn Portal
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Affects Versions: 3.4.0.Final
> Environment: Windows 8, Gatein-3.4.0.Final-jboss-as7
> Reporter: Jason Farmer
> Assignee: Vu Viet Phuong
> Original Estimate: 6 hours
> Time Spent: 6 hours
> Remaining Estimate: 0 minutes
>
> Javascript Modules do not allow hyphens in name. No error messages or failures present until execution.
> Here is the culprit gatein-resources.xml:
> <module>
> <name>jquery-ui</name>
> <script>
> <adapter>
> (function() {
> <include>/javascript/jquery-ui-1.10.2.custom.min.js</include>
> return jQuery.noConflict(true);
> })();
> </adapter>
> </script>
> <depends>
> <module>jquery</module>
> <as>jQuery</as>
> </depends>
> </module>
> And using it within another Javascript included on the portlet that looked like this:
> define(["$", "jquery-ui"], function($) {
> alert("got here");
> $('#userPortlet-dialog-form').css( "border","3px solid red" );
> $('#userPortlet-dialog-form').dialog();
> alert("got here2");
> });
> The jquery selector to change the border worked, however when it reaches the .dialog() it fails saying: [16:42:54.534] TypeError: $(...).dialog is not a function @ http://localhost:8080/portal/scripts/3.5.2.Final-redhat-4/PORTLET/trackr-portlets:UserPortlet.js:9
> And fails execution. I tried many variations of fixing/changing remove, etc and I always saw the Javascript being included through Firefox developer tools, however it kept throwing this error. Finally after some trial and error, I found out that renaming my module to just "jqueryui" without the hyphen solved all of my issues.
> There was very little to work off of in the way of errors, everything loaded up correctly and even the regular Jquery executed without a problem.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the gatein-issues
mailing list