Re: Zone error after I have updated to Tapestry 5.2.6
This might help http://tawus.wordpress.com/2011/04/16/tapestry-magic-2-ajax-with-graceful-degradation/ On Fri, Sep 9, 2011 at 11:28 AM, Jonathan Barker jonathan.theit...@gmail.com wrote: The error looks a lot like what you get when you are expecting an Ajax request (and so return a Block), but instead get a regular page request where you would want to return null or a Page. As a general practice, try to allow for graceful degradation in the absence of javascript by doing the check if (request.isXHR()) before returning a block or zone body. I've been surprised a couple of times. I hope that helps. Regards, Jonathan On Thu, Sep 8, 2011 at 12:31 PM, Javicha javilan...@gmail.com wrote: no, that's not the error. All is well defined. I have declared the zone: t:zone t:id=searchPatientResultZone And the actionlinks refer to this zone: href=# t:type=ActionLink t:id=previousPatientLink t:zone=searchPatientResultZone href=# t:type=ActionLink t:id=nextPatientLink t:zone=searchPatientResultZone As I said before, this worked before the upgrade. I have not changed any .java and .tml files. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Zone-error-after-I-have-updated-to-Tapestry-5-2-6-tp4782821p4783107.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 -- Jonathan Barker ITStrategic -- 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: pages vs components... use model still the same or has it evolved any ?
This is less to do with Tapestry and more to do with general OO practises and your personal preference towards it. e.g. When writing a Java class, you could write everything in a single method, but to gain efficient reuse you usually refactor it out into multiple methods. Similarly, you split your pages into components to gain reuse. And for practical reuse, both methods and components need parameters. If in the past you were writing components that had so many parameters that they confused you, then I would suggest next time you try a different design approach. Steve. On 9 September 2011 09:30, Ken in Nashua kcola...@live.com wrote: I guess I am wondered in other peoples ideas over pages and components. Though my take on them... pages NEED to persist properties across request boundaries... and components persist those page properties thru their well defined parameter interface. Does this mean that components should never have properties ? Looking forward to light on this subject that might adhere to a natural model... thanks From: kcola...@live.com To: users@tapestry.apache.org Subject: pages vs components... use model still the same or has it evolved any ? Date: Thu, 8 Sep 2011 21:25:23 -0400 An exerpt from a 2004 tapestry guide... A component's parameters are bound to properties of the enclosing page. The component is allowed to read its parameter, to access the page property the parameter is bound to. A component may also update its parameter, to force a change to the bound page property. --- Does this imply that components do not have properties ? or should not ?... I know tapestry gives us enough rope to hang ourselves with Is there a politically correct semantic for pages vs components now... with tapestry5 or is the concept the same since older versions ? If anyone could elaborate on a general use model for components vs pages that would be helpful. I have found some page/component code cluttered up with so many properties and parameters not knowing which to use and when... whereby either of these have both pages and properties If anyone could elaborate on a general use model for components vs pages that would be helpful. Thanks Ken - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: pages vs components... use model still the same or has it evolved any ?
As Steve mentions its an evolution of personal best practice for your coding style. My personal taste through the years evolved through trial and error, more components is not always better but components to me work best when devoid of state, i.e.: breaking out the mechanics into the component and leaving the state in the page, this makes for wonderful reuse and very generic components reusable across applications without change. Cheers, Peter - Original Message - From: Steve Eynon steve.ey...@alienfactory.co.uk To: Tapestry users users@tapestry.apache.org Sent: Friday, 9 September, 2011 10:22:59 GMT +02:00 Athens, Bucharest, Istanbul Subject: Re: pages vs components... use model still the same or has it evolved any ? This is less to do with Tapestry and more to do with general OO practises and your personal preference towards it. e.g. When writing a Java class, you could write everything in a single method, but to gain efficient reuse you usually refactor it out into multiple methods. Similarly, you split your pages into components to gain reuse. And for practical reuse, both methods and components need parameters. If in the past you were writing components that had so many parameters that they confused you, then I would suggest next time you try a different design approach. Steve. On 9 September 2011 09:30, Ken in Nashua kcola...@live.com wrote: I guess I am wondered in other peoples ideas over pages and components. Though my take on them... pages NEED to persist properties across request boundaries... and components persist those page properties thru their well defined parameter interface. Does this mean that components should never have properties ? Looking forward to light on this subject that might adhere to a natural model... thanks From: kcola...@live.com To: users@tapestry.apache.org Subject: pages vs components... use model still the same or has it evolved any ? Date: Thu, 8 Sep 2011 21:25:23 -0400 An exerpt from a 2004 tapestry guide... A component's parameters are bound to properties of the enclosing page. The component is allowed to read its parameter, to access the page property the parameter is bound to. A component may also update its parameter, to force a change to the bound page property. --- Does this imply that components do not have properties ? or should not ?... I know tapestry gives us enough rope to hang ourselves with Is there a politically correct semantic for pages vs components now... with tapestry5 or is the concept the same since older versions ? If anyone could elaborate on a general use model for components vs pages that would be helpful. I have found some page/component code cluttered up with so many properties and parameters not knowing which to use and when... whereby either of these have both pages and properties If anyone could elaborate on a general use model for components vs pages that would be helpful. Thanks Ken - 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: 5.3-beta-5
Oh, are you still using Maven? My condolences; You mean, mean man! :) Thanks for your response to my IOC Problem, turns out I can't get to the ServletContext so for now I'll strategically lower the priority of this validator :) -Original Message- From: Howard Lewis Ship [mailto:hls...@gmail.com] Sent: Freitag, 9. September 2011 00:48 To: Tapestry users Subject: 5.3-beta-5 FYI, I just created the 5.3-beta-5 preview release. See notes on how to use it: http://tapestry.apache.org/2011/08/27/tapestry-53-beta-preview.html -- 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: 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: Localization Problems
Hi Christian, Thank you for taking time to help. I try to solve my problem using second approach from your suggestion. Creating LocalizationDispatcher and register it before PageRender. I try to run my application, it seems rendering wasn't happened (blank page is returned). Here is my code snippet. public class LocalizationDispatcher implements Dispatcher { private final PersistentLocale persistentLocale; public LocalizationDispatcher(PersistentLocale persistentLocale) { this.persistentLocale = persistentLocale; } public boolean dispatch(Request request, Response response) throws IOException { if (!persistentLocale.isSet()) { persistentLocale.set(new Locale(in, ID)); } return true; } } And register it in AppModule here. public static void contributeMasterDispatcher(OrderedConfigurationDispatcher configuration) { configuration.addInstance(Localization, LocalizationDispatcher.class, before:PageRender); } What seems to wrong here ? Thanks, Rendy. On Fri, Sep 9, 2011 at 12:26 AM, Christian Köberl tapestry.christian.koeb...@gmail.com wrote: 2011-09-08 13:22, Rendy Tapestry: Yes, I just set as you do, but it doesn't work. This is because what browser send through request header is US locale. Based on tapestry mechanism looking up for locale, it will search the nearest locale that is en. That why ordering like that doesn't work. Any other idea ? Tapestry's best guess is to use the browser's locale - how else to find an initial Locale? You could decorate or replace LocalizationSetter. ComponentEventLinkEncoder calls LocalizationSetter#**setLocaleFromLocaleName where you could insert your own code returning the default you want. Another way could be to check PersistentLocale and if not isSet() set your own default in a Request dispatcher (before PageRenderDispatcher). -- Chris --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Localization Problems
Hi Thiago, Thanks for such fast response, after setting it to false, my page is showing up again but, the solution still not working. For example, if I have page named, test.tml and 2 component message catalog test.properties and test_in_ID.properties, after setting PersistentLocale to in_ID, tapestry still picking value from test.properties. What might be wrong with my code ? Thanks, Rendy. On Fri, Sep 9, 2011 at 11:37 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Fri, 09 Sep 2011 12:54:23 -0300, Rendy Tapestry rendy.tapes...@gmail.com wrote: Hi Christian, Hi! public class LocalizationDispatcher implements Dispatcher { private final PersistentLocale persistentLocale; public LocalizationDispatcher(**PersistentLocale persistentLocale) { this.persistentLocale = persistentLocale; } public boolean dispatch(Request request, Response response) throws IOException { if (!persistentLocale.isSet()) { persistentLocale.set(new Locale(in, ID)); } return true; } } It should return false (i.e. this dispatcher didn't generate an answer). -- 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
Run javascript after a zone is updated
I have a table with many cells being updated using ajax calls. In the block returned by the ajax call, I conditionally run some java script to style the td and div in which the response is rendered. For a reason, this javascript isn't executed well. But I when I run the returned script manually on friebug after the cell is rendered, It causes the desired effect !! May be the dom isn't ready for the script to run ? I'm confused ! -- Regards, Muhammad Gelbana Java Developer - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Localization Problems
I am afraid that such solution won't work because I read this paragraph from documentation : You will see the new locale take effect on the next request. If it is changed in a component event request (which is typical), the new locale will be used in the subsequent page render request. Can anyone explain that this approach will work for my problem or not ? Thanks, Rendy. On Sat, Sep 10, 2011 at 12:02 AM, Rendy Tapestry rendy.tapes...@gmail.comwrote: Hi Thiago, Thanks for such fast response, after setting it to false, my page is showing up again but, the solution still not working. For example, if I have page named, test.tml and 2 component message catalog test.properties and test_in_ID.properties, after setting PersistentLocale to in_ID, tapestry still picking value from test.properties. What might be wrong with my code ? Thanks, Rendy. On Fri, Sep 9, 2011 at 11:37 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Fri, 09 Sep 2011 12:54:23 -0300, Rendy Tapestry rendy.tapes...@gmail.com wrote: Hi Christian, Hi! public class LocalizationDispatcher implements Dispatcher { private final PersistentLocale persistentLocale; public LocalizationDispatcher(**PersistentLocale persistentLocale) { this.persistentLocale = persistentLocale; } public boolean dispatch(Request request, Response response) throws IOException { if (!persistentLocale.isSet()) { persistentLocale.set(new Locale(in, ID)); } return true; } } It should return false (i.e. this dispatcher didn't generate an answer). -- 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
Editing HTML 5 TMLs with DreamWeaver
Please vote for this issue: https://issues.apache.org/jira/browse/TAP5-840 if you want DreamWeaver, etc. to be able to edit HTML 5 templates. Thanks! Currently to support HTML character references (e.g. copy;) you need to put a HTML Doctype at the top of the TML file. e.g. !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; However for HTML 5 they have stopped using XML doctypes and instead use !DOCTYPE html If you change tapestry page to use this you can no longer use entities as the XML parser doesn't know what to do. Ideally there should be some kind of logic that detects !DOCTYPE html and include a suitable DTD to resolve the common HTML entities. The HTML 5 specification defines the allowed named character references -http://dev.w3.org/html5/spec/Overview.html#named-character-references. There doesn't seem to be a DTD of allowed references maintained anymore.
Re: T5.3 Grid, inPlace Update and expired Sessions
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 lpri...@hope.nyc.ny.us 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 lpri...@hope.nyc.ny.us 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
Re: T5.3 Grid, inPlace Update and expired Sessions
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 lpri...@hope.nyc.ny.us 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 lpri...@hope.nyc.ny.us 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 lpri...@hope.nyc.ny.us 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
Thanks Taha. I do think that this case should be handled by tapestry correctly by default with no patches or hacks. It's a very simple case and very common one as well. I will try the onExceotion approach but not sure it will work because the component is actually internal to the grid and not exposed to the outside world. On Sep 10, 2011, at 1:40 AM, Taha Hafeez tawus.tapes...@gmail.com 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 lpri...@hope.nyc.ny.us 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 lpri...@hope.nyc.ny.us 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 lpri...@hope.nyc.ny.us 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