[gatein-issues] [JBoss JIRA] (GTNPORTAL-2943) Hyphens not allowed in Javascript Modules

Trong Tran (JIRA) issues at jboss.org
Wed Dec 25 02:27:32 EST 2013


     [ https://issues.jboss.org/browse/GTNPORTAL-2943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trong Tran updated GTNPORTAL-2943:
----------------------------------

           Status: Resolved  (was: Pull Request Sent)
    Fix Version/s: 3.7.0.Final
       Resolution: Done

    
> 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: Trong Tran
>             Fix For: 3.7.0.Final
>
>   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