You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by bogdan_cm <bo...@rbccm.com> on 2011/10/20 04:01:31 UTC

Importing a JQuery library stops Zones from responding to events from EventLink

Hi all, 
   I have a page in which I declare a zone:
	@InjectComponent
	private Zone tokenDetailsZone;	

an EventLink for updating the zone:
@Component(parameters = "event=updateContent","zone=tokenDetailsZone" })
     private EventLink updateContent;

and the event handler method:
  Object onUpdateContent(Integer packageId) {		     
             // perform logic
		return tokenDetailsZone.getBody();
	}

The TML has all the necessary content for the zone to be displayed. 

All this works fine. 

However, when I add a javaScript library to the page like so: 
 @Import(library={"context:js/jquery.min.js","context:js/fancyzoom.min.js"})
public class PageClass
{
... 
}

It stops working. By "stops working" I mean the EventLink in the template
get's displayed, but when I click it the Event Handler method
"onUpdateContent" no longer get's invoked. 

I have tried adding the javaScript library not by @Import but by using
"JavaScriptSupport", still the same problem. 

Anything I'm missing here? Why importing an additional JS library interferes
with the zone's update?

Thanks very much, 
Bogdan. 






--
View this message in context: http://tapestry.1045711.n5.nabble.com/Importing-a-JQuery-library-stops-Zones-from-responding-to-events-from-EventLink-tp4920064p4920064.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Importing a JQuery library stops Zones from responding to events from EventLink

Posted by bogdan_cm <bo...@rbccm.com>.
Thanks very much for the reply. I'll give it a try :). 

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Importing-a-JQuery-library-stops-Zones-from-responding-to-events-from-EventLink-tp4920064p4921664.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Importing a JQuery library stops Zones from responding to events from EventLink

Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
Hi 

jQuery and Prototype can only work together if jQuery is run in noConflict mode. 

http://wiki.apache.org/tapestry/Tapestry5HowToIntegrateJQuery

There is a great module for jQuery integration 

https://github.com/got5/tapestry5-jquery

Also you can check firebug to see what is really happening

regards
Taha

On Oct 20, 2011, at 7:31 AM, bogdan_cm wrote:

> Hi all, 
>   I have a page in which I declare a zone:
> 	@InjectComponent
> 	private Zone tokenDetailsZone;	
> 
> an EventLink for updating the zone:
> @Component(parameters = "event=updateContent","zone=tokenDetailsZone" })
>     private EventLink updateContent;
> 
> and the event handler method:
>  Object onUpdateContent(Integer packageId) {		     
>             // perform logic
> 		return tokenDetailsZone.getBody();
> 	}
> 
> The TML has all the necessary content for the zone to be displayed. 
> 
> All this works fine. 
> 
> However, when I add a javaScript library to the page like so: 
> @Import(library={"context:js/jquery.min.js","context:js/fancyzoom.min.js"})
> public class PageClass
> {
> ... 
> }
> 
> It stops working. By "stops working" I mean the EventLink in the template
> get's displayed, but when I click it the Event Handler method
> "onUpdateContent" no longer get's invoked. 
> 
> I have tried adding the javaScript library not by @Import but by using
> "JavaScriptSupport", still the same problem. 
> 
> Anything I'm missing here? Why importing an additional JS library interferes
> with the zone's update?
> 
> Thanks very much, 
> Bogdan. 
> 
> 
> 
> 
> 
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Importing-a-JQuery-library-stops-Zones-from-responding-to-events-from-EventLink-tp4920064p4920064.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>