You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ashwanth Kumar <as...@gmail.com> on 2009/12/05 02:04:09 UTC

Help with ZoneUpdate

Hi,

I've a question. How do i invoke a custom JS from the Page, immediately
after a ZoneUpate!
For instance, i need to apply a markitUp on a TextArea, after it has been
created by the ZoneUpdate event in Tapestry.

How do i invoke it sync with the ZoneUpdate. Currently i use the onClick
event of the TextArea to show, but its not good enough. So, asny help
regarding this would be appreciated!

 - Ashwanth Kumar

Re: Help with ZoneUpdate

Posted by Daniel Jones <da...@murieston.com>.
this.myZone = $('myZoneID');

this.myZone.observe(Tapestry.ZONE_UPDATED_EVENT, this.doSomeFunction());

Cheers,
Daniel


joshcanfield wrote:
> 
>> The Zone raises a JS event when is updated.
> 
> You're right, my bad. I was looking at the form injector when I
> replied. It doesn't raise an event and so I used the show hack. I'm
> using ZONE_UPDATED_EVENT for my zones...
> 
> Josh
> 
> On Sat, Dec 5, 2009 at 1:35 AM, Juan E. Maya <ma...@gmail.com> wrote:
>> The Zone raises a JS event when is updated. This is explained in the
>> Zone documentation:
>>
>> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html
>>
>> "After the client-side content is updated, a client-side event is
>> fired on the zone's element. The constant Tapestry.ZONE_UPDATED_EVENT
>> can be used to listen to the event."
>>
>> You just need to provide a Prototype listener for that event in your
>> page.
>>
>> On Sat, Dec 5, 2009 at 7:04 AM, Ashwanth Kumar <as...@gmail.com>
>> wrote:
>>> Thanks Josh,
>>>
>>> That worked like a charm!! I dont know if there could be anything better
>>> than this?? :)
>>>
>>>  - Ashwanth Kumar
>>>
>>>
>>> On 12/5/09, Josh Canfield <jo...@thedailytube.com> wrote:
>>>>
>>>> Last time I was hunting around for a solution for this I came up with
>>>> this:
>>>>
>>>> Tapestry.ElementEffect.myshowfunc = function(element) {
>>>>    // do special stuff
>>>>    return new Effect.Highlight(element);
>>>> }
>>>>
>>>> <t:zone show="myshowfunc"/>
>>>>
>>>> There may be a better method that I'm not aware of though.
>>>>
>>>> Josh
>>>>
>>>> On Fri, Dec 4, 2009 at 5:04 PM, Ashwanth Kumar
>>>> <as...@gmail.com>
>>>> wrote:
>>>> > Hi,
>>>> >
>>>> > I've a question. How do i invoke a custom JS from the Page,
>>>> immediately
>>>> > after a ZoneUpate!
>>>> > For instance, i need to apply a markitUp on a TextArea, after it has
>>>> been
>>>> > created by the ZoneUpdate event in Tapestry.
>>>> >
>>>> > How do i invoke it sync with the ZoneUpdate. Currently i use the
>>>> onClick
>>>> > event of the TextArea to show, but its not good enough. So, asny help
>>>> > regarding this would be appreciated!
>>>> >
>>>> >  - Ashwanth Kumar
>>>> >
>>>>
>>>>
>>>>
>>>> --
>>>> --
>>>> TheDailyTube.com. Sign up and get the best new videos on the internet
>>>> delivered fresh to your inbox.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Help-with-ZoneUpdate-tp26651908p26754010.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: Help with ZoneUpdate

Posted by Josh Canfield <jo...@thedailytube.com>.
> The Zone raises a JS event when is updated.

You're right, my bad. I was looking at the form injector when I
replied. It doesn't raise an event and so I used the show hack. I'm
using ZONE_UPDATED_EVENT for my zones...

Josh

On Sat, Dec 5, 2009 at 1:35 AM, Juan E. Maya <ma...@gmail.com> wrote:
> The Zone raises a JS event when is updated. This is explained in the
> Zone documentation:
>
> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html
>
> "After the client-side content is updated, a client-side event is
> fired on the zone's element. The constant Tapestry.ZONE_UPDATED_EVENT
> can be used to listen to the event."
>
> You just need to provide a Prototype listener for that event in your page.
>
> On Sat, Dec 5, 2009 at 7:04 AM, Ashwanth Kumar <as...@gmail.com> wrote:
>> Thanks Josh,
>>
>> That worked like a charm!! I dont know if there could be anything better
>> than this?? :)
>>
>>  - Ashwanth Kumar
>>
>>
>> On 12/5/09, Josh Canfield <jo...@thedailytube.com> wrote:
>>>
>>> Last time I was hunting around for a solution for this I came up with this:
>>>
>>> Tapestry.ElementEffect.myshowfunc = function(element) {
>>>    // do special stuff
>>>    return new Effect.Highlight(element);
>>> }
>>>
>>> <t:zone show="myshowfunc"/>
>>>
>>> There may be a better method that I'm not aware of though.
>>>
>>> Josh
>>>
>>> On Fri, Dec 4, 2009 at 5:04 PM, Ashwanth Kumar <as...@gmail.com>
>>> wrote:
>>> > Hi,
>>> >
>>> > I've a question. How do i invoke a custom JS from the Page, immediately
>>> > after a ZoneUpate!
>>> > For instance, i need to apply a markitUp on a TextArea, after it has been
>>> > created by the ZoneUpdate event in Tapestry.
>>> >
>>> > How do i invoke it sync with the ZoneUpdate. Currently i use the onClick
>>> > event of the TextArea to show, but its not good enough. So, asny help
>>> > regarding this would be appreciated!
>>> >
>>> >  - Ashwanth Kumar
>>> >
>>>
>>>
>>>
>>> --
>>> --
>>> TheDailyTube.com. Sign up and get the best new videos on the internet
>>> delivered fresh to your inbox.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: Help with ZoneUpdate

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Sat, 05 Dec 2009 15:28:33 -0200, Ashwanth Kumar  
<as...@gmail.com> escreveu:

> Can you give me an example? I'm new to, Prototype!

Regarding events, take a look at  
http://www.prototypejs.org/api/event/observe

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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


Re: Help with ZoneUpdate

Posted by Ashwanth Kumar <as...@gmail.com>.
Hey,

Can you give me an example? I'm new to, Prototype!

Thanks
 - Ashwanth Kumar

On Sat, Dec 5, 2009 at 3:05 PM, Juan E. Maya <ma...@gmail.com> wrote:

> The Zone raises a JS event when is updated. This is explained in the
> Zone documentation:
>
>
> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html
>
> "After the client-side content is updated, a client-side event is
> fired on the zone's element. The constant Tapestry.ZONE_UPDATED_EVENT
> can be used to listen to the event."
>
> You just need to provide a Prototype listener for that event in your page.
>
> On Sat, Dec 5, 2009 at 7:04 AM, Ashwanth Kumar <as...@gmail.com>
> wrote:
> > Thanks Josh,
> >
> > That worked like a charm!! I dont know if there could be anything better
> > than this?? :)
> >
> >  - Ashwanth Kumar
> >
> >
> > On 12/5/09, Josh Canfield <jo...@thedailytube.com> wrote:
> >>
> >> Last time I was hunting around for a solution for this I came up with
> this:
> >>
> >> Tapestry.ElementEffect.myshowfunc = function(element) {
> >>    // do special stuff
> >>    return new Effect.Highlight(element);
> >> }
> >>
> >> <t:zone show="myshowfunc"/>
> >>
> >> There may be a better method that I'm not aware of though.
> >>
> >> Josh
> >>
> >> On Fri, Dec 4, 2009 at 5:04 PM, Ashwanth Kumar <
> ashwanth.kumar@gmail.com>
> >> wrote:
> >> > Hi,
> >> >
> >> > I've a question. How do i invoke a custom JS from the Page,
> immediately
> >> > after a ZoneUpate!
> >> > For instance, i need to apply a markitUp on a TextArea, after it has
> been
> >> > created by the ZoneUpdate event in Tapestry.
> >> >
> >> > How do i invoke it sync with the ZoneUpdate. Currently i use the
> onClick
> >> > event of the TextArea to show, but its not good enough. So, asny help
> >> > regarding this would be appreciated!
> >> >
> >> >  - Ashwanth Kumar
> >> >
> >>
> >>
> >>
> >> --
> >> --
> >> TheDailyTube.com. Sign up and get the best new videos on the internet
> >> delivered fresh to your inbox.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Help with ZoneUpdate

Posted by "Juan E. Maya" <ma...@gmail.com>.
The Zone raises a JS event when is updated. This is explained in the
Zone documentation:

http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html

"After the client-side content is updated, a client-side event is
fired on the zone's element. The constant Tapestry.ZONE_UPDATED_EVENT
can be used to listen to the event."

You just need to provide a Prototype listener for that event in your page.

On Sat, Dec 5, 2009 at 7:04 AM, Ashwanth Kumar <as...@gmail.com> wrote:
> Thanks Josh,
>
> That worked like a charm!! I dont know if there could be anything better
> than this?? :)
>
>  - Ashwanth Kumar
>
>
> On 12/5/09, Josh Canfield <jo...@thedailytube.com> wrote:
>>
>> Last time I was hunting around for a solution for this I came up with this:
>>
>> Tapestry.ElementEffect.myshowfunc = function(element) {
>>    // do special stuff
>>    return new Effect.Highlight(element);
>> }
>>
>> <t:zone show="myshowfunc"/>
>>
>> There may be a better method that I'm not aware of though.
>>
>> Josh
>>
>> On Fri, Dec 4, 2009 at 5:04 PM, Ashwanth Kumar <as...@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > I've a question. How do i invoke a custom JS from the Page, immediately
>> > after a ZoneUpate!
>> > For instance, i need to apply a markitUp on a TextArea, after it has been
>> > created by the ZoneUpdate event in Tapestry.
>> >
>> > How do i invoke it sync with the ZoneUpdate. Currently i use the onClick
>> > event of the TextArea to show, but its not good enough. So, asny help
>> > regarding this would be appreciated!
>> >
>> >  - Ashwanth Kumar
>> >
>>
>>
>>
>> --
>> --
>> TheDailyTube.com. Sign up and get the best new videos on the internet
>> delivered fresh to your inbox.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>

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


Re: Help with ZoneUpdate

Posted by Ashwanth Kumar <as...@gmail.com>.
Thanks Josh,

That worked like a charm!! I dont know if there could be anything better
than this?? :)

 - Ashwanth Kumar


On 12/5/09, Josh Canfield <jo...@thedailytube.com> wrote:
>
> Last time I was hunting around for a solution for this I came up with this:
>
> Tapestry.ElementEffect.myshowfunc = function(element) {
>    // do special stuff
>    return new Effect.Highlight(element);
> }
>
> <t:zone show="myshowfunc"/>
>
> There may be a better method that I'm not aware of though.
>
> Josh
>
> On Fri, Dec 4, 2009 at 5:04 PM, Ashwanth Kumar <as...@gmail.com>
> wrote:
> > Hi,
> >
> > I've a question. How do i invoke a custom JS from the Page, immediately
> > after a ZoneUpate!
> > For instance, i need to apply a markitUp on a TextArea, after it has been
> > created by the ZoneUpdate event in Tapestry.
> >
> > How do i invoke it sync with the ZoneUpdate. Currently i use the onClick
> > event of the TextArea to show, but its not good enough. So, asny help
> > regarding this would be appreciated!
> >
> >  - Ashwanth Kumar
> >
>
>
>
> --
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Help with ZoneUpdate

Posted by Josh Canfield <jo...@thedailytube.com>.
Last time I was hunting around for a solution for this I came up with this:

Tapestry.ElementEffect.myshowfunc = function(element) {
    // do special stuff
    return new Effect.Highlight(element);
}

<t:zone show="myshowfunc"/>

There may be a better method that I'm not aware of though.

Josh

On Fri, Dec 4, 2009 at 5:04 PM, Ashwanth Kumar <as...@gmail.com> wrote:
> Hi,
>
> I've a question. How do i invoke a custom JS from the Page, immediately
> after a ZoneUpate!
> For instance, i need to apply a markitUp on a TextArea, after it has been
> created by the ZoneUpdate event in Tapestry.
>
> How do i invoke it sync with the ZoneUpdate. Currently i use the onClick
> event of the TextArea to show, but its not good enough. So, asny help
> regarding this would be appreciated!
>
>  - Ashwanth Kumar
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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