You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Boris Horvat <ho...@gmail.com> on 2013/11/11 17:35:10 UTC

Tapestry 5.4 and JQuery integration

(this is part of he different thread but since the title is no misleading I
am posting here)

I am using tapestry 5.4 and tapestry5-jquery 4.0.0 to try to see how will
my site behave. While I managed to run everything, the page displays
javascript erros

Loading 1 libraries
console.js:44<http://localhost:8080/assets/aebaee6630c17174/modules/t5/core/console.js>
 Loading library /assets/aebaee6630c17174/ctx/blackbox/scripts/login.js
console.js:44<http://localhost:8080/assets/aebaee6630c17174/modules/t5/core/console.js>

   1. Uncaught TypeError: Property '$' of object [object Object] is not a
   function login.js:5<http://localhost:8080/assets/aebaee6630c17174/ctx/blackbox/scripts/login.js>

Executing 6 inits
console.js:44<http://localhost:8080/assets/aebaee6630c17174/modules/t5/core/console.js>
 Invoking t5/core/pageinit:evalJavaScript("$('#slider').bind('slide',
function(event, ui) {$('#sliderValue').text(ui.value);});")
console.js:44<http://localhost:8080/assets/aebaee6630c17174/modules/t5/core/console.js>
 Evaluating: $('#slider').bind('slide', function(event, ui)
{$('#sliderValue').text(ui.value);});
console.js:44<http://localhost:8080/assets/aebaee6630c17174/modules/t5/core/console.js>

   1. Uncaught TypeError: undefined is not a function

Invoking t5/core/pageinit:evalJavaScript("$('#slider').bind('slide',
function(event, ui) {$('#sliderValue').text(ui.value);});")
console.js:44<http://localhost:8080/assets/aebaee6630c17174/modules/t5/core/console.js>
 Evaluating: $('#slider').bind('slide', function(event, ui)
{$('#sliderValue').text(ui.value);});
console.js:44<http://localhost:8080/assets/aebaee6630c17174/modules/t5/core/console.js>

   1. Uncaught TypeError: undefined is not a function

Invoking t5/core/pageinit:focus("textfield")
console.js:44<http://localhost:8080/assets/aebaee6630c17174/modules/t5/core/console.js>
 Loaded module t5/core/forms
console.js:44<http://localhost:8080/assets/aebaee6630c17174/modules/t5/core/console.js>
 Loaded module t5/core/zone
console.js:44<http://localhost:8080/assets/aebaee6630c17174/modules/t5/core/console.js>
 Loaded module t5/core/validation

I got the feeling that jquery is no loaded, but I dont see how can that be
the case, given that in my page I see

requirejs.config({
  "baseUrl" : "/assets/aebaee6630c17174/modules",
  "shim" : {
    "bootstrap" : [
      "jquery"
    ],
    "_" : {
      "exports" : "_"
    }
  },
  "waitSeconds" : 300
});
require(["t5/core/pageinit"], function(pi) { pi([
  "/assets/aebaee6630c17174/ctx/blackbox/scripts/login.js"
], [
  [
    "t5/core/pageinit:evalJavaScript",
    "$('#slider').bind('slide', function(event, ui)
{$('#sliderValue').text(ui.value);});"
  ],
  [
    "t5/core/pageinit:evalJavaScript",
    "$('#slider').bind('slide', function(event, ui)
{$('#sliderValue').text(ui.value);});"
  ],
  "t5/core/zone",
  "t5/core/validation",
  "t5/core/forms",
  [
    "t5/core/pageinit:focus",
    "textfield"
  ]
]); });

Any idea is welcome :)

Cheers

-- 
Sincerely
*Boris Horvat*

Re: Tapestry 5.4 and JQuery integration

Posted by Boris Horvat <ho...@gmail.com>.
No but there is a snapshot version that is being developed for the T5.4. By
JQueryModule configuration I was referring that that is the place where the
symbol for tapestry is probably set.
Interesting is that now since the new alpha has been pushed my error has
changed.

Previously if I where to replace $ with jquery I could get it to work, but
now it complains that it is not aware of the jquery :)

Anyway I guess since you dont think this is related to tapestry it self
then I will wait for Many to get back from vacation and talk with him about
this :)

cheers


On Mon, Nov 11, 2013 at 7:35 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Mon, 11 Nov 2013 14:54:31 -0200, Boris Horvat <ho...@gmail.com>
> wrote:
>
>  Hi,
>>
>
> Hi!
>
>
>> Yea I have already tried to add that before. However I got the following
>> exception
>>
>> java.lang.IllegalArgumentException: Service contribution (to service
>> 'ApplicationDefaults') conflicts with existing contribution (by
>> org.got5.tapestry5.jquery.services.JQueryModule.
>> contributeApplicationDefault(MappedConfiguration)
>> (at JQueryModule.java:110)).
>>
>> So I guess JQueryModule already does all the necessary configuration.
>>
>
> Nope. That symbol only works for Tapestry itself. Tapestry5-jQuery, as far
> as I know, isn't prepared to work with T5.4.
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Sincerely
*Boris Horvat*

Re: Tapestry 5.4 and JQuery integration

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 11 Nov 2013 14:54:31 -0200, Boris Horvat  
<ho...@gmail.com> wrote:

> Hi,

Hi!

>
> Yea I have already tried to add that before. However I got the following
> exception
>
> java.lang.IllegalArgumentException: Service contribution (to service
> 'ApplicationDefaults') conflicts with existing contribution (by
> org.got5.tapestry5.jquery.services.JQueryModule.contributeApplicationDefault(MappedConfiguration)
> (at JQueryModule.java:110)).
>
> So I guess JQueryModule already does all the necessary configuration.

Nope. That symbol only works for Tapestry itself. Tapestry5-jQuery, as far  
as I know, isn't prepared to work with T5.4.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5.4 and JQuery integration

Posted by Boris Horvat <ho...@gmail.com>.
I guess it is possible that I have some more transitive dependencies from
the old tapestry5-jquery or even old tapestr 5.3.7 :(


On Mon, Nov 11, 2013 at 5:54 PM, Boris Horvat <ho...@gmail.com>wrote:

> Hi,
>
> Yea I have already tried to add that before. However I got the following
> exception
>
> java.lang.IllegalArgumentException: Service contribution (to service
> 'ApplicationDefaults') conflicts with existing contribution (by
> org.got5.tapestry5.jquery.services.JQueryModule.contributeApplicationDefault(MappedConfiguration)
> (at JQueryModule.java:110)).
>
> So I guess JQueryModule already does all the necessary configuration. I
> will try to exclude tapestr5-jquery to see what happens then but I guess
> that I will needed it eventually since I am using some of their stuff :)
>
> Anyway thanks for the suggestions I already wrote to them but wanted to
> see if there is any suggestions here as well since I am confused that it
> appears that jquery is not loaded so I thought that it might be related to
> tapestry itself
>
> Cheers
>
>
> On Mon, Nov 11, 2013 at 5:49 PM, Thiago H de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
>> If you just want to use Tapestry 5.4 with jQuery insteadd of Prototype,
>> just add this to your AppModule:
>>
>> public static void
>> contributeApplicationDefaults(MappedConfiguration<String, String>
>> configuration) {
>>         configuration.add(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER,
>> "jquery");
>> }
>>
>> You don't need Tapestry5-JQuery for that. You'll only need that if you
>> want to use the Tapestry5-JQuery components and mixins that make it easy to
>> use jQuery UI widgets. In this case, you need to ask that package
>> maintainers about the status of its T5.4 compatibility.
>>
>> Tapestry5-JQuery has two parts: one is to replace the Tapestry JavaScript
>> code so it uses jQuery. In T5.4, that part is not needed anymore. The other
>> part remains quite useful.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Tapestry, Java and Hibernate consultant and developer
>> http://machina.com.br
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> --
> Sincerely
> *Boris Horvat*
>



-- 
Sincerely
*Boris Horvat*

Re: Tapestry 5.4 and JQuery integration

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 11 Nov 2013 14:54:31 -0200, Boris Horvat  
<ho...@gmail.com> wrote:

> Hi,

Hi!

> Yea I have already tried to add that before. However I got the following
> exception
>
> java.lang.IllegalArgumentException: Service contribution (to service
> 'ApplicationDefaults') conflicts with existing contribution (by
> org.got5.tapestry5.jquery.services.JQueryModule.contributeApplicationDefault(MappedConfiguration)
> (at JQueryModule.java:110)).

That only works for Tapestry itself, not Tapestry5-jQuery.

> So I guess JQueryModule already does all the necessary configuration. I
> will try to exclude tapestr5-jquery to see what happens then but I guess
> that I will needed it eventually since I am using some of their stuff :)
>
> Anyway thanks for the suggestions I already wrote to them but wanted to  
> see
> if there is any suggestions here as well since I am confused that it
> appears that jquery is not loaded so I thought that it might be related  
> to
> tapestry itself
>
> Cheers
>
>
> On Mon, Nov 11, 2013 at 5:49 PM, Thiago H de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
>> If you just want to use Tapestry 5.4 with jQuery insteadd of Prototype,
>> just add this to your AppModule:
>>
>> public static void
>> contributeApplicationDefaults(MappedConfiguration<String, String>
>> configuration) {
>>         configuration.add(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER,
>> "jquery");
>> }
>>
>> You don't need Tapestry5-JQuery for that. You'll only need that if you
>> want to use the Tapestry5-JQuery components and mixins that make it  
>> easy to
>> use jQuery UI widgets. In this case, you need to ask that package
>> maintainers about the status of its T5.4 compatibility.
>>
>> Tapestry5-JQuery has two parts: one is to replace the Tapestry  
>> JavaScript
>> code so it uses jQuery. In T5.4, that part is not needed anymore. The  
>> other
>> part remains quite useful.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Tapestry, Java and Hibernate consultant and developer
>> http://machina.com.br
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>


-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5.4 and JQuery integration

Posted by Boris Horvat <ho...@gmail.com>.
Hi,

Yea I have already tried to add that before. However I got the following
exception

java.lang.IllegalArgumentException: Service contribution (to service
'ApplicationDefaults') conflicts with existing contribution (by
org.got5.tapestry5.jquery.services.JQueryModule.contributeApplicationDefault(MappedConfiguration)
(at JQueryModule.java:110)).

So I guess JQueryModule already does all the necessary configuration. I
will try to exclude tapestr5-jquery to see what happens then but I guess
that I will needed it eventually since I am using some of their stuff :)

Anyway thanks for the suggestions I already wrote to them but wanted to see
if there is any suggestions here as well since I am confused that it
appears that jquery is not loaded so I thought that it might be related to
tapestry itself

Cheers


On Mon, Nov 11, 2013 at 5:49 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> If you just want to use Tapestry 5.4 with jQuery insteadd of Prototype,
> just add this to your AppModule:
>
> public static void
> contributeApplicationDefaults(MappedConfiguration<String, String>
> configuration) {
>         configuration.add(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER,
> "jquery");
> }
>
> You don't need Tapestry5-JQuery for that. You'll only need that if you
> want to use the Tapestry5-JQuery components and mixins that make it easy to
> use jQuery UI widgets. In this case, you need to ask that package
> maintainers about the status of its T5.4 compatibility.
>
> Tapestry5-JQuery has two parts: one is to replace the Tapestry JavaScript
> code so it uses jQuery. In T5.4, that part is not needed anymore. The other
> part remains quite useful.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Sincerely
*Boris Horvat*

Re: Tapestry 5.4 and JQuery integration

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
If you just want to use Tapestry 5.4 with jQuery insteadd of Prototype,  
just add this to your AppModule:

public static void
contributeApplicationDefaults(MappedConfiguration<String, String>
configuration) {
         configuration.add(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER,  
"jquery");
}

You don't need Tapestry5-JQuery for that. You'll only need that if you  
want to use the Tapestry5-JQuery components and mixins that make it easy  
to use jQuery UI widgets. In this case, you need to ask that package  
maintainers about the status of its T5.4 compatibility.

Tapestry5-JQuery has two parts: one is to replace the Tapestry JavaScript  
code so it uses jQuery. In T5.4, that part is not needed anymore. The  
other part remains quite useful.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org