Re: @java.lang.Math@min inside TML files ?
T3-T4 used ognl for the binding/property expression language. T5 does not (although there are third party add-ons that restore ognl use). T5's property expression language does not allow for static access, so @java.lang.Math@min won't work. Robert On Sep 10, 2011, at 9/109:02 PM , Ken in Nashua wrote: > > Hi All, > > I am trying to operate > @java.lang.Math@min > > within my tml file and it is not working... the markup is spitting out code > as opposed as executing the code for my logic. > > Has this usage of java inside markup files changed for tapestry ? > Best Regards and thanks > kcola...@live.com > > > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.3 Grid, inPlace Update and expired Sessions
I solved this problem finally by making a component somewhat derivative of tapestry-conversations moderator component. Wasn't easy in the last bit. I will post the code to wiki shortly. What it does is just redirect to the same page if sessions expires, allowing the user to relogin, or if the 'remember me' feature is used, the page just reloads properly. Thanks everyone for helping me. On Sep 10, 2011, at 2:42 PM, Lenny Primak wrote: > That would be great, but I personally would be very happy with just a > redirect to the current page, > which would just get me a login prompt once again, > but I suppose there are deeper tapestry-related javascript issues going on > here, > otherwise this problem would have been licked already. > > On Sep 10, 2011, at 2:37 PM, Fernando Padilla wrote: > >> Hm.. >> >> Did someone already propose to have Tapestry-Security support a popup-login >> flow? >> >> So when tapestry-security hijacks a ajax request, it would return a >> multizoneupdate that would generate a popup-zone (tapestry doesn't have >> native support for those yet, but really should!); and would handle the >> login flow within a popup, and replay the original ajax request after it's >> done? >> >> >> This is a stretch though, since there are a few things needed: >> >> 1) a zone that support popup or dialog >> 2) security that has a new popup/dialog display option/flow >> 3) a really excited hacker to hack all of this and submit a patch! :) >> >> >> On 9/10/11 10:23 AM, Lenny Primak wrote: >>> Did anybody test tapestry-conversation under Tap 5.3 (beta 5?) >>> I am getting ReferenceError: Can't find variable: ConversationModerator >>> The ConversationModerator.js doesn't seem to get included into the Tapestry >>> page, >>> but the component is there. >>> >>> On Sep 10, 2011, at 12:29 PM, Lenny Primak wrote: >>> Thanks, Kalle, I think this will work. I would love, if its possible, for tap-security, perhaps? to be able to redirect AJAX requests correctly to the current page or login page in case the session expired. That way, it would all work automatically, instead of showing ugly exception on the screen. I will try your method in the meanwhile, the session end warning sounds like a good idea. On Sep 10, 2011, at 10:52 AM, Kalle Korhonen wrote: > On Sat, Sep 10, 2011 at 2:39 AM, Lenny Primak > wrote: >> Digging through this a bit deeper, there is an interaction going on here >> with tapestry-security. >> When the session expires, the user is no longer logged in, and thus >> ajax call is being redirected to a login screen, thus the exceptions. >> But the problem still remains the same, there seems to be no good way >> to redirect the page to itself when the Grid does inPlace update, >> and the session is no longer available. >> Any more thoughts/ideas? > Sounds like tapestry-security is doing the right thing, no? How I > would solve the problem, is that either I wouldn't let the session to > expire or warn the user that the session is about to expire, or a > combination of both. If you added conversational scope, it'd be > relatively easy to do (see > http://tynamo.org/tapestry-conversations+guide for more info). > > Kalle > > >> On Sep 10, 2011, at 4:38 AM, Lenny Primak wrote: >> >>> As a matter of fact, I can't get any sort of graceful degradation after >>> session has expired. >>> >>> --- Screenshot >>> >>> >>> // somewhere we trigger session invalidation >>> request.getSession(false).invalidate(); >>> >>> >>> // now lets try an AJAX event handler to redirect to my index page >>> @OnEvent(value = "submit", component = "SearchForm") >>> public Object searchCustomer() >>> { >>> return IndexPage.class; >>> } >>> >>> >>> >>> On Sep 10, 2011, at 1:40 AM, Taha Hafeez wrote: >>> Hi Lenny I handle this issue in a more generic way for all ajax calls. http://tapestry.1045711.n5.nabble.com/Tapestry-Zone-and-Expired-Session-td4634714.html#a4634757 On Sat, Sep 10, 2011 at 10:23 AM, Lenny Primak wrote: > I cannot believe that no one has run into that issue. > Seems like anyone that's using the AJAX Grid would face it. > > Please vote for https://issues.apache.org/jira/browse/TAP5-1634 > if you care, or if anyone has a workaround, please suggest one. > > Thanks > > > > On Sep 2, 2011, at 5:24 PM, Lenny Primak wrote: > >> Seems to me that this would be a common thing with any of the AJAX >> components. >> Should I open up a JIRA issue? >> >> On Fri, 02 Sep 2011 18:14:28 -03
@java.lang.Math@min inside TML files ?
Hi All, I am trying to operate @java.lang.Math@min within my tml file and it is not working... the markup is spitting out code as opposed as executing the code for my logic. Has this usage of java inside markup files changed for tapestry ? Best Regards and thanks kcola...@live.com
Re: missing css files in jetty
Definitely sounds like tmpwatch. You can also create a "work" directory in ${jetty.home} and Jetty will use that for unpacked apps. Read more here: http://wiki.eclipse.org/Jetty/Reference/Temporary_Directories On Sat, 10 Sep 2011 23:25:20 +0200, Cezary Biernacki wrote: Hi, if you are running on Linux, maybe 'tmpwatch' removed the file. By default Jetty unpacks WARs to /tmp, and on many Linux distributions 'tmpwatch' is executed from a cron job to remove files from /tmp that were not accessed for some time. In such case, you can disable either tmpwatch or change 'java.io.tmpdir' settings for JVM that is used by Jetty. Best regards, Cezary On Thu, Sep 8, 2011 at 10:34 AM, angelochen wrote: Hi, I have this: @Import(stylesheet = {"context:/css/sample.css"}) and it runs quite well, but a few days later, we got: /assets/1.0-SNAPSHOT/ctx/css/sample.css. Reason: file not found. however, this one still accessible: /assets/1.0-SNAPSHOT/tapestry/default.css difference is /ctx/css and /tapestry this happens in jetty, i do not try tomcat, why? fix? Thanks, Angelo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: missing css files in jetty
Hi, if you are running on Linux, maybe 'tmpwatch' removed the file. By default Jetty unpacks WARs to /tmp, and on many Linux distributions 'tmpwatch' is executed from a cron job to remove files from /tmp that were not accessed for some time. In such case, you can disable either tmpwatch or change 'java.io.tmpdir' settings for JVM that is used by Jetty. Best regards, Cezary On Thu, Sep 8, 2011 at 10:34 AM, angelochen wrote: > Hi, > > I have this: > @Import(stylesheet = {"context:/css/sample.css"}) > and it runs quite well, but a few days later, we got: > /assets/1.0-SNAPSHOT/ctx/css/sample.css. Reason: file not found. however, > this one still accessible: > /assets/1.0-SNAPSHOT/tapestry/default.css > > difference is /ctx/css and /tapestry > > this happens in jetty, i do not try tomcat, why? fix? Thanks, > > Angelo > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/missing-css-files-in-jetty-tp4781709p4781709.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: T5.3 Grid, inPlace Update and expired Sessions
That would be great, but I personally would be very happy with just a redirect to the current page, which would just get me a login prompt once again, but I suppose there are deeper tapestry-related javascript issues going on here, otherwise this problem would have been licked already. On Sep 10, 2011, at 2:37 PM, Fernando Padilla wrote: > Hm.. > > Did someone already propose to have Tapestry-Security support a popup-login > flow? > > So when tapestry-security hijacks a ajax request, it would return a > multizoneupdate that would generate a popup-zone (tapestry doesn't have > native support for those yet, but really should!); and would handle the login > flow within a popup, and replay the original ajax request after it's done? > > > This is a stretch though, since there are a few things needed: > > 1) a zone that support popup or dialog > 2) security that has a new popup/dialog display option/flow > 3) a really excited hacker to hack all of this and submit a patch! :) > > > On 9/10/11 10:23 AM, Lenny Primak wrote: >> Did anybody test tapestry-conversation under Tap 5.3 (beta 5?) >> I am getting ReferenceError: Can't find variable: ConversationModerator >> The ConversationModerator.js doesn't seem to get included into the Tapestry >> page, >> but the component is there. >> >> On Sep 10, 2011, at 12:29 PM, Lenny Primak wrote: >> >>> Thanks, Kalle, >>> I think this will work. >>> I would love, if its possible, for tap-security, perhaps? to be able to >>> redirect AJAX requests >>> correctly to the current page or login page in case the session expired. >>> That way, it would all work automatically, instead of showing ugly >>> exception on the screen. >>> I will try your method in the meanwhile, the session end warning sounds >>> like a good idea. >>> >>> On Sep 10, 2011, at 10:52 AM, Kalle Korhonen wrote: >>> On Sat, Sep 10, 2011 at 2:39 AM, Lenny Primak wrote: > Digging through this a bit deeper, there is an interaction going on here > with tapestry-security. > When the session expires, the user is no longer logged in, and thus > ajax call is being redirected to a login screen, thus the exceptions. > But the problem still remains the same, there seems to be no good way > to redirect the page to itself when the Grid does inPlace update, > and the session is no longer available. > Any more thoughts/ideas? Sounds like tapestry-security is doing the right thing, no? How I would solve the problem, is that either I wouldn't let the session to expire or warn the user that the session is about to expire, or a combination of both. If you added conversational scope, it'd be relatively easy to do (see http://tynamo.org/tapestry-conversations+guide for more info). Kalle > On Sep 10, 2011, at 4:38 AM, Lenny Primak wrote: > >> As a matter of fact, I can't get any sort of graceful degradation after >> session has expired. >> >> --- Screenshot >> >> >> // somewhere we trigger session invalidation >>request.getSession(false).invalidate(); >> >> >> // now lets try an AJAX event handler to redirect to my index page >>@OnEvent(value = "submit", component = "SearchForm") >>public Object searchCustomer() >>{ >>return IndexPage.class; >>} >> >> >> >> On Sep 10, 2011, at 1:40 AM, Taha Hafeez wrote: >> >>> Hi Lenny >>> >>> I handle this issue in a more generic way for all ajax calls. >>> >>> http://tapestry.1045711.n5.nabble.com/Tapestry-Zone-and-Expired-Session-td4634714.html#a4634757 >>> >>> >>> >>> On Sat, Sep 10, 2011 at 10:23 AM, Lenny Primak >>> wrote: I cannot believe that no one has run into that issue. Seems like anyone that's using the AJAX Grid would face it. Please vote for https://issues.apache.org/jira/browse/TAP5-1634 if you care, or if anyone has a workaround, please suggest one. Thanks On Sep 2, 2011, at 5:24 PM, Lenny Primak wrote: > Seems to me that this would be a common thing with any of the AJAX > components. > Should I open up a JIRA issue? > > On Fri, 02 Sep 2011 18:14:28 -0300, Lenny > Primak wrote: > >> I figured that was a simple one. Should not have thought so. >> all my questions are complicated, otherwise I would have not asked :) > hehehe :) > >> On Sep 2, 2011, at 5:11 PM, Thiago H. de Paula Figueiredo wrote: >> >>> On Fri, 02 Sep 2011 17:43:42 -0300, Lenny >>> Primak wrote: >>> Oh you are here Thiago! >>> I'm always here, but I don't know the answers for all questions nor >>> the time to investigate t
Re: T5.3 Grid, inPlace Update and expired Sessions
Hm.. Did someone already propose to have Tapestry-Security support a popup-login flow? So when tapestry-security hijacks a ajax request, it would return a multizoneupdate that would generate a popup-zone (tapestry doesn't have native support for those yet, but really should!); and would handle the login flow within a popup, and replay the original ajax request after it's done? This is a stretch though, since there are a few things needed: 1) a zone that support popup or dialog 2) security that has a new popup/dialog display option/flow 3) a really excited hacker to hack all of this and submit a patch! :) On 9/10/11 10:23 AM, Lenny Primak wrote: Did anybody test tapestry-conversation under Tap 5.3 (beta 5?) I am getting ReferenceError: Can't find variable: ConversationModerator The ConversationModerator.js doesn't seem to get included into the Tapestry page, but the component is there. On Sep 10, 2011, at 12:29 PM, Lenny Primak wrote: Thanks, Kalle, I think this will work. I would love, if its possible, for tap-security, perhaps? to be able to redirect AJAX requests correctly to the current page or login page in case the session expired. That way, it would all work automatically, instead of showing ugly exception on the screen. I will try your method in the meanwhile, the session end warning sounds like a good idea. On Sep 10, 2011, at 10:52 AM, Kalle Korhonen wrote: On Sat, Sep 10, 2011 at 2:39 AM, Lenny Primak wrote: Digging through this a bit deeper, there is an interaction going on here with tapestry-security. When the session expires, the user is no longer logged in, and thus ajax call is being redirected to a login screen, thus the exceptions. But the problem still remains the same, there seems to be no good way to redirect the page to itself when the Grid does inPlace update, and the session is no longer available. Any more thoughts/ideas? Sounds like tapestry-security is doing the right thing, no? How I would solve the problem, is that either I wouldn't let the session to expire or warn the user that the session is about to expire, or a combination of both. If you added conversational scope, it'd be relatively easy to do (see http://tynamo.org/tapestry-conversations+guide for more info). Kalle On Sep 10, 2011, at 4:38 AM, Lenny Primak wrote: As a matter of fact, I can't get any sort of graceful degradation after session has expired. --- Screenshot // somewhere we trigger session invalidation request.getSession(false).invalidate(); // now lets try an AJAX event handler to redirect to my index page @OnEvent(value = "submit", component = "SearchForm") public Object searchCustomer() { return IndexPage.class; } On Sep 10, 2011, at 1:40 AM, Taha Hafeez wrote: Hi Lenny I handle this issue in a more generic way for all ajax calls. http://tapestry.1045711.n5.nabble.com/Tapestry-Zone-and-Expired-Session-td4634714.html#a4634757 On Sat, Sep 10, 2011 at 10:23 AM, Lenny Primak wrote: I cannot believe that no one has run into that issue. Seems like anyone that's using the AJAX Grid would face it. Please vote for https://issues.apache.org/jira/browse/TAP5-1634 if you care, or if anyone has a workaround, please suggest one. Thanks On Sep 2, 2011, at 5:24 PM, Lenny Primak wrote: Seems to me that this would be a common thing with any of the AJAX components. Should I open up a JIRA issue? On Fri, 02 Sep 2011 18:14:28 -0300, Lenny Primak wrote: I figured that was a simple one. Should not have thought so. all my questions are complicated, otherwise I would have not asked :) hehehe :) On Sep 2, 2011, at 5:11 PM, Thiago H. de Paula Figueiredo wrote: On Fri, 02 Sep 2011 17:43:42 -0300, Lenny Primak wrote: Oh you are here Thiago! I'm always here, but I don't know the answers for all questions nor the time to investigate them. (I wish I had). How about my Grid/Sessino invalidation session question? I have no idea . . . -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br On Sep 2, 2011, at 11:10 AM, Lenny Primak wrote: Hi, I've looked all over the Internet for this, but nothing works. I have a basic Grid pulling data from an Entity bean. Obviously, when session expires, I get the "there is no data to display" message. What I really want to do is to redirect to the current page, so the user gets to relogin and session gets re-established. Here's what I tried: @SuppressWarnings("unused") @OnEvent(value="inplaceUpdate", component="usersGrid") private Object ajaxPageChanged() { if(request.getSession(false) != null) { return null; } else { return ps.createPageRenderLink(LoginPage.class).; } } I get an exception: Caused by: java.lang.IllegalArgumentException: Event 'inplaceupdate'
Re: T5.3 Grid, inPlace Update and expired Sessions
Did anybody test tapestry-conversation under Tap 5.3 (beta 5?) I am getting ReferenceError: Can't find variable: ConversationModerator The ConversationModerator.js doesn't seem to get included into the Tapestry page, but the component is there. On Sep 10, 2011, at 12:29 PM, Lenny Primak wrote: > Thanks, Kalle, > I think this will work. > I would love, if its possible, for tap-security, perhaps? to be able to > redirect AJAX requests > correctly to the current page or login page in case the session expired. > That way, it would all work automatically, instead of showing ugly exception > on the screen. > I will try your method in the meanwhile, the session end warning sounds like > a good idea. > > On Sep 10, 2011, at 10:52 AM, Kalle Korhonen wrote: > >> On Sat, Sep 10, 2011 at 2:39 AM, Lenny Primak wrote: >>> Digging through this a bit deeper, there is an interaction going on here >>> with tapestry-security. >>> When the session expires, the user is no longer logged in, and thus >>> ajax call is being redirected to a login screen, thus the exceptions. >>> But the problem still remains the same, there seems to be no good way >>> to redirect the page to itself when the Grid does inPlace update, >>> and the session is no longer available. >>> Any more thoughts/ideas? >> >> Sounds like tapestry-security is doing the right thing, no? How I >> would solve the problem, is that either I wouldn't let the session to >> expire or warn the user that the session is about to expire, or a >> combination of both. If you added conversational scope, it'd be >> relatively easy to do (see >> http://tynamo.org/tapestry-conversations+guide for more info). >> >> Kalle >> >> >>> On Sep 10, 2011, at 4:38 AM, Lenny Primak wrote: >>> As a matter of fact, I can't get any sort of graceful degradation after session has expired. --- Screenshot // somewhere we trigger session invalidation request.getSession(false).invalidate(); // now lets try an AJAX event handler to redirect to my index page @OnEvent(value = "submit", component = "SearchForm") public Object searchCustomer() { return IndexPage.class; } On Sep 10, 2011, at 1:40 AM, Taha Hafeez wrote: > Hi Lenny > > I handle this issue in a more generic way for all ajax calls. > > http://tapestry.1045711.n5.nabble.com/Tapestry-Zone-and-Expired-Session-td4634714.html#a4634757 > > > > On Sat, Sep 10, 2011 at 10:23 AM, Lenny Primak > wrote: >> I cannot believe that no one has run into that issue. >> Seems like anyone that's using the AJAX Grid would face it. >> >> Please vote for https://issues.apache.org/jira/browse/TAP5-1634 >> if you care, or if anyone has a workaround, please suggest one. >> >> Thanks >> >> >> >> On Sep 2, 2011, at 5:24 PM, Lenny Primak wrote: >> >>> Seems to me that this would be a common thing with any of the AJAX >>> components. >>> Should I open up a JIRA issue? >>> >>> On Fri, 02 Sep 2011 18:14:28 -0300, Lenny Primak >>> wrote: >>> I figured that was a simple one. Should not have thought so. all my questions are complicated, otherwise I would have not asked :) >>> >>> hehehe :) >>> On Sep 2, 2011, at 5:11 PM, Thiago H. de Paula Figueiredo wrote: > On Fri, 02 Sep 2011 17:43:42 -0300, Lenny Primak > wrote: > >> Oh you are here Thiago! > > I'm always here, but I don't know the answers for all questions nor > the time to investigate them. (I wish I had). > >> How about my Grid/Sessino invalidation session question? > > I have no idea . . . > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, > developer, and instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br >>> On Sep 2, 2011, at 11:10 AM, Lenny Primak wrote: >>> Hi, I've looked all over the Internet for this, but nothing works. I have a basic Grid pulling data from an Entity bean. Obviously, when session expires, I get the "there is no data to display" message. What I really want to do is to redirect to the current page, so the user gets to relogin and session gets re-established. Here's what I tried: @SuppressWarnings("unused") @OnEvent(value="inplaceUpdate", component="usersGrid") private Object ajaxPageChanged() { if(request.getSession(false) != null) { return null; } else
Re: Is it possible to perform form submit after being redirected via a loginform?
I'm still struggling with this. I tried to extract all request parameters and then re-add them back as parameters to the Link I return back from a successful login but they disappear somewhere before I get to the actual form post. I can see that the request is a POST but the t:formdata is missing (along with any other parameters). I have tried to trace through the request handling but I can't really see where the parameters are dropped. I'll go for the next best thing for the moment and at least get the user back to the correct page but with some lost data. Regards, Joakim On Tue, Sep 6, 2011 at 6:46 AM, Joakim Olsson wrote: > You got it right. Then I would have to save all request parameters and > re-populate the form when the user gets back to the page. > > My problem-case is when the session has terminated due to inactivity > and then the bean in the session is lost as well. Maybe it's not > possible in that case. > > Thanks, > Joakim > > > On Tue, Sep 6, 2011 at 1:17 AM, nillehammer > wrote: >> Did I get it right? The user enters data into a form and submits. If he were >> logged in, you would forward to success page. But not being logged in you >> would like to do a round trip via login page and after sucessfull login >> forward to success page? >> >> You could store the values entered by the user in the bean that is bound to >> the form in the session. After sucessfull login you could forward to the >> form-page again. Not a full solution, but at least the user would not have >> to enter data again. >> >> - >> http://www.winfonet.eu >> -- >> View this message in context: >> http://tapestry.1045711.n5.nabble.com/Is-it-possible-to-perform-form-submit-after-being-redirected-via-a-loginform-tp4771930p4772413.html >> Sent from the Tapestry - User mailing list archive at Nabble.com. >> >> - >> 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: T5.3 Grid, inPlace Update and expired Sessions
Thanks, Kalle, I think this will work. I would love, if its possible, for tap-security, perhaps? to be able to redirect AJAX requests correctly to the current page or login page in case the session expired. That way, it would all work automatically, instead of showing ugly exception on the screen. I will try your method in the meanwhile, the session end warning sounds like a good idea. On Sep 10, 2011, at 10:52 AM, Kalle Korhonen wrote: > On Sat, Sep 10, 2011 at 2:39 AM, Lenny Primak wrote: >> Digging through this a bit deeper, there is an interaction going on here >> with tapestry-security. >> When the session expires, the user is no longer logged in, and thus >> ajax call is being redirected to a login screen, thus the exceptions. >> But the problem still remains the same, there seems to be no good way >> to redirect the page to itself when the Grid does inPlace update, >> and the session is no longer available. >> Any more thoughts/ideas? > > Sounds like tapestry-security is doing the right thing, no? How I > would solve the problem, is that either I wouldn't let the session to > expire or warn the user that the session is about to expire, or a > combination of both. If you added conversational scope, it'd be > relatively easy to do (see > http://tynamo.org/tapestry-conversations+guide for more info). > > Kalle > > >> On Sep 10, 2011, at 4:38 AM, Lenny Primak wrote: >> >>> As a matter of fact, I can't get any sort of graceful degradation after >>> session has expired. >>> >>> --- Screenshot >>> >>> >>> // somewhere we trigger session invalidation >>> request.getSession(false).invalidate(); >>> >>> >>> // now lets try an AJAX event handler to redirect to my index page >>> @OnEvent(value = "submit", component = "SearchForm") >>> public Object searchCustomer() >>> { >>> return IndexPage.class; >>> } >>> >>> >>> >>> On Sep 10, 2011, at 1:40 AM, Taha Hafeez wrote: >>> Hi Lenny I handle this issue in a more generic way for all ajax calls. http://tapestry.1045711.n5.nabble.com/Tapestry-Zone-and-Expired-Session-td4634714.html#a4634757 On Sat, Sep 10, 2011 at 10:23 AM, Lenny Primak wrote: > I cannot believe that no one has run into that issue. > Seems like anyone that's using the AJAX Grid would face it. > > Please vote for https://issues.apache.org/jira/browse/TAP5-1634 > if you care, or if anyone has a workaround, please suggest one. > > Thanks > > > > On Sep 2, 2011, at 5:24 PM, Lenny Primak wrote: > >> Seems to me that this would be a common thing with any of the AJAX >> components. >> Should I open up a JIRA issue? >> >> On Fri, 02 Sep 2011 18:14:28 -0300, Lenny Primak >> wrote: >> >>> I figured that was a simple one. Should not have thought so. >>> all my questions are complicated, otherwise I would have not asked :) >> >> hehehe :) >> >>> >>> On Sep 2, 2011, at 5:11 PM, Thiago H. de Paula Figueiredo wrote: >>> On Fri, 02 Sep 2011 17:43:42 -0300, Lenny Primak wrote: > Oh you are here Thiago! I'm always here, but I don't know the answers for all questions nor the time to investigate them. (I wish I had). > How about my Grid/Sessino invalidation session question? I have no idea . . . -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br >> On Sep 2, 2011, at 11:10 AM, Lenny Primak wrote: >> >>> Hi, >>> I've looked all over the Internet for this, but nothing works. >>> >>> I have a basic Grid pulling data from an Entity bean. >>> Obviously, when session expires, I get the "there is no data to >>> display" message. >>> What I really want to do is to redirect to the current page, so the >>> user gets to relogin and session >>> gets re-established. >>> >>> Here's what I tried: >>> >>> @SuppressWarnings("unused") >>> @OnEvent(value="inplaceUpdate", component="usersGrid") >>> private Object ajaxPageChanged() >>> { >>> if(request.getSession(false) != null) >>> { >>> return null; >>> } >>> else >>> { >>> return ps.createPageRenderLink(LoginPage.class).; >>> } >>> } >>> >>> I get an exception: >>> Caused by: java.lang.IllegalArgumentException: Event 'inplaceupdate' >>> from test/TapPage:usersgrid.pager received an event handler method >>> return value of /com.bettaway_baw-website_war_1.2/loginpage. This type >>> of event does not support return value
Re: T5.3 Grid, inPlace Update and expired Sessions
On Sat, Sep 10, 2011 at 2:39 AM, Lenny Primak wrote: > Digging through this a bit deeper, there is an interaction going on here with > tapestry-security. > When the session expires, the user is no longer logged in, and thus > ajax call is being redirected to a login screen, thus the exceptions. > But the problem still remains the same, there seems to be no good way > to redirect the page to itself when the Grid does inPlace update, > and the session is no longer available. > Any more thoughts/ideas? Sounds like tapestry-security is doing the right thing, no? How I would solve the problem, is that either I wouldn't let the session to expire or warn the user that the session is about to expire, or a combination of both. If you added conversational scope, it'd be relatively easy to do (see http://tynamo.org/tapestry-conversations+guide for more info). Kalle > On Sep 10, 2011, at 4:38 AM, Lenny Primak wrote: > >> As a matter of fact, I can't get any sort of graceful degradation after >> session has expired. >> >> --- Screenshot >> >> >> // somewhere we trigger session invalidation >> request.getSession(false).invalidate(); >> >> >> // now lets try an AJAX event handler to redirect to my index page >> @OnEvent(value = "submit", component = "SearchForm") >> public Object searchCustomer() >> { >> return IndexPage.class; >> } >> >> >> >> On Sep 10, 2011, at 1:40 AM, Taha Hafeez wrote: >> >>> Hi Lenny >>> >>> I handle this issue in a more generic way for all ajax calls. >>> >>> http://tapestry.1045711.n5.nabble.com/Tapestry-Zone-and-Expired-Session-td4634714.html#a4634757 >>> >>> >>> >>> On Sat, Sep 10, 2011 at 10:23 AM, Lenny Primak >>> wrote: I cannot believe that no one has run into that issue. Seems like anyone that's using the AJAX Grid would face it. Please vote for https://issues.apache.org/jira/browse/TAP5-1634 if you care, or if anyone has a workaround, please suggest one. Thanks On Sep 2, 2011, at 5:24 PM, Lenny Primak wrote: > Seems to me that this would be a common thing with any of the AJAX > components. > Should I open up a JIRA issue? > > On Fri, 02 Sep 2011 18:14:28 -0300, Lenny Primak > wrote: > >> I figured that was a simple one. Should not have thought so. >> all my questions are complicated, otherwise I would have not asked :) > > hehehe :) > >> >> On Sep 2, 2011, at 5:11 PM, Thiago H. de Paula Figueiredo wrote: >> >>> On Fri, 02 Sep 2011 17:43:42 -0300, Lenny Primak >>> wrote: >>> Oh you are here Thiago! >>> >>> I'm always here, but I don't know the answers for all questions nor the >>> time to investigate them. (I wish I had). >>> How about my Grid/Sessino invalidation session question? >>> >>> I have no idea . . . >>> >>> -- >>> Thiago H. de Paula Figueiredo >>> Independent Java, Apache Tapestry 5 and Hibernate consultant, >>> developer, and instructor >>> Owner, Ars Machina Tecnologia da Informação Ltda. >>> http://www.arsmachina.com.br > On Sep 2, 2011, at 11:10 AM, Lenny Primak wrote: > >> Hi, >> I've looked all over the Internet for this, but nothing works. >> >> I have a basic Grid pulling data from an Entity bean. >> Obviously, when session expires, I get the "there is no data to display" >> message. >> What I really want to do is to redirect to the current page, so the user >> gets to relogin and session >> gets re-established. >> >> Here's what I tried: >> >> @SuppressWarnings("unused") >> @OnEvent(value="inplaceUpdate", component="usersGrid") >> private Object ajaxPageChanged() >> { >> if(request.getSession(false) != null) >> { >> return null; >> } >> else >> { >> return ps.createPageRenderLink(LoginPage.class).; >> } >> } >> >> I get an exception: >> Caused by: java.lang.IllegalArgumentException: Event 'inplaceupdate' >> from test/TapPage:usersgrid.pager received an event handler method >> return value of /com.bettaway_baw-website_war_1.2/loginpage. This type >> of event does not support return values from event handler methods. >> at >> org.apache.tapestry5.internal.util.NotificationEventCallback.handleResult(NotificationEventCallback.java:39) >> >> Thanks for all your help! > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >>> >>> -- >>> Regards >>> >>> Taha Hafeez Siddiqi (tawus) >>> http://tawus.wordpress.com >>> >>> - >>> To unsu
Re: Grid disable sorting mixin
There's a gotcha with the Mixin that can generate an Exception if used on a Grid with no data. Here's the complete working Mixin; @MixinAfter public class DisableGridSorting { @InjectContainer private Grid grid; void setupRender() { if (grid.getDataSource().getAvailableRows() == 0) return; BeanModel model = grid.getDataModel(); List propertyNames = model.getPropertyNames(); for (String propName : propertyNames) { PropertyModel propModel = model.get(propName); propModel.sortable(false); } } } Thought I'd resurrect (and contribute to) this thread as I find the Mixin really handy. Steve. On 25 May 2011 21:29, Steve Eynon wrote: > Hi, > > It works for me! > > Although I found I needed to use the @MixinAfter class annotation for > I was adding extra columns. > > Steve. > > > 2011/2/26 Vjeran Marcinko : >> Hello all, >> >> I developed simple mixin that disables sorting for any Grid. I didn't test >> it extensively, but it seems to work, so if anyone is interested here it is: >> >> import org.apache.tapestry5.annotations.InjectContainer; >> import org.apache.tapestry5.beaneditor.BeanModel; >> import org.apache.tapestry5.beaneditor.PropertyModel; >> import org.apache.tapestry5.corelib.components.Grid; >> >> import java.util.List; >> >> >> public class GridSortingDisabled { >> @InjectContainer >> private Grid grid; >> >> private void setupRender() { >> BeanModel model = grid.getDataModel(); >> List propertyNames = model.getPropertyNames(); >> for (String propName : propertyNames) { >> PropertyModel propModel = model.get(propName); >> propModel.sortable(false); >> } >> } >> } >> >> >> Cheers, >> Vjeran >> >> >> - >> 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: T5.3 Grid, inPlace Update and expired Sessions
Digging through this a bit deeper, there is an interaction going on here with tapestry-security. When the session expires, the user is no longer logged in, and thus ajax call is being redirected to a login screen, thus the exceptions. But the problem still remains the same, there seems to be no good way to redirect the page to itself when the Grid does inPlace update, and the session is no longer available. Any more thoughts/ideas? On Sep 10, 2011, at 4:38 AM, Lenny Primak wrote: > As a matter of fact, I can't get any sort of graceful degradation after > session has expired. > > --- Screenshot > > > // somewhere we trigger session invalidation > request.getSession(false).invalidate(); > > > // now lets try an AJAX event handler to redirect to my index page > @OnEvent(value = "submit", component = "SearchForm") > public Object searchCustomer() > { > return IndexPage.class; > } > > > > On Sep 10, 2011, at 1:40 AM, Taha Hafeez wrote: > >> Hi Lenny >> >> I handle this issue in a more generic way for all ajax calls. >> >> http://tapestry.1045711.n5.nabble.com/Tapestry-Zone-and-Expired-Session-td4634714.html#a4634757 >> >> >> >> On Sat, Sep 10, 2011 at 10:23 AM, Lenny Primak >> wrote: >>> I cannot believe that no one has run into that issue. >>> Seems like anyone that's using the AJAX Grid would face it. >>> >>> Please vote for https://issues.apache.org/jira/browse/TAP5-1634 >>> if you care, or if anyone has a workaround, please suggest one. >>> >>> Thanks >>> >>> >>> >>> On Sep 2, 2011, at 5:24 PM, Lenny Primak wrote: >>> Seems to me that this would be a common thing with any of the AJAX components. Should I open up a JIRA issue? On Fri, 02 Sep 2011 18:14:28 -0300, Lenny Primak wrote: > I figured that was a simple one. Should not have thought so. > all my questions are complicated, otherwise I would have not asked :) hehehe :) > > On Sep 2, 2011, at 5:11 PM, Thiago H. de Paula Figueiredo wrote: > >> On Fri, 02 Sep 2011 17:43:42 -0300, Lenny Primak >> wrote: >> >>> Oh you are here Thiago! >> >> I'm always here, but I don't know the answers for all questions nor the >> time to investigate them. (I wish I had). >> >>> How about my Grid/Sessino invalidation session question? >> >> I have no idea . . . >> >> -- >> Thiago H. de Paula Figueiredo >> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, >> and instructor >> Owner, Ars Machina Tecnologia da Informação Ltda. >> http://www.arsmachina.com.br On Sep 2, 2011, at 11:10 AM, Lenny Primak wrote: > Hi, > I've looked all over the Internet for this, but nothing works. > > I have a basic Grid pulling data from an Entity bean. > Obviously, when session expires, I get the "there is no data to display" > message. > What I really want to do is to redirect to the current page, so the user > gets to relogin and session > gets re-established. > > Here's what I tried: > > @SuppressWarnings("unused") > @OnEvent(value="inplaceUpdate", component="usersGrid") > private Object ajaxPageChanged() > { > if(request.getSession(false) != null) > { > return null; > } > else > { > return ps.createPageRenderLink(LoginPage.class).; > } > } > > I get an exception: > Caused by: java.lang.IllegalArgumentException: Event 'inplaceupdate' from > test/TapPage:usersgrid.pager received an event handler method return > value of /com.bettaway_baw-website_war_1.2/loginpage. This type of event > does not support return values from event handler methods. > at > org.apache.tapestry5.internal.util.NotificationEventCallback.handleResult(NotificationEventCallback.java:39) > > Thanks for all your help! >>> >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >> >> >> >> -- >> Regards >> >> Taha Hafeez Siddiqi (tawus) >> http://tawus.wordpress.com >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >
Re: T5.3 Grid, inPlace Update and expired Sessions
I tried the way Thiago suggested in the mentioned thread, but that does not work for the inPlace grid. I really, REALLY, really do not want to create/compile my own version of patched tapestry and patch tapestry.js isn't that great of an idea. - Error --- SEVERE: Event 'inplaceupdate' from test/TapPage:usersgrid.pager received an event handler method return value of com.baw.website.pages.test.TapPage@1ca6705. This type of event does not support return values from event handler methods. SEVERE: Operations trace: SEVERE: [ 1] Triggering event 'action' on test/TapPage:usersgrid.pager SEVERE: [ 2] Triggering event 'inplaceupdate' on test/TapPage:usersgrid.pager SEVERE: [ 3] Handling result from method com.baw.website.pages.test.TapPage.onException(java.lang.Throwable). - CODE --- @SuppressWarnings("unused") @OnEvent(value="inplaceUpdate", component="usersGrid") @AfterRender private void ajaxPageChanged() throws SessionException { throw new SessionException("No Session"); } private Object onException(Throwable cause) { // try to redirect to the current page return this; } On Sep 10, 2011, at 1:40 AM, Taha Hafeez wrote: > Hi Lenny > > I handle this issue in a more generic way for all ajax calls. > > http://tapestry.1045711.n5.nabble.com/Tapestry-Zone-and-Expired-Session-td4634714.html#a4634757 > > > > On Sat, Sep 10, 2011 at 10:23 AM, Lenny Primak wrote: >> I cannot believe that no one has run into that issue. >> Seems like anyone that's using the AJAX Grid would face it. >> >> Please vote for https://issues.apache.org/jira/browse/TAP5-1634 >> if you care, or if anyone has a workaround, please suggest one. >> >> Thanks >> >> >> >> On Sep 2, 2011, at 5:24 PM, Lenny Primak wrote: >> >>> Seems to me that this would be a common thing with any of the AJAX >>> components. >>> Should I open up a JIRA issue? >>> >>> On Fri, 02 Sep 2011 18:14:28 -0300, Lenny Primak >>> wrote: >>> I figured that was a simple one. Should not have thought so. all my questions are complicated, otherwise I would have not asked :) >>> >>> hehehe :) >>> On Sep 2, 2011, at 5:11 PM, Thiago H. de Paula Figueiredo wrote: > On Fri, 02 Sep 2011 17:43:42 -0300, Lenny Primak > wrote: > >> Oh you are here Thiago! > > I'm always here, but I don't know the answers for all questions nor the > time to investigate them. (I wish I had). > >> How about my Grid/Sessino invalidation session question? > > I have no idea . . . > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, > and instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br >>> On Sep 2, 2011, at 11:10 AM, Lenny Primak wrote: >>> Hi, I've looked all over the Internet for this, but nothing works. I have a basic Grid pulling data from an Entity bean. Obviously, when session expires, I get the "there is no data to display" message. What I really want to do is to redirect to the current page, so the user gets to relogin and session gets re-established. Here's what I tried: @SuppressWarnings("unused") @OnEvent(value="inplaceUpdate", component="usersGrid") private Object ajaxPageChanged() { if(request.getSession(false) != null) { return null; } else { return ps.createPageRenderLink(LoginPage.class).; } } I get an exception: Caused by: java.lang.IllegalArgumentException: Event 'inplaceupdate' from test/TapPage:usersgrid.pager received an event handler method return value of /com.bettaway_baw-website_war_1.2/loginpage. This type of event does not support return values from event handler methods. at org.apache.tapestry5.internal.util.NotificationEventCallback.handleResult(NotificationEventCallback.java:39) Thanks for all your help! >>> >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> > > > > -- > Regards > > Taha Hafeez Siddiqi (tawus) > http://tawus.wordpress.com > > - > 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