You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by karthik G <be...@gmail.com> on 2005/12/15 16:07:15 UTC

beginner : tapestry vs asp.net 2 webforms question

Hi All,

I read somewhere asp.net web forms are similar to tapestry and so today I
was exploring asp.net.

I see that asp.net allows you to attach a server side listener to a
textfield for eg for 'on change event' on the client side. Does tapestry
allow this? I mean can i configure a listener on a textfield?.  I see that
asp.net web forms stores the inital state of the components while rendering
in a hidden field in rendered HTML. So when the user submits, it reads the
value that existed while rendering and compares it with the current value
during submit and based on that decides if the listener needs to be invoked.
It seems to be creating the page instance (as opposed to tapestry page
pooling) everytime the rendering / submit happens.

I also looked at @Persist("client") and i feel that this feature c'd help in
emulating a similar behaviour in tapestry?

I'm a tapestry beginner. So please bear with me if this post does'nt make
sense ( do correct me though :))

thanks,
karthik

Re: beginner : tapestry vs asp.net 2 webforms question

Posted by Kent Tong <ke...@cpttm.org.mo>.
karthik G <beginner.tapestry <at> gmail.com> writes:

> I see that asp.net allows you to attach a server side listener to a
> textfield for eg for 'on change event' on the client side. 

This is not the case. This listener is called on the server side.

> Does tapestry allow this? I mean can i configure a listener on a textfield?.  

Not directly. You can use javascript to do that or check if AJAX
can help.

> I see that
> asp.net web forms stores the inital state of the components while rendering
> in a hidden field in rendered HTML. So when the user submits, it reads the
> value that existed while rendering and compares it with the current value
> during submit and based on that decides if the listener needs to be invoked.

Correct. That's why the listener is called on the server side.

> It seems to be creating the page instance (as opposed to tapestry page
> pooling) everytime the rendering / submit happens.

It seems to be the case.

> I also looked at  <at> Persist("client") and i feel that this feature c'd help
> in emulating a similar behaviour in tapestry?

In Tapestry with the use an OGNL expression the TextField will directly
store the new value into a location that you desire, so generally you
don't need to attach a listener to it. If you do need to check if the
value has been changed, yes, you could use a client persistent property.

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


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