You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Lenny Primak <lp...@hope.nyc.ny.us> on 2011/09/20 09:54:29 UTC

Thoughts: Should Ajax/Grid be that hard?

Hi guys,

I just want to share my thoughts with you regarding my experience building pretty simple infrastructure.
Don't get me wrong, I love tapestry but I think there's definitely room for improvement here.

My goal was simple:  Develop a page that has an Ajax Grid that is backed by a database table.

To get this into somewhat decent shape it took about one man-month, which I think could be improved.
After a minor hiccup with JPA and problems with multiple database support, I got the basic page up and
running rather quickly. (kudos)
Afterwards, I started noticing minor issues that took major time to fix.
What I wound up with is a hodgepodge of hacks/workarounds to get everything just right.
Lots of JavaScript and event handling code.
I believe that this stuff should work out of the box.

It all boiled down to one major issue:
Tapestry does not know how to deal with Ajax and expiring sessions.
I would either get an error dialog, an exception, NULL data, or all of the above when:
- clicking on the Grid pager
- clicking on a button that would update the grid (Ajax)

Basically there are about 10 corner cases that deal with expired sessions that 
were very hard to track down. 

All my hacks/workarounds do one thing:  When Ajax call is made,
and the session is invalid (or new w/o SetupRender being called)
I redirect to the same page, causing a reload or relogin if security credentials also expired.

I will try to post as much of this as I can as soon as I can on the wiki or github or both,
but I think this functionality should work out-of-the box.

Thanks for the great product, and will be going into production soon.


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


Re: Thoughts: Should Ajax/Grid be that hard?

Posted by lprimak <lp...@hope.nyc.ny.us>.
My solution to this involves keeping track of my own session.
I have an object called SessionTracker, which has a simple @SetupRender
method and a @Persist field.  when I check for a valid session,
I check is the @Persist variable is still available.

With this method, no custom callback is necessary to check whether the
session
is new or not.


Taha Hafeez wrote:
> 
> Hi Geoff
> 
> I am thinking at the request filter level using a combination of
> HttpSession.isNew() and some callback to check with the application if
> the session is new (like login details etc)
> 
> session = request.getSession(false);
> 
> if(session ==null || (session.isNew() && myCallback.isNew(session))){
>    //it has expired
> }else {
>    //it has not expired
> }
> 
> myCallback.isNew(session) can check user login details.
> 
> On Wed, Sep 21, 2011 at 4:54 AM, Geoff Callender
> &lt;geoff.callender.jumpstart@gmail.com&gt; wrote:
>> Hi Taha,
>>
>> Let's say there was a @SessionRequired annotation to put on methods. When
>> session expires it redirects to a "session expired" page. But how would
>> it determine whether session has expired vs. first time in? It would have
>> to register sessions centrally somehow. More than that, it would have to
>> register current page(s) within session, and remove them as you leave the
>> page. Is that what you have in mind?
>>
>> On 21/09/2011, at 12:05 AM, Taha Hafeez wrote:
>>
>>> Hi Lenny
>>>
>>> I am using ajax grid in many of my applications. As I am using 5.2.6
>>> on some of the projects, I use my tapestry.js hack for it.
>>>
>>> The inability of grid to provide zone parameter (as others components
>>> do) instead of inplace is a limitation but I think this can be sorted
>>> out with the new ajax support.(I have not tried it yet but I think it
>>> can be done).
>>>
>>> Regarding session expiry, I think a simple redirect to a session
>>> expired page can be useful both for ajax and non-ajax situations.
>>>
>>>
>>> On Tue, Sep 20, 2011 at 1:24 PM, Lenny Primak
>>> &lt;lprimak@hope.nyc.ny.us&gt; wrote:
>>>> Hi guys,
>>>>
>>>> I just want to share my thoughts with you regarding my experience
>>>> building pretty simple infrastructure.
>>>> Don't get me wrong, I love tapestry but I think there's definitely room
>>>> for improvement here.
>>>>
>>>> My goal was simple:  Develop a page that has an Ajax Grid that is
>>>> backed by a database table.
>>>>
>>>> To get this into somewhat decent shape it took about one man-month,
>>>> which I think could be improved.
>>>> After a minor hiccup with JPA and problems with multiple database
>>>> support, I got the basic page up and
>>>> running rather quickly. (kudos)
>>>> Afterwards, I started noticing minor issues that took major time to
>>>> fix.
>>>> What I wound up with is a hodgepodge of hacks/workarounds to get
>>>> everything just right.
>>>> Lots of JavaScript and event handling code.
>>>> I believe that this stuff should work out of the box.
>>>>
>>>> It all boiled down to one major issue:
>>>> Tapestry does not know how to deal with Ajax and expiring sessions.
>>>> I would either get an error dialog, an exception, NULL data, or all of
>>>> the above when:
>>>> - clicking on the Grid pager
>>>> - clicking on a button that would update the grid (Ajax)
>>>>
>>>> Basically there are about 10 corner cases that deal with expired
>>>> sessions that
>>>> were very hard to track down.
>>>>
>>>> All my hacks/workarounds do one thing:  When Ajax call is made,
>>>> and the session is invalid (or new w/o SetupRender being called)
>>>> I redirect to the same page, causing a reload or relogin if security
>>>> credentials also expired.
>>>>
>>>> I will try to post as much of this as I can as soon as I can on the
>>>> wiki or github or both,
>>>> but I think this functionality should work out-of-the box.
>>>>
>>>> Thanks for the great product, and will be going into production soon.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Regards
>>>
>>> Taha Hafeez Siddiqi (tawus)
>>> http://tawus.wordpress.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> Regards
> 
> Taha Hafeez Siddiqi (tawus)
> http://tawus.wordpress.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
> 


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Thoughts-Should-Ajax-Grid-be-that-hard-tp4821689p4826903.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.

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


Re: Thoughts: Should Ajax/Grid be that hard?

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

I am thinking at the request filter level using a combination of
HttpSession.isNew() and some callback to check with the application if
the session is new (like login details etc)

session = request.getSession(false);

if(session ==null || (session.isNew() && myCallback.isNew(session))){
   //it has expired
}else {
   //it has not expired
}

myCallback.isNew(session) can check user login details.

On Wed, Sep 21, 2011 at 4:54 AM, Geoff Callender
<ge...@gmail.com> wrote:
> Hi Taha,
>
> Let's say there was a @SessionRequired annotation to put on methods. When session expires it redirects to a "session expired" page. But how would it determine whether session has expired vs. first time in? It would have to register sessions centrally somehow. More than that, it would have to register current page(s) within session, and remove them as you leave the page. Is that what you have in mind?
>
> On 21/09/2011, at 12:05 AM, Taha Hafeez wrote:
>
>> Hi Lenny
>>
>> I am using ajax grid in many of my applications. As I am using 5.2.6
>> on some of the projects, I use my tapestry.js hack for it.
>>
>> The inability of grid to provide zone parameter (as others components
>> do) instead of inplace is a limitation but I think this can be sorted
>> out with the new ajax support.(I have not tried it yet but I think it
>> can be done).
>>
>> Regarding session expiry, I think a simple redirect to a session
>> expired page can be useful both for ajax and non-ajax situations.
>>
>>
>> On Tue, Sep 20, 2011 at 1:24 PM, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>>> Hi guys,
>>>
>>> I just want to share my thoughts with you regarding my experience building pretty simple infrastructure.
>>> Don't get me wrong, I love tapestry but I think there's definitely room for improvement here.
>>>
>>> My goal was simple:  Develop a page that has an Ajax Grid that is backed by a database table.
>>>
>>> To get this into somewhat decent shape it took about one man-month, which I think could be improved.
>>> After a minor hiccup with JPA and problems with multiple database support, I got the basic page up and
>>> running rather quickly. (kudos)
>>> Afterwards, I started noticing minor issues that took major time to fix.
>>> What I wound up with is a hodgepodge of hacks/workarounds to get everything just right.
>>> Lots of JavaScript and event handling code.
>>> I believe that this stuff should work out of the box.
>>>
>>> It all boiled down to one major issue:
>>> Tapestry does not know how to deal with Ajax and expiring sessions.
>>> I would either get an error dialog, an exception, NULL data, or all of the above when:
>>> - clicking on the Grid pager
>>> - clicking on a button that would update the grid (Ajax)
>>>
>>> Basically there are about 10 corner cases that deal with expired sessions that
>>> were very hard to track down.
>>>
>>> All my hacks/workarounds do one thing:  When Ajax call is made,
>>> and the session is invalid (or new w/o SetupRender being called)
>>> I redirect to the same page, causing a reload or relogin if security credentials also expired.
>>>
>>> I will try to post as much of this as I can as soon as I can on the wiki or github or both,
>>> but I think this functionality should work out-of-the box.
>>>
>>> Thanks for the great product, and will be going into production soon.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Regards
>>
>> Taha Hafeez Siddiqi (tawus)
>> http://tawus.wordpress.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>



-- 
Regards

Taha Hafeez Siddiqi (tawus)
http://tawus.wordpress.com

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


Re: Thoughts: Should Ajax/Grid be that hard?

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
I have a solution to this exact problem. I'll post it shortly.  



On Sep 20, 2011, at 7:24 PM, Geoff Callender <ge...@gmail.com> wrote:

> Hi Taha,
> 
> Let's say there was a @SessionRequired annotation to put on methods. When session expires it redirects to a "session expired" page. But how would it determine whether session has expired vs. first time in? It would have to register sessions centrally somehow. More than that, it would have to register current page(s) within session, and remove them as you leave the page. Is that what you have in mind?
> 
> On 21/09/2011, at 12:05 AM, Taha Hafeez wrote:
> 
>> Hi Lenny
>> 
>> I am using ajax grid in many of my applications. As I am using 5.2.6
>> on some of the projects, I use my tapestry.js hack for it.
>> 
>> The inability of grid to provide zone parameter (as others components
>> do) instead of inplace is a limitation but I think this can be sorted
>> out with the new ajax support.(I have not tried it yet but I think it
>> can be done).
>> 
>> Regarding session expiry, I think a simple redirect to a session
>> expired page can be useful both for ajax and non-ajax situations.
>> 
>> 
>> On Tue, Sep 20, 2011 at 1:24 PM, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>>> Hi guys,
>>> 
>>> I just want to share my thoughts with you regarding my experience building pretty simple infrastructure.
>>> Don't get me wrong, I love tapestry but I think there's definitely room for improvement here.
>>> 
>>> My goal was simple:  Develop a page that has an Ajax Grid that is backed by a database table.
>>> 
>>> To get this into somewhat decent shape it took about one man-month, which I think could be improved.
>>> After a minor hiccup with JPA and problems with multiple database support, I got the basic page up and
>>> running rather quickly. (kudos)
>>> Afterwards, I started noticing minor issues that took major time to fix.
>>> What I wound up with is a hodgepodge of hacks/workarounds to get everything just right.
>>> Lots of JavaScript and event handling code.
>>> I believe that this stuff should work out of the box.
>>> 
>>> It all boiled down to one major issue:
>>> Tapestry does not know how to deal with Ajax and expiring sessions.
>>> I would either get an error dialog, an exception, NULL data, or all of the above when:
>>> - clicking on the Grid pager
>>> - clicking on a button that would update the grid (Ajax)
>>> 
>>> Basically there are about 10 corner cases that deal with expired sessions that
>>> were very hard to track down.
>>> 
>>> All my hacks/workarounds do one thing:  When Ajax call is made,
>>> and the session is invalid (or new w/o SetupRender being called)
>>> I redirect to the same page, causing a reload or relogin if security credentials also expired.
>>> 
>>> I will try to post as much of this as I can as soon as I can on the wiki or github or both,
>>> but I think this functionality should work out-of-the box.
>>> 
>>> Thanks for the great product, and will be going into production soon.
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>> 
>>> 
>> 
>> 
>> 
>> -- 
>> Regards
>> 
>> Taha Hafeez Siddiqi (tawus)
>> http://tawus.wordpress.com
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
> 

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


Re: Thoughts: Should Ajax/Grid be that hard?

Posted by Geoff Callender <ge...@gmail.com>.
Hi Taha,

Let's say there was a @SessionRequired annotation to put on methods. When session expires it redirects to a "session expired" page. But how would it determine whether session has expired vs. first time in? It would have to register sessions centrally somehow. More than that, it would have to register current page(s) within session, and remove them as you leave the page. Is that what you have in mind?

On 21/09/2011, at 12:05 AM, Taha Hafeez wrote:

> Hi Lenny
> 
> I am using ajax grid in many of my applications. As I am using 5.2.6
> on some of the projects, I use my tapestry.js hack for it.
> 
> The inability of grid to provide zone parameter (as others components
> do) instead of inplace is a limitation but I think this can be sorted
> out with the new ajax support.(I have not tried it yet but I think it
> can be done).
> 
> Regarding session expiry, I think a simple redirect to a session
> expired page can be useful both for ajax and non-ajax situations.
> 
> 
> On Tue, Sep 20, 2011 at 1:24 PM, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>> Hi guys,
>> 
>> I just want to share my thoughts with you regarding my experience building pretty simple infrastructure.
>> Don't get me wrong, I love tapestry but I think there's definitely room for improvement here.
>> 
>> My goal was simple:  Develop a page that has an Ajax Grid that is backed by a database table.
>> 
>> To get this into somewhat decent shape it took about one man-month, which I think could be improved.
>> After a minor hiccup with JPA and problems with multiple database support, I got the basic page up and
>> running rather quickly. (kudos)
>> Afterwards, I started noticing minor issues that took major time to fix.
>> What I wound up with is a hodgepodge of hacks/workarounds to get everything just right.
>> Lots of JavaScript and event handling code.
>> I believe that this stuff should work out of the box.
>> 
>> It all boiled down to one major issue:
>> Tapestry does not know how to deal with Ajax and expiring sessions.
>> I would either get an error dialog, an exception, NULL data, or all of the above when:
>> - clicking on the Grid pager
>> - clicking on a button that would update the grid (Ajax)
>> 
>> Basically there are about 10 corner cases that deal with expired sessions that
>> were very hard to track down.
>> 
>> All my hacks/workarounds do one thing:  When Ajax call is made,
>> and the session is invalid (or new w/o SetupRender being called)
>> I redirect to the same page, causing a reload or relogin if security credentials also expired.
>> 
>> I will try to post as much of this as I can as soon as I can on the wiki or github or both,
>> but I think this functionality should work out-of-the box.
>> 
>> Thanks for the great product, and will be going into production soon.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>> 
>> 
> 
> 
> 
> -- 
> Regards
> 
> Taha Hafeez Siddiqi (tawus)
> http://tawus.wordpress.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
> 


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


Re: Thoughts: Should Ajax/Grid be that hard?

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

I am using ajax grid in many of my applications. As I am using 5.2.6
on some of the projects, I use my tapestry.js hack for it.

The inability of grid to provide zone parameter (as others components
do) instead of inplace is a limitation but I think this can be sorted
out with the new ajax support.(I have not tried it yet but I think it
can be done).

Regarding session expiry, I think a simple redirect to a session
expired page can be useful both for ajax and non-ajax situations.


On Tue, Sep 20, 2011 at 1:24 PM, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
> Hi guys,
>
> I just want to share my thoughts with you regarding my experience building pretty simple infrastructure.
> Don't get me wrong, I love tapestry but I think there's definitely room for improvement here.
>
> My goal was simple:  Develop a page that has an Ajax Grid that is backed by a database table.
>
> To get this into somewhat decent shape it took about one man-month, which I think could be improved.
> After a minor hiccup with JPA and problems with multiple database support, I got the basic page up and
> running rather quickly. (kudos)
> Afterwards, I started noticing minor issues that took major time to fix.
> What I wound up with is a hodgepodge of hacks/workarounds to get everything just right.
> Lots of JavaScript and event handling code.
> I believe that this stuff should work out of the box.
>
> It all boiled down to one major issue:
> Tapestry does not know how to deal with Ajax and expiring sessions.
> I would either get an error dialog, an exception, NULL data, or all of the above when:
> - clicking on the Grid pager
> - clicking on a button that would update the grid (Ajax)
>
> Basically there are about 10 corner cases that deal with expired sessions that
> were very hard to track down.
>
> All my hacks/workarounds do one thing:  When Ajax call is made,
> and the session is invalid (or new w/o SetupRender being called)
> I redirect to the same page, causing a reload or relogin if security credentials also expired.
>
> I will try to post as much of this as I can as soon as I can on the wiki or github or both,
> but I think this functionality should work out-of-the box.
>
> Thanks for the great product, and will be going into production soon.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>



-- 
Regards

Taha Hafeez Siddiqi (tawus)
http://tawus.wordpress.com

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


Re: Thoughts: Should Ajax/Grid be that hard?

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
Yes, Grid does need some TLC, but I think there is a bigger issues with
Tapestry & Ajax in general, as Ajax still feels like redheaded stepchild in Tapestry.
In the very least, I think graceful degradation should work out-of-the-box,
as well as redirects to the same page (for example) when there is no valid session.

I wrote my @XHR annotation (named it @AJAX, cause nobody understands what @XHR means)
and added requireSession argument, if that's true (the default), the event method won't even get called
if there is no valid session, and the page gets redirected to self.

As far as the Grid itself, the reason I as well as other people use it directly, is because
its hard to replicate its functionality using its member components, and it's not documented how to use it.
GridPager has no graceful degradation (perhaps its impossible?) and its very hard to catch
all the pager clicks so in case of a null session it gets redirected to a login (same page) for me.
I think that should work out of the box at the very leas as well.

Thank for listening to my rambles :)

On Sep 20, 2011, at 10:22 AM, Howard Lewis Ship wrote:

> Valid concerns I think ... Grid needs some TLC and maybe a rethink as
> to how to make it work best in Ajax. It may even be necessary to
> freeze Grid and create a Grid2.
> 
> Unlike BeanEditForm, people don't recognize Grid as scaffolding,
> everyone treats it as infrastructure, so it's time to move it in that
> direction.
> 
> On Tue, Sep 20, 2011 at 12:54 AM, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
>> Hi guys,
>> 
>> I just want to share my thoughts with you regarding my experience building pretty simple infrastructure.
>> Don't get me wrong, I love tapestry but I think there's definitely room for improvement here.
>> 
>> My goal was simple:  Develop a page that has an Ajax Grid that is backed by a database table.
>> 
>> To get this into somewhat decent shape it took about one man-month, which I think could be improved.
>> After a minor hiccup with JPA and problems with multiple database support, I got the basic page up and
>> running rather quickly. (kudos)
>> Afterwards, I started noticing minor issues that took major time to fix.
>> What I wound up with is a hodgepodge of hacks/workarounds to get everything just right.
>> Lots of JavaScript and event handling code.
>> I believe that this stuff should work out of the box.
>> 
>> It all boiled down to one major issue:
>> Tapestry does not know how to deal with Ajax and expiring sessions.
>> I would either get an error dialog, an exception, NULL data, or all of the above when:
>> - clicking on the Grid pager
>> - clicking on a button that would update the grid (Ajax)
>> 
>> Basically there are about 10 corner cases that deal with expired sessions that
>> were very hard to track down.
>> 
>> All my hacks/workarounds do one thing:  When Ajax call is made,
>> and the session is invalid (or new w/o SetupRender being called)
>> I redirect to the same page, causing a reload or relogin if security credentials also expired.
>> 
>> I will try to post as much of this as I can as soon as I can on the wiki or github or both,
>> but I think this functionality should work out-of-the box.
>> 
>> Thanks for the great product, and will be going into production soon.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>> 
>> 
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> 
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
> 
> (971) 678-5210
> http://howardlewisship.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
> 


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


Re: Thoughts: Should Ajax/Grid be that hard?

Posted by Howard Lewis Ship <hl...@gmail.com>.
Valid concerns I think ... Grid needs some TLC and maybe a rethink as
to how to make it work best in Ajax. It may even be necessary to
freeze Grid and create a Grid2.

Unlike BeanEditForm, people don't recognize Grid as scaffolding,
everyone treats it as infrastructure, so it's time to move it in that
direction.

On Tue, Sep 20, 2011 at 12:54 AM, Lenny Primak <lp...@hope.nyc.ny.us> wrote:
> Hi guys,
>
> I just want to share my thoughts with you regarding my experience building pretty simple infrastructure.
> Don't get me wrong, I love tapestry but I think there's definitely room for improvement here.
>
> My goal was simple:  Develop a page that has an Ajax Grid that is backed by a database table.
>
> To get this into somewhat decent shape it took about one man-month, which I think could be improved.
> After a minor hiccup with JPA and problems with multiple database support, I got the basic page up and
> running rather quickly. (kudos)
> Afterwards, I started noticing minor issues that took major time to fix.
> What I wound up with is a hodgepodge of hacks/workarounds to get everything just right.
> Lots of JavaScript and event handling code.
> I believe that this stuff should work out of the box.
>
> It all boiled down to one major issue:
> Tapestry does not know how to deal with Ajax and expiring sessions.
> I would either get an error dialog, an exception, NULL data, or all of the above when:
> - clicking on the Grid pager
> - clicking on a button that would update the grid (Ajax)
>
> Basically there are about 10 corner cases that deal with expired sessions that
> were very hard to track down.
>
> All my hacks/workarounds do one thing:  When Ajax call is made,
> and the session is invalid (or new w/o SetupRender being called)
> I redirect to the same page, causing a reload or relogin if security credentials also expired.
>
> I will try to post as much of this as I can as soon as I can on the wiki or github or both,
> but I think this functionality should work out-of-the box.
>
> Thanks for the great product, and will be going into production soon.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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