Re: Invoking a custom show javascript method for a Zone

2009-03-04 Thread Dave Greggory

yeah I tried both show and update methods, didn't really work.

I finally got it to work by just adding the following to my event link.

onclick=editWindow.show('editWindow'); resizeWindow(500, 500);

So right after (or is it before) it calls the event method it also shows the 
Window. Not ideal and it could potentially, show the window before Ajax event 
could return the Zone content inside the window, but seems to work.

Tapestry certainly requires a lot of effort to get small things done.

Thanks Thiago for the Ajax.Responder recommendation, I'll look into it.





- Original Message 
From: Thiago H. de Paula Figueiredo thiag...@gmail.com
To: Tapestry users users@tapestry.apache.org
Sent: Tuesday, March 3, 2009 10:33:44 PM
Subject: Re: Invoking a custom show javascript method for a Zone

Em Wed, 04 Mar 2009 00:25:35 -0300, Fernando Padilla f...@alum.mit.edu 
escreveu:

 so you maybe you should set both?

Maybe we should file a JIRA for another parameter for Zone-supported 
components? One to specify a callback (or set of callbacks) to AJAX requests?

Have you guys tried Ajax.Responders.register(responder)? Documentation at 
http://www.prototypejs.org/api/ajax/. It is a way to provide some global 
callback functions to made through Ajax.Request, Ajax.Updater and 
Ajax.PeriodicalUpdater.

--Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


  


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



Invoking a custom show javascript method for a Zone

2009-03-03 Thread Dave Greggory

I'm having trouble invoking my own javascript method after a Zone is rendered 
from an event.

I have a Zone inside a ChenilleKit Window. And I have an event link that 
updates the Zone. That works fine, and clicking on a different link to display 
the Chenille Kit Window (containing the zone) also works. But I don't want to 
have to click on another link to show the window, so I'm trying to use the 
Zone's update attribute to invoke my own javascript to show the window.

script type=text/javascript language=JavaScript
   function showeditorzone()
   {
 editWindow.show('editWindow');
 resizeWindow(500, 500);
   }
 /script

  t:chenillekit.Window t:id=editWindow
 t:zone t:id=editorZone id=editorZone t:show=showeditorzone
 stuff
 /t:zone
  /t:chenillekit.Window

  t:eventlink t:event=editComponent t:context=editEventContext 
t:zone=editorZoneEdit/t:eventlink

But the showeditorzone method is not getting called after the editComponent 
successfully finishes. The zone gets updated, but the show method does not get 
called.


What am I missing?

Dave



  


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



Re: Invoking a custom show javascript method for a Zone

2009-03-03 Thread Igor Drobiazko
The show functon should be a function of the Tapestry JavaScrip object
Tapestry.ElementEffect.
You should extend this object by your 'showeditorzone' function, then it
will work fine.

On Tue, Mar 3, 2009 at 7:36 PM, Dave Greggory davegregg...@yahoo.comwrote:


 I'm having trouble invoking my own javascript method after a Zone is
 rendered from an event.

 I have a Zone inside a ChenilleKit Window. And I have an event link that
 updates the Zone. That works fine, and clicking on a different link to
 display the Chenille Kit Window (containing the zone) also works. But I
 don't want to have to click on another link to show the window, so I'm
 trying to use the Zone's update attribute to invoke my own javascript to
 show the window.

 script type=text/javascript language=JavaScript
   function showeditorzone()
   {
 editWindow.show('editWindow');
 resizeWindow(500, 500);
   }
  /script

  t:chenillekit.Window t:id=editWindow
 t:zone t:id=editorZone id=editorZone t:show=showeditorzone
 stuff
 /t:zone
  /t:chenillekit.Window

  t:eventlink t:event=editComponent t:context=editEventContext
 t:zone=editorZoneEdit/t:eventlink

 But the showeditorzone method is not getting called after the editComponent
 successfully finishes. The zone gets updated, but the show method does not
 get called.


 What am I missing?

 Dave






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




-- 
Best regards,

Igor Drobiazko


Re: Invoking a custom show javascript method for a Zone

2009-03-03 Thread Fernando Padilla
You might have already tried this, but, you know that there is a show 
operation and an update operation..


so you maybe you should set both?


Dave Greggory wrote:

Thanks for the suggestion, Igor. Unfortunately, it didn't work.

So I tried doing the following in AfterRender.

renderSupport.addScript(var Pirate = Class.create(Tapestry.ElementEffect, 
{ +
showeditorzone : 
function(element) { +
  alert('hey'); +
  
editWindow.show('editWindow'); +
  resizeWindow(500, 
500); +
  return new 
Effect.Highlight(element); +
} +
  }););

I also tried overriding the existing highlight and show methods in Tapestry.ElementEffect and leave t:zone's update and show parameters blank, but these methods just were not getting called. 



I wonder whether I should concentrate on adding some behavior to the event link 
instead.

t:eventlink t:event=editComponent t:context=editEventContext 
t:zone=editorZoneEdit/t:eventlink

Maybe I should add a script to event link's on click event so that in addition to invoking the 
editComponent event it also shows the Window. Would that interfere with the Zone from 
getting updated when the editComponent event returns?



  



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



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



Re: Invoking a custom show javascript method for a Zone

2009-03-03 Thread Thiago H. de Paula Figueiredo
Em Wed, 04 Mar 2009 00:25:35 -0300, Fernando Padilla f...@alum.mit.edu  
escreveu:



so you maybe you should set both?


Maybe we should file a JIRA for another parameter for Zone-supported  
components? One to specify a callback (or set of callbacks) to AJAX  
requests?


Have you guys tried Ajax.Responders.register(responder)? Documentation at  
http://www.prototypejs.org/api/ajax/. It is a way to provide some global  
callback functions to made through Ajax.Request, Ajax.Updater and  
Ajax.PeriodicalUpdater.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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