T5.3 customizing BeanEditForm's cancel button label
Guys, this might be a silly question but I'm trying to figure out how to customize the text of the Cancel button within a BeanEditForm. I believe the "cancel" boolean attribute was introduced in T5.2 but unlike "submitLabel" there's no "cancelLabel" property to override the default text. This also leads me to another question. Is it possible to override the submit and cancel labels implicitly by including a special-formatted string in the application message catalog? Using "submit-label" or "cancel-label" in app.properties seems to have no effect (unless you specify submitLabel="message:submit-label" for the submit button of course, but I don't see a way to do this for the cancel button). I may be overlooking something obvious (I googled for quite a while...) so sorry if my question is silly and thanks for guidance in advance! Rado
Re: Tapestry-Boostrap Alpha 2 available
Barry, I really love your work on the tapestry-bootstrap and I'm just trying to use it for one of our projects. I'm using the latest snapshot jar of the library and so far everything worked nicely but now I'm trying to use the bootstrap supported help-block within a BeanEditForm. I was looking at tapestry-boostrap to see if this isn't already supported and found the BootstrapFrameworkVisitor.addHelp method that's supposed to add a after an input element if it finds a message matching input's name with a -help suffix. I've tried this but can't make it work. Imagine a BeanEditForm for a User object with a lastName property. I have 2 properties defined in the app.properties file - lastName-label, and lastName-help. While lastName-label is being used for the input field's label as expected, the lastName-help doesn't have any effect. I guess my main question is whether this is supposed to work this way or am I doing something stupid? Btw I'm using form-horizontal style and the form is properly updated by the tapestry-bootstrap module to use appropriate styles instead of the default Tapestry styles. Thanks for any guidance in advance! Rado On Wed, Apr 4, 2012 at 1:37 PM, trsvax wrote: > After some good feedback I'm ready for the 2nd alpha release. > > Tapestry-Bootstrap is based on the latest Twitter Bootstrap 2.0.2 > http://twitter.github.com/bootstrap/index.htm > > New features include: > > 1. Works with JQuerySymbolConstants.SUPPRESS_PROTOTYPE, "false" > 2. By default will not modify existing Tapestry components. > 3. You can now mix/match Tapestry/Bootstrap CSS and Prototype/jQuery JS > 4. More components > 5. Uses a mapped configuration for defaults > 6. Uses a chain of command to implement DOM rewriting > > The previous version was all in Bootstrap/jQuery. Now you can add the > module > and just use what you want. It also easy to override various defaults and > even plug in your own DOM rewriting providers. > > I've also uploaded the jar file to > https://github.com/trsvax/tapestry-bootstrap/downloads so you don't need > to > build it. The only dependency is tapestry5-jquery. > > Check out the ReadMe and > > https://github.com/trsvax/tapestry-bootstrap/tree/master/src/test/resources/com/trsvax/bootstrap > for more info. > > I've got this running on a couple of sites and I think this will be the > last > Alpha so get your comments in. I'd like to freeze the APIs with a Beta > release around the end of April. > > FYI: I've found Twitter Bootstrap to be reliable and easy to use. There is > a > reason they have over 25,000 watchers on github. Also tapestry5-jquery is > great. > > If you find bugs or want new features please use the github bug tracker. > > > Thanks > Barry > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Tapestry-Boostrap-Alpha-2-available-tp5617508p5617508.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: Compiled CSS
Me too! I just started playing with LessCSS tis week and it seems really interesting. Rado On Thu, Oct 6, 2011 at 2:03 PM, Toby O'Rourke wrote: > Wow! I'd certainly be interested to see what you've done > > Thanks, > > Toby. > > On 06/10/2011 12:54, "Cezary Biernacki" wrote: > > >Hi, > >I have implemented integration LessCSS and CoffeeScript compilers with > >Tapestry 5.2. Actually most of it was porting necessary features (i.e. > >support of ResourceTransformer-s) from 5.3 and the integration should be > >compatible with Tapestry 5.3. I can open source it if there is enough > >interest. > > > >Best regards, > >Cezary > > > > > >On Thu, Oct 6, 2011 at 9:45 AM, Stephan Windmüller < > >stephan.windmuel...@tu-dortmund.de> wrote: > > > >> On 06.10.2011 00:58, Howard Lewis Ship wrote: > >> > >> > No progress yet ... it was more important to get 5.3 out than to add > >> > this feature. I expect to add it in Tapestry 5.4. > >> > >> I hope it will be an optional feature. The lesscss-site looks very ugly > >> with JavaScript disabled. > >> > >> - Stephan > >> > >> > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: [5.3] Possible issue with entity names in HTML attributes
Thiago, Uli, Josh - thank you all. Silly me! Got it now... In my defense, since Josh asked, I have actually tried it - but only in a browser (by copying and pasting the encoded URL) where such URL wouldn't work for me in Chrome (target PHP page would see a variable named "amp;2" instead of "2") but when I use an encoded URL in a Tapestry template, it actually works as expected. Anyway, all the fuss for such a stupid mistake... one learns every day! Thank you for your patience and help. I know some online forums where people would send me to hell for this, instead of patiently answering and explaining. :-) Rado On Wed, Oct 5, 2011 at 5:01 PM, Ulrich Stärk wrote: > Please go to http://validator.w3.org/ and see for yourself. The & in the > URL is invalid HTML4.01 as > well as invalid XHTML1.0. It has to be encoded as "&". > > Uli > > On 05.10.2011 16:36, Radoslav Bielik wrote: > > Uli, thank you for your response. I'm confused though. The ampersand is a > > regular element of the URL and a separator of 2 querystring variables. If > it > > was encoded as you suggest, then the target server wouldn't recognize > those > > as 2 separate variables (in case of Google Web Fonts those variables are > > "family" and "subset"). > > > > Thanks, > > Rado > > > > On Wed, Oct 5, 2011 at 4:28 PM, Ulrich Stärk wrote: > > > >> This is absolutely correct behaviour since the url in the href attribute > is > >> not encoded as it should > >> be. Replace '&' with '&' and you should be fine. > >> > >> Uli > >> > >> On 05.10.2011 16:14, Immutability wrote: > >>> Hi everyone :) > >>> > >>> While playing with Google Web Fonts today > http://www.google.com/webfontI > >>> ran into an interesting issue with Tapestry 5.3 (currently running beta > >> 10). > >>> When a possible entity name is encountered by Tapestry within a > template > >>> file (TML) even if it resides within an element attribute, it will > raise > >> an > >>> exception. For those unfamiliar with Google Web Fonts, it basically > >>> generates a LINK element pointing to a CSS style hosted by Google. The > >> HREF > >>> contains various stuff such as font family and character sets, here's > an > >>> example: > >>> > >>> http://fonts.googleapis.com/css?family=Francois+One&subset=latin,latin-ext > >> " > >>> rel="stylesheet" type="text/css"/> > >>> > >>> Now - if you do this, Tapestry will scream: > >>> > >>> Failure parsing template > >> classpath:sk/jazd/kniha/components/SiteBorder.tml: > >>> The reference to entity "subset" must end with the ';' delimiter. > >>> > >>> This seems like a similar issue to the old JavaScript problem, where an > >>> ampersand within a string will also cause an error. What do you guys > >> think? > >>> Is this to be expected, or is it a bug that should be addressed (i.e. > not > >>> check entities within quoted element attributes)? > >>> > >>> Of course, as always (well - most of the time) with Tapestry, there's > an > >>> easy workaround: > >>> > >>> > >>> > >>> and in your code: > >>> > >>> public String getGoogleFontStyle() > >>> { > >>> return " > >>> > >> > http://fonts.googleapis.com/css?family=Francois+One&subset=latin,latin-ext > >> "; > >>> } > >>> > >>> Rado > >>> > >> - > >> 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] Possible issue with entity names in HTML attributes
Uli, thank you for your response. I'm confused though. The ampersand is a regular element of the URL and a separator of 2 querystring variables. If it was encoded as you suggest, then the target server wouldn't recognize those as 2 separate variables (in case of Google Web Fonts those variables are "family" and "subset"). Thanks, Rado On Wed, Oct 5, 2011 at 4:28 PM, Ulrich Stärk wrote: > This is absolutely correct behaviour since the url in the href attribute is > not encoded as it should > be. Replace '&' with '&' and you should be fine. > > Uli > > On 05.10.2011 16:14, Immutability wrote: > > Hi everyone :) > > > > While playing with Google Web Fonts today http://www.google.com/webfontI > > ran into an interesting issue with Tapestry 5.3 (currently running beta > 10). > > When a possible entity name is encountered by Tapestry within a template > > file (TML) even if it resides within an element attribute, it will raise > an > > exception. For those unfamiliar with Google Web Fonts, it basically > > generates a LINK element pointing to a CSS style hosted by Google. The > HREF > > contains various stuff such as font family and character sets, here's an > > example: > > > > http://fonts.googleapis.com/css?family=Francois+One&subset=latin,latin-ext > " > > rel="stylesheet" type="text/css"/> > > > > Now - if you do this, Tapestry will scream: > > > > Failure parsing template > classpath:sk/jazd/kniha/components/SiteBorder.tml: > > The reference to entity "subset" must end with the ';' delimiter. > > > > This seems like a similar issue to the old JavaScript problem, where an > > ampersand within a string will also cause an error. What do you guys > think? > > Is this to be expected, or is it a bug that should be addressed (i.e. not > > check entities within quoted element attributes)? > > > > Of course, as always (well - most of the time) with Tapestry, there's an > > easy workaround: > > > > > > > > and in your code: > > > > public String getGoogleFontStyle() > > { > > return " > > > http://fonts.googleapis.com/css?family=Francois+One&subset=latin,latin-ext > "; > > } > > > > Rado > > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
[5.3] Possible issue with entity names in HTML attributes
Hi everyone :) While playing with Google Web Fonts today http://www.google.com/webfont I ran into an interesting issue with Tapestry 5.3 (currently running beta 10). When a possible entity name is encountered by Tapestry within a template file (TML) even if it resides within an element attribute, it will raise an exception. For those unfamiliar with Google Web Fonts, it basically generates a LINK element pointing to a CSS style hosted by Google. The HREF contains various stuff such as font family and character sets, here's an example: http://fonts.googleapis.com/css?family=Francois+One&subset=latin,latin-ext"; rel="stylesheet" type="text/css"/> Now - if you do this, Tapestry will scream: Failure parsing template classpath:sk/jazd/kniha/components/SiteBorder.tml: The reference to entity "subset" must end with the ';' delimiter. This seems like a similar issue to the old JavaScript problem, where an ampersand within a string will also cause an error. What do you guys think? Is this to be expected, or is it a bug that should be addressed (i.e. not check entities within quoted element attributes)? Of course, as always (well - most of the time) with Tapestry, there's an easy workaround: and in your code: public String getGoogleFontStyle() { return " http://fonts.googleapis.com/css?family=Francois+One&subset=latin,latin-ext";; } Rado
Re: [T5.3 beta 2] Using Tapestry-Spring-Security with 5.3?
Thank you guys! I'll be definitely giving Tynamo's security a try. In the meantime I scanned through the sources of TSS 2.1.0 that I've checked out from SVN several months ago, and now I have some basic understanding of what the issue with Tapestry 5.3 is - it removed the deprecated Aliases service in favor of the ServiceOverrides introduced back in 5.1. I'll just need to figure out how to do this properly, since I'll need to do it for our existing projects anyway, in order to migrate them to 5.3 at some point. If someone can get me started (since this is a bit new to me) here's how the original method of the SecurityModule looked like: public static void contributeAlias( @SpringSecurityServices SaltSourceService saltSource, @SpringSecurityServices AuthenticationProcessingFilter authenticationProcessingFilter, Configuration> configuration) { configuration.add(AliasContribution.create(SaltSourceService.class, saltSource)); configuration.add(AliasContribution.create( AuthenticationProcessingFilter.class, authenticationProcessingFilter)); } I also tried to contact Robin Helgelin (who seems to be the original maintainer of TSS) about the status of the project and if the latest sources are available somewhere but didn't get a response yet. Thanks, Rado
[T5.3 beta 2] Using Tapestry-Spring-Security with 5.3?
Guys, I haven't worked with Tapestry for a few months now, and decided to try out the new 5.3 beta 2 for a simple web-app. I've been using Spring-Security a lot with my previous Tapestry 5 projects via the Tapestry-Spring-Security module (version 2.1.0), and now I'm running into some issues, namely getting this exception: 2011-09-06 00:08:01.799:WARN::failed app: java.lang.IllegalArgumentException: Contribution nu.localhost.tapestry5.springsecurity.services.SecurityModule.contributeAlias(SaltSourceService, AuthenticationProcessingFilter, Configuration) (at SecurityModule.java:110) is for service 'Alias', which does not exist. Now, the homepage for Tapestry-Spring-Security module seems to have been down for a while (www.localhost.nu) so I'm not sure - is 2.1.0 the latest version or has there been any update for 5.3 compatibility? Or is there an easy way to update the module for 5.3 compatibility (luckily I have the sources too). On a sidenote, I was wondering if, perhaps, using Spring Security isn't an overkill for the simple project. For me it has the advantage of zero set up time, since I'm familiar with it from previous project. I was looking for alternatives and ran across these 2: - Tapestry Security module by Taha Hafeez (independent) - Tapestry Security from Tynamo (wrapper for Apache Shiro) What would you recommend? Basically (for now) I just need to secure access to pages and some components for TML templates, such as the ifLoggedIn or ifRole. BTW I can't find a homepage for Taha's project - the Google Code page gives me just a 403 error :-( http://code.google.com/p/tapestry-addons/ Thanks for any input! Rado
Re: T5: Using Event.observer with a form within a t:block
Okay, I came up with a JS/prototype solution to this - it may not be a perfect one, but it works. Here's what I did: 1) I have removed the required validator from the form's only input field 2) I have removed the button and replaced it with an ordinary which calls a confirmBlank(this.form) JS function in its onClick handler, passing it the form reference. 3) The JS function then checks for the input field's value, and explicitly fires the form submit event if either the input field is filled-in, or if it is blank and user confirms that it is OK: function confirmBlank(form) { var value= form['currentValue']; if($(value).getValue().length == 0) if(!confirm('Are you sure you want to submit a blank value?')) return; form.fire(Tapestry.FORM_PROCESS_SUBMIT_EVENT); } So far this approach seems to be working fine, and I like its simplicity. It doesn't even require hooking into Tapestry.ZONE_UPDATED_EVENT so it should be Tapestry 5.0.x compatible (haven't tried that though). Thanks again for all the help! :-) Rado immutability wrote: > > Now - I have one more problem. For the form, I need something like > "interactive validation". Basically, rather than using a "required" > validator, I just need to display the javacript confirm dialog to the user > if the field is empty, to ensure that they really want to save an empty > value. > > In traditional JavaScript, I would just do this: > return confirm('Are you sure to save a blank value?') > in the onSubmit handler of the form. > > But this won't work here. So I was thinking that perhaps I should just use > the "required" validator, but handle the Tapestry.FORM_VALIDATE_EVENT and > display the prompt here - and in case the user confirms, just set form's > validation error to false (to allow it to be submitted even if the > required validator failed). But this doesn't seem to do the trick. Is this > a completely wrong way? > > Thanks again, > Rado > -- View this message in context: http://old.nabble.com/T5%3A-Using-Event.observer-with-a-form-within-a-t%3Ablock-tp28697334p28742904.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: Using Event.observer with a form within a t:block
Thiago & Josh - thank you so much for your valuable responses! In the meantime, I was able to find out that the client-id is modified with a random suffix. Since my page is very simple and the zone will only have a single form, the solution posted by Josh works nicely: $('testzone').select('form')[0] Now - I have one more problem. For the form, I need something like "interactive validation". Basically, rather than using a "required" validator, I just need to display the javacript confirm dialog to the user if the field is empty, to ensure that they really want to save an empty value. In traditional JavaScript, I would just do this: return confirm('Are you sure to save a blank value?') in the onSubmit handler of the form. But this won't work here. So I was thinking that perhaps I should just use the "required" validator, but handle the Tapestry.FORM_VALIDATE_EVENT and display the prompt here - and in case the user confirms, just set form's validation error to false (to allow it to be submitted even if the required validator failed). But this doesn't seem to do the trick. Is this a completely wrong way? Thanks again, Rado Thiago H. de Paula Figueiredo wrote: > > On Fri, 28 May 2010 12:22:10 -0300, Josh Canfield > wrote: > >> When elements are loaded into a zone their id's get modified to ensure >> they are still unique in the page. >> >> You can try using a different method for finding the form. If you know >> it's the only form in the zone you can use > > Or give the zone a fixed client id (id parameter) instead of letting > Tapestry do that. > > -- > 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 > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > > -- View this message in context: http://old.nabble.com/T5%3A-Using-Event.observer-with-a-form-within-a-t%3Ablock-tp28697334p28731907.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: Using Event.observer with a form within a t:block
OK - I'm halfway through now (I think so, at least) :-) I believe that I need to "hook" into the Tapestry.ZONE_UPDATED_EVENT event when my t:zone is updated with the t:block containing the form - this is what I do: Event.observe('zoneTest', Tapestry.ZONE_UPDATED_EVENT, function() { alert('zone updated'); }); This is working for me now that I've updated the app from T5.0.18 to T5.1.0.5. The issue is - even in this even handler, I can't get a hold of my form element. It doesn't seem to exist in the document tree. When I try to do Event.observe('myForm', 'submit', function() {..} ); Unlike before, I'm not getting any JS errors (even if I provide an invalid ID for the form such as 'myForm123'), but even using document.getElementById will only return null for 'myForm'. Any ideas? Thanks, Rado immutability wrote: > > A little background: I need to wire-up some custom JavaScript to be > launched when the Submit button of my form is clicked. I now believe that > the best way to do this with Tapestry5 is to use the Event.observer for > this purpose. Unfortunately my knowledge of client-side javascript, > scriptaculous, etc, is limited, and I can't make this work. The issue > seems to be that my form is within a t:block that gets injected into a > t:zone dynamically. > > So, even if I do this in my JS file: > > Event.observe(window, 'load', function() > { > Event.observe('formTranslator', 'submit', function() > { > // some onsubmit actions > }); > }); > > this will fail, because apparently, the my form named formTranslator > doesn't exist at the point the document is loaded (the form gets > reinjected into the t:zone whenever a new object to translate is selected > by the user). The JavaScript error that I see in my JS console is this: > > "element is null" -> scriptaculous/prototype.js Line:3936 > > I guess I somehow need to have the Event.observer called everytime the > form is reinjected into the t:zone, but how? Are my assumptions correct at > all? > > Thanks for any ideas in advance! > > Rado > -- View this message in context: http://old.nabble.com/T5%3A-Using-Event.observer-with-a-form-within-a-t%3Ablock-tp28697334p28707025.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
T5: Using Event.observer with a form within a t:block
A little background: I need to wire-up some custom JavaScript to be launched when the Submit button of my form is clicked. I now believe that the best way to do this with Tapestry5 is to use the Event.observer for this purpose. Unfortunately my knowledge of client-side javascript, scriptaculous, etc, is limited, and I can't make this work. The issue seems to be that my form is within a t:block that gets injected into a t:zone dynamically. So, even if I do this in my JS file: Event.observe(window, 'load', function() { Event.observe('formTranslator', 'submit', function() { // some onsubmit actions }); }); this will fail, because apparently, the my form named formTranslator doesn't exist at the point the document is loaded (the form gets reinjected into the t:zone whenever a new object to translate is selected by the user). The JavaScript error that I see in my JS console is this: "element is null" -> scriptaculous/prototype.js Line:3936 I guess I somehow need to have the Event.observer called everytime the form is reinjected into the t:zone, but how? Are my assumptions correct at all? Thanks for any ideas in advance! Rado -- View this message in context: http://old.nabble.com/T5%3A-Using-Event.observer-with-a-form-within-a-t%3Ablock-tp28697334p28697334.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.1] Locale - possible to revert to cookies?
Alright, for anyone who may need this, I did the following to re-enable the cookie-based locale in Tapestry 5.1.0.5: - provided a separate implementation of PersistentLocale service, copying Tapestry 5.0.18 code, since this interface hasn't changed - provided a separate implementation of LocalizationSetter service, but this interface has changed in 5.1, but I only needed to edit one of the methods in the original 5.1.0.5 code of the LocalizationSetterImpl (namely the setLocaleFromLocaleName method) - did the binding of the 2 services in my AppModule, and contributed alias to ensure that Tapestry picks up my implementations rather than the built-in ones using Automatic Dependency Resolution - turned off SymbolConstants.ENCODE_LOCALE_INTO_PATH setting in contributeApplicationDefaults - this will ensure that tapestry-generated URLs will not have the locale part embedded If anyone needs more detailed instructions on this, I can create a how-to. Rado immutability wrote: > > The new URL-based language switching is also causing issues with the way > Tapestry-Acegi handles the redirect to the login page once a session > expires. If a user switches to another language, let's say, Spanish, > they'll end up on a page with "es" locale code embedded in the URL, e.g. > /es/some/page. But if their session expires, Acegi will redirect them to > the login page, ignoring the locale component of the URL, e.g. /index, and > thus their language preference is lost. > > I guess it's not possible to revert to cookies easily in T5.1 now? Anyone > has a workaround for the Tapestry-Acegi issue? > > Thanks, > Rado > > > > immutability wrote: >> >> Hi everyone, now that Tapestry 5.1.0.5 is encoding the selected locale in >> URL rather than using cookie for this purpose, is it still possible to >> somehow configure Tapestry to use cookies as in 5.0.x? This way worked >> better for our application (i.e. being "hidden" from the URL and more >> "permanent" with cookie expiration set to a few days). >> >> Or is the only way to make it work this way putting together some custom >> code to do this (i.e. store the setting in a cookie, or perhaps even as >> some user-specific setting in a database)? >> >> Thanks, >> Rado >> > > -- View this message in context: http://www.nabble.com/-T5.1--Locale---possible-to-revert-to-cookies--tp23659027p24090806.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.1: Request forwarding breaks page/actionlinks
Thank you for the link pointing to the older discussion - I missed that one during my searches. Funny how everyone was saying to create a JIRA for this issue, but there doesn't seem to be any JIRA for this at the moment (open or closed) other than the old one related to the ComponentEventException in 5.0.x. I think I'll submit a new issue for this, just to see if it's something that will be considered for future releases. Rado P.Stavrinides wrote: > > This is a topic that has been discussed before on the list... I don't > disagree with you that there is a need to support server side redirects, > this is the key portion of my argument in favour of supporting them: > > "The two types of redirects are distinctly different and equally > important. RequestDipsatcher.forward() is the preferred redirection > approach for many banking sites / payment gateways etc because redirection > is performed at the server (so no need to use a session or querystring > parameters). Furthermore, you always deal with the same request/response > and have the ability to set attributes in the request which can be > retrieved even after redirecting... for example a simple page refresh will > update both redirect source and target (nice for a wizard type UI), > whereas with a sendRedirect() a new request/response is generated each > time. " > > See this old post for the full discussion: > http://www.nabble.com/t5%3A-forwarding-in-index-tt22694515.html#a23073223 > >> I was also wondering how does Tapestry handle a custom ExceptionReport >> page? >> In this case, it also seems to perform a server-side forward or redirect >> (the URL of the original page remains displayed, while the custom >> ExceptionReport page is shown). But in this case, PageLinks and >> ActionLinks >> work properly. > Good question, you can dig through the source code to be certain, but at a > guess I think Tapestry simply renders markup and doesn't use a server side > redirect. > > Peter > > - Original Message - > From: "immutability" > To: users@tapestry.apache.org > Sent: Tuesday, 16 June, 2009 17:34:58 GMT +02:00 Athens, Beirut, > Bucharest, Istanbul > Subject: Re: T5.1: Request forwarding breaks page/actionlinks > > > Thank you for your reply Peter. I ran across the JIRA you posted, but I > feel > it was a bit different from whay I'm seeking - the other guy was getting > exceptions upon doing the forward. I agree there's not much use to do the > forwarding when Tapestry already has excellent mechanism to perform > redirection. > > But since both Tapestry-Acegi and Tapestry-Spring-Security are documenting > the user of acegi.accessDenied.url property, I'm wondering if there's a > way > to make it work properly with Tapestry pages? I mean - if Acegi/Spring > Security performs a server-side forward to redirect the user to the > "Access > Denied" page, then it would be nice to be able to use this with any > Tapestry > page. Otherwise the only way would be to create a page with no > Page/ActionLinks - so you could just as well use a plain static HTML page > for that. A Tapestry page with the standard webapp menu would be more > user-friendly. > > I was also wondering how does Tapestry handle a custom ExceptionReport > page? > In this case, it also seems to perform a server-side forward or redirect > (the URL of the original page remains displayed, while the custom > ExceptionReport page is shown). But in this case, PageLinks and > ActionLinks > work properly. > > Rado > > > > > > Server side forwarding does not work in Tapestry, and it seems there are > no > plans to implement it: there was a jira once for it > (https://issues.apache.org/jira/browse/TAP5-607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel) > but it was closed. > > regards, > Peter > > -- > View this message in context: > http://www.nabble.com/T5.1%3A-Request-forwarding-breaks-page-actionlinks-tp24040558p24055691.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 > > > -- View this message in context: http://www.nabble.com/T5.1%3A-Request-forwarding-breaks-page-actionlinks-tp24040558p24073841.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.1] Locale - possible to revert to cookies?
The new URL-based language switching is also causing issues with the way Tapestry-Acegi handles the redirect to the login page once a session expires. If a user switches to another language, let's say, Spanish, they'll end up on a page with "es" locale code embedded in the URL, e.g. /es/some/page. But if their session expires, Acegi will redirect them to the login page, ignoring the locale component of the URL, e.g. /index, and thus their language preference is lost. I guess it's not possible to revert to cookies easily in T5.1 now? Anyone has a workaround for the Tapestry-Acegi issue? Thanks, Rado immutability wrote: > > Hi everyone, now that Tapestry 5.1.0.5 is encoding the selected locale in > URL rather than using cookie for this purpose, is it still possible to > somehow configure Tapestry to use cookies as in 5.0.x? This way worked > better for our application (i.e. being "hidden" from the URL and more > "permanent" with cookie expiration set to a few days). > > Or is the only way to make it work this way putting together some custom > code to do this (i.e. store the setting in a cookie, or perhaps even as > some user-specific setting in a database)? > > Thanks, > Rado > -- View this message in context: http://www.nabble.com/-T5.1--Locale---possible-to-revert-to-cookies--tp23659027p24062150.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.1: Palette causing a NPE upon form submit
Found the cause of this issue - after a painful search... :) It was my mistake. For anyone running into the same issue with NullPointerException and Palette component, if you want to use the Palette component with objects (e.g. list of domain objects returned from a database) remember to implement equals and hashCode properly. The issue also was not related to the server-side validators in any way. It simply occurs when the page containing the Palette component needs to render itself after processing a server-side event. So if such an event (e.g. onSuccess) returns another page instance (effectively resulting in a redirect after processing the event) no problems will occur. But if it returns null, and at the same time some items are on the selected side within the Palette, the NullPointerException will be thrown. Rado -- View this message in context: http://www.nabble.com/T5.1%3A-Palette-causing-a-NPE-upon-form-submit-tp23996561p24061989.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.1: Request forwarding breaks page/actionlinks
Thank you for your reply Peter. I ran across the JIRA you posted, but I feel it was a bit different from whay I'm seeking - the other guy was getting exceptions upon doing the forward. I agree there's not much use to do the forwarding when Tapestry already has excellent mechanism to perform redirection. But since both Tapestry-Acegi and Tapestry-Spring-Security are documenting the user of acegi.accessDenied.url property, I'm wondering if there's a way to make it work properly with Tapestry pages? I mean - if Acegi/Spring Security performs a server-side forward to redirect the user to the "Access Denied" page, then it would be nice to be able to use this with any Tapestry page. Otherwise the only way would be to create a page with no Page/ActionLinks - so you could just as well use a plain static HTML page for that. A Tapestry page with the standard webapp menu would be more user-friendly. I was also wondering how does Tapestry handle a custom ExceptionReport page? In this case, it also seems to perform a server-side forward or redirect (the URL of the original page remains displayed, while the custom ExceptionReport page is shown). But in this case, PageLinks and ActionLinks work properly. Rado Server side forwarding does not work in Tapestry, and it seems there are no plans to implement it: there was a jira once for it (https://issues.apache.org/jira/browse/TAP5-607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel) but it was closed. regards, Peter -- View this message in context: http://www.nabble.com/T5.1%3A-Request-forwarding-breaks-page-actionlinks-tp24040558p24055691.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.1: Request forwarding breaks page/actionlinks
The problem I have described in my original message is not related to Acegi/Spring, but it appears to be a problem in the way Tapestry generates URLs for ActionLinks and PageLinks after an server-side request forward is performed. Unlike a client-side redirect, in this case the URL that the browser sees doesn't change to the URL of the new page. This is exactly what Acegi does if it has the acegi.accessDenied.url property specified, but you can also do a forward manually using RequestDispatcher. Now, is this a bug in Tapestry? I couldn't find anything in JIRA. Imagine the following scenario: a page with a logical address /user/create which does nothing else but a forward (in onActivate) to /test. The result is that the /test page will be displayed, but the /user/create page's URL will be shown in the browser's address bar. As a consequence, Tapestry will generate relative URLs for all PageLinks and ActionLinks as if it was on the /test page, but these links will be relative to the /user/create page - and thus invalid. I can provide a sample code to reproduce. Thanks, Rado immutability wrote: > > Guys, I'm facing another strange issue with Tapestry 5.1.0.5. I'm using > Tapestry-Acegi, but I guess I would get the same behavior with > Spring-Security. I have configured a custom error page for the 403 > forbidden error in my AppModule, i.e.: > configuration.add("acegi.accessDenied.url", "/AccessDenied"); > > So far so good. When I manually open a secured page while logged in as a > user without the required privilege, instead of getting the plain white > 403 page, I'll get a nice Access Denied page with explanation, etc. But > while a page with address /AccessDenied is displayed (i.e. > http://127.0.0.1/AccessDenied), the browser displays the URL of the > original forbidden page (e.g. http://127.0.0.1/User/Create). > > This would actually be quite nice, but I think it is causing that both > pagelinks and actionlinks will break, as if Tapestry failed to generate > proper target URLs for them. Imagine I have a "logout" action link within > my Border component - the Border component is also used on the custom > AccessDenied page to get the consistent look with the rest of the webapp. > Normally, the URL that is generated for this action link will depend on > the page I'm viewing, so for example: > http://127.0.0.1/index.border.logout (on the /Index page) > http://127.0.0.1/user/create.border.logout (on the /User/Create page) > > But if I try to access the Create User page without the privileges and get > the access denied page, the actionlink's target URL will look like this: > http://127.0.0.1/user/accessdenied.border.logout (on the /User/Create > page) > > Obviously, this won't work, because there's no AccessDenied page under > /user - it is only in the root of the webapp. Similarly, a pagelink > targeting language configuration page, declared as: > > > doesn't work, because it generates this target URL: > http://127.0.0.1/user/language > > instead of the correct form: > http://127.0.0.1/language > > Is this a bug within Tapestry related to server side request forwarding or > am I missing something? I'm getting the same behavior in Jetty and in > Tomcat 6.0.18. > > Thanks, > Rado > -- View this message in context: http://www.nabble.com/T5.1%3A-Request-forwarding-breaks-page-actionlinks-tp24040558p24054631.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
T5.1: Custom Acegi 403 error page breaks page/actionlinks
Guys, I'm facing another strange issue with Tapestry 5.1.0.5. I'm using Tapestry-Acegi, but I guess I would get the same behavior with Spring-Security. I have configured a custom error page for the 403 forbidden error in my AppModule, i.e.: configuration.add("acegi.accessDenied.url", "/AccessDenied"); So far so good. When I manually open a secured page while logged in as a user without the required privilege, instead of getting the plain white 403 page, I'll get a nice Access Denied page with explanation, etc. But while a page with address /AccessDenied is displayed (i.e. http://127.0.0.1/AccessDenied), the browser displays the URL of the original forbidden page (e.g. http://127.0.0.1/User/Create). This would actually be quite nice, but I think it is causing that both pagelinks and actionlinks will break, as if Tapestry failed to generate proper target URLs for them. Imagine I have a "logout" action link within my Border component - the Border component is also used on the custom AccessDenied page to get the consistent look with the rest of the webapp. Normally, the URL that is generated for this action link will depend on the page I'm viewing, so for example: http://127.0.0.1/index.border.logout (on the /Index page) http://127.0.0.1/user/create.border.logout (on the /User/Create page) But if I try to access the Create User page without the privileges and get the access denied page, the actionlink's target URL will look like this: http://127.0.0.1/user/accessdenied.border.logout (on the /User/Create page) Obviously, this won't work, because there's no AccessDenied page under /user - it is only in the root of the webapp. Similarly, a pagelink targeting language configuration page, declared as: doesn't work, because it generates this target URL: http://127.0.0.1/user/language instead of the correct form: http://127.0.0.1/language Is this a bug within Tapestry related to server side request forwarding or am I missing something? I'm getting the same behavior in Jetty and in Tomcat 6.0.18. Thanks, Rado -- View this message in context: http://www.nabble.com/T5.1%3A-Custom-Acegi-403-error-page-breaks-page-actionlinks-tp24040558p24040558.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
T5.1: Palette causing a NPE upon form submit
I've been trying to figure this out for a few hours I've got a strange issue with the Palette component causing a NullPointerException upon form submit, but only on form failure involving server-side validator's such as the email validator (i.e. the form is submitted - onSubmit called but onSuccess not called due to errors, and are displayed). I'm using Tapestry 5.1.0.5 Background: I'm using Palette within a BeanEditForm when editing a User instance to edit a list of groups (List) to which the user belongs (a many-to-many relationship - I'm using Spring + Hibernate). The NPE is only thrown when submitting form with errors that are not catched by the JS validators, and are processed on the server, such as the email validator. Also, the NPE is only thrown if there are some groups on the "selected" side. Here's the first line from the stack trace: Render queue error in org.apache.tapestry5.internal.structure.renderphaseeventhandle...@79a340: java.lang.NullPointerException Here's the palette declaration: The user instance is persisted in the page class, and is initially populated in onActivate: @Property @Persist private User user; The selectGroups property, which is used for both model and encoder, is initialized in page's onPrepare with each request. It is a GenericSelectModel instance. That said, the palette component works properly almost all the time. When I edit a user instance, set all fields, select the groups and save, it all works. It only fails with the NPE when I leave out the email field, causing the server-side validation to display an error in . I've tried to add logger statements to the getter for selectGroups, and whenever it is actually called, both the selectGroups collection and user.groups collections are non-null and properly populated. So I have no idea what might be causing the NPE? Any hints are highly appreciated! Below is a longer snippet from the stack trace. Thanks, Rado STACK TRACE: 12:35:34,081 ERROR Account:84 - Render queue error in org.apache.tapestry5.internal.structure.renderphaseeventhandle...@c7014c: java.lang.NullPointerException java.lang.NullPointerException at org.apache.tapestry5.internal.util.SelectModelRenderer.option(SelectModelRenderer.java:49) at org.apache.tapestry5.corelib.components.Palette$SelectedRenderer.render(Palette.java:153) at org.apache.tapestry5.internal.structure.RenderPhaseEventHandler$1.render(RenderPhaseEventHandler.java:75) at org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:74) at org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) at $PageRenderQueue_121d408df33.render($PageRenderQueue_121d408df33.java) at $PageRenderQueue_121d408df29.render($PageRenderQueue_121d408df29.java) at org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37) at org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1748) at $MarkupRenderer_121d408df35.renderMarkup($MarkupRenderer_121d408df35.java) at org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1732) at $MarkupRenderer_121d408df35.renderMarkup($MarkupRenderer_121d408df35.java) at org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1714) at $MarkupRenderer_121d408df35.renderMarkup($MarkupRenderer_121d408df35.java) at org.apache.tapestry5.services.TapestryModule$24.renderMarkup(TapestryModule.java:1700) at $MarkupRenderer_121d408df35.renderMarkup($MarkupRenderer_121d408df35.java) at org.apache.tapestry5.services.TapestryModule$23.renderMarkup(TapestryModule.java:1681) at $MarkupRenderer_121d408df35.renderMarkup($MarkupRenderer_121d408df35.java) at org.apache.tapestry5.services.TapestryModule$22.renderMarkup(TapestryModule.java:1662) at $MarkupRenderer_121d408df35.renderMarkup($MarkupRenderer_121d408df35.java) at $MarkupRenderer_121d408df32.renderMarkup($MarkupRenderer_121d408df32.java) at org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) at $PageMarkupRenderer_121d408df2f.renderPageMarkup($PageMarkupRenderer_121d408df2f.java) at org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:61) at $PageResponseRenderer_121d408dea6.renderPageResponse($PageResponseRenderer_121d408dea6.java) at org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:63) at org.apache.tapestry5.services.TapestryModule$33.handle(TapestryModule.java:1943) at $PageRenderRequestHandler_121d408dea7.handle($PageRenderRequestHandler_121d408dea7.java) at $PageRenderRequestHandler_121d408de90.hand
[T5.1] Locale - possible to revert to cookies?
Hi everyone, now that Tapestry 5.1.0.5 is encoding the selected locale in URL rather than using cookie for this purpose, is it still possible to somehow configure Tapestry to use cookies as in 5.0.x? This way worked better for our application (i.e. being "hidden" from the URL and more "permanent" with cookie expiration set to a few days). Or is the only way to make it work this way putting together some custom code to do this (i.e. store the setting in a cookie, or perhaps even as some user-specific setting in a database)? Thanks, Rado -- View this message in context: http://www.nabble.com/-T5.1--Locale---possible-to-revert-to-cookies--tp23659027p23659027.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: disabling column sorting programmatically in Grid
Thanks again, now you got me started (finally)! It really seems to be a better idea to just create the bean model for each request in this case. A note for others who may be trying the code above - don't ever try to call grid.getBeanModel within a getter for the model for the same grid - that will cause an endless recursion and a stack overflow. :-) Thanks again Thiago! -- View this message in context: http://www.nabble.com/T5%3A-disabling-column-sorting-programmatically-in-Grid-tp21546541p21549517.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: disabling column sorting programmatically in Grid
Thiago, thank you for a quick response, I still have a lot to learn! > One way to do it is to nameColumn.sortable(false) the > the method that returns the BeanModel. I'm confused at this point. I'm currently not returning the BeanModel anywhere. When I was using BeanModel to add custom columns, it was a property that was then bound to the grid component in the .tml file (i.e. model="model") but since the recent versions of Tapestry5 do not require me to add custom columns using the BeanModel code, I'm not doing this anymore. Hence, my first use of the BeanModel was this - to try and make an existing column sortable (or not-sortable). Could you please elaborate (at least in short) on returning the BeanModel in my scenario (where I first get it from an existing grid rather than create BeanModel from scratch). I'm sorry for sounding so dumb! :) And thanks again! -- View this message in context: http://www.nabble.com/T5%3A-disabling-column-sorting-programmatically-in-Grid-tp21546541p21547589.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
T5: disabling column sorting programmatically in Grid
Hey guys, I have a very specific page where I need to disable/enable sorting for a single-column grid - the grid is under a small form, and based on the form input I need to disable or enable the sorting. So I thought of the standard way of doing this - in the onSuccessFromFormFilter handler I do the following: if(/*condition to disable the sorting*/) { // other code // disable sorting PropertyModel nameColumn = gridResources.getDataModel().getById("name"); nameColumn.sortable(false); } This is something that worked nicely when I was using BeanModel to add custom columns to grid (in older versions of Tapestry5 when there was no "add" attribute). But now, it just does nothing and the column remains sortable. The name column is an automatically added column extracted from the POJO - I'm not adding it using "add". I know the code in my onSuccess handler works, as I also do gridResources.getSortModel().clear(); to reset existing sorting - and that works. Any ideas why it just does nothing? Am I doing something stupid here? :) Thanks, Rado -- View this message in context: http://www.nabble.com/T5%3A-disabling-column-sorting-programmatically-in-Grid-tp21546541p21546541.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: disabling popup client-side validator alerts
So I guess there's no simple way? :-( Rado immutability wrote: > > Hey everyone, I'm sure this will (possibly) be a simple thing, but I can't > seem to find a straightforward way to disable the fading popup client-side > validator alerts (the bubbles). I've searched through the forums, how-tos, > but just couldn't find the right way. I've tried to use CSS and set > t-error-popup to display:none, but it didn't work, maybe it's visibility > is controlled by JavaScript? Can anyone give me a hint? > > To make sure I put this right: I DO want client-side validation. I just > need it simple - without the bubbles (i.e. field labels and borders > turning red + the red "X" are all sufficient for me) > > Thanks! > Rado > > > -- View this message in context: http://www.nabble.com/T5%3A-disabling-popup-client-side-validator-alerts-tp20704228p20735799.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: disabling popup client-side validator alerts
Hey everyone, I'm sure this will (possibly) be a simple thing, but I can't seem to find a straightforward way to disable the fading popup client-side validator alerts (the bubbles). I've searched through the forums, how-tos, but just couldn't find the right way. I've tried to use CSS and set t-error-popup to display:none, but it didn't work, maybe it's visibility is controlled by JavaScript? Can anyone give me a hint? To make sure I put this right: I DO want client-side validation. I just need it simple - without the bubbles (i.e. field labels and borders turning red + the red "X" are all sufficient for me) Thanks! Rado -- View this message in context: http://www.nabble.com/T5%3A-disabling-popup-client-side-validator-alerts-tp20704228p20704228.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: Getting reference to app-wide message catalog (in a service)?
Hi Tapestry gurus! :) I'm facing an interesting problem with a service that I'm trying to build. This service will aid in building a navigation menu, but for localization purposes, I need to get a "Messages" reference for access to the application-wide message catalog. I searched through the archives, documentation, etc, but couldn't find a way to get this reference? I understand that normally the "Messages" instances are only created for particular pages/components, and they contain combined resources from the main (app-wide) message catalog, as well as page/component-specific message catalog, including inheritance. But what if I only wanted to have "Messages" instance for the app-wide properties file within my service? Is it possible at all? I hope this makes sense... Thanks in advance :) Rado -- View this message in context: http://www.nabble.com/T5%3A-Getting-reference-to-app-wide-message-catalog-%28in-a-service%29--tp20127079p20127079.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: How to implement a simple API servlet?
Thanks a lot for the tip Howard, I'll try it this way then, and see how it goes! :) Howard Lewis Ship wrote: > > I did some modest work like this many months back, where I had a page > as a kind of RESTful service endpoint. I returned a StreamResponse > from onActivate(). The "page" didn't even have a template. This is > not quite what T5 is intended to do, but you get the benefits of live > class reloading and IoC integration, so why not? > > On Mon, Aug 25, 2008 at 12:10 PM, immutability <[EMAIL PROTECTED]> > wrote: >> >> Guys, I've been trying to search google and nabble for this, but just >> couldn't find the answer, perhaps I'm just using the wrong keywords or >> something... as I'm sure it will sound trivial to some of you. >> >> Here's what I'm trying to achieve: I'd like to implement a simplistic API >> in >> our webapplication using just a plain old servlet to handle all API >> method >> calls. The idea is to just call this single servlet, passing in the >> required >> set of parameters via GET/POST, and responding with a either an XML data >> response (text/xml), or a binary stream (zipped data) depending on the >> method called. >> >> Now, I'm lost trying to find the best way how to mix this into the >> existing >> Tapestry5 application. I have tried to just add the servlet/mapping into >> web.xml but that doesn't work. I thought about extending TapestryFilter >> to >> ignore the API servlet's path, but the doFilter method is "final" right? >> I >> also thought about just getting the raw http request/response within a >> tapestry page using injection, but that just doesn't feel right - it >> seems >> better to bypass tapestry altogether for this purpose, or is it wrong? >> >> Thanks for any ideas in advance! >> Rado >> -- >> View this message in context: >> http://www.nabble.com/T5%3A-How-to-implement-a-simple-API-servlet--tp19149751p19149751.html >> Sent from the Tapestry - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > > -- > Howard M. Lewis Ship > > Creator Apache Tapestry and Apache HiveMind > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/T5%3A-How-to-implement-a-simple-API-servlet--tp19149751p19149933.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: How to implement a simple API servlet?
Guys, I've been trying to search google and nabble for this, but just couldn't find the answer, perhaps I'm just using the wrong keywords or something... as I'm sure it will sound trivial to some of you. Here's what I'm trying to achieve: I'd like to implement a simplistic API in our webapplication using just a plain old servlet to handle all API method calls. The idea is to just call this single servlet, passing in the required set of parameters via GET/POST, and responding with a either an XML data response (text/xml), or a binary stream (zipped data) depending on the method called. Now, I'm lost trying to find the best way how to mix this into the existing Tapestry5 application. I have tried to just add the servlet/mapping into web.xml but that doesn't work. I thought about extending TapestryFilter to ignore the API servlet's path, but the doFilter method is "final" right? I also thought about just getting the raw http request/response within a tapestry page using injection, but that just doesn't feel right - it seems better to bypass tapestry altogether for this purpose, or is it wrong? Thanks for any ideas in advance! Rado -- View this message in context: http://www.nabble.com/T5%3A-How-to-implement-a-simple-API-servlet--tp19149751p19149751.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting the GridPager range
Just check the GridPager reference: http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/GridPager.html http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/GridPager.html range: Number of pages before and after the current page in the range. The pager always displays links for 2 * range + 1 pages, unless that's more than the total number of available pages. The default is 5, and I can't find a way to change it when using the Grid component. immutability wrote: > > Hi everyone! I'm still a little new to Tapestry5, and before starting a > large project we've decided to develop a small internal application using > Tapestry5. I was working on this for some 3 weeks now, and so far I'm > impressed! I was able to resolve most of my issue using Google, Tapestry > reference and Wiki, or the archives of this mailinglist, but this time I > ran into a few things that I can't figure out. Here's the first one: > > I'm using the Grid component to display a list of some entities. The Grid > itself has a few parameters to adjust paging behavior (namely > pagerPosition and rowsPerPage) but there's no parameter to configure > GridPager's "range" parameter. Now, I searched wherever I could, but > didn't find a single example on how to adjust the default values of > "range" which is 5. I have tried to do this declaratively, > programmatically in the page's backing class, but just couldn't find the > way to do this. > > So my question is: is there an easy way to do this? And if not - is there > a hard way to do this? :) I think I mainly need some pointers to get me > started. > > Thanks in advance! > Rado > -- View this message in context: http://www.nabble.com/Setting-the-GridPager-range-tp18870199p18891170.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Zone - disabling yellow background animation on reload
Thanks a bunch! That was it. Even though I couldn't find any documentation on ElementEffect, it was easy to locate in the tapestry.js file to see possible values. So using the following attributes for the Zone disabled the default "highlight" animation: Thanks again, Rado ciaranw wrote: > > This one's easy - you provide an effect name as a parameter to the zone: > ... > > Have a look here for reference: > http://tapestry.formos.com/nightly/tapestry5/tapestry-core/ref/org/apache/ta > pestry5/corelib/components/Zone.html > > Ciaran > > > > On 07/08/2008 2:40pm, "immutability" <[EMAIL PROTECTED]> wrote: > >> >> Here I go again! :) Another problem I'm facing is with the Zone >> component. I >> like that the AJAX works nicely out-of-the-box with T5 components, such >> as >> ActionLink and Zone, without writing a single line of client-side script. >> >> The problem that I'm facing is the yellow-to-white (or whatever >> background >> color the zone is using) animation that always appears when a Zone is >> updated. It is a nice thing, but I'd like to be able to disable it for >> one >> of my zones. There are 2 reasons for this: >> >> 1. This zone contains some graphical elements, and it just doesn't look >> good >> 2. When you click the ActionLinks that update this zone in a quick >> sequence, >> the animation gets broken and the background will remain yellow (or stuck >> in >> some shade of yellow, depending on how fast you click the ActionLinks) >> >> I guess that to customize or disable this animation, some client-side >> script >> hack or something similar will be needed, but I couldn't find any >> examples >> or how-tos. Can anyone help? >> >> Thank you guys! >> Rado > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/T5%3A-Zone---disabling-yellow-background-animation-on-reload-tp18870719p18871185.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: Zone - disabling yellow background animation on reload
Here I go again! :) Another problem I'm facing is with the Zone component. I like that the AJAX works nicely out-of-the-box with T5 components, such as ActionLink and Zone, without writing a single line of client-side script. The problem that I'm facing is the yellow-to-white (or whatever background color the zone is using) animation that always appears when a Zone is updated. It is a nice thing, but I'd like to be able to disable it for one of my zones. There are 2 reasons for this: 1. This zone contains some graphical elements, and it just doesn't look good 2. When you click the ActionLinks that update this zone in a quick sequence, the animation gets broken and the background will remain yellow (or stuck in some shade of yellow, depending on how fast you click the ActionLinks) I guess that to customize or disable this animation, some client-side script hack or something similar will be needed, but I couldn't find any examples or how-tos. Can anyone help? Thank you guys! Rado -- View this message in context: http://www.nabble.com/T5%3A-Zone---disabling-yellow-background-animation-on-reload-tp18870719p18870719.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Setting the GridPager range
Hi everyone! I'm still a little new to Tapestry5, and before starting a large project we've decided to develop a small internal application using Tapestry5. I was working on this for some 3 weeks now, and so far I'm impressed! I was able to resolve most of my issue using Google, Tapestry reference and Wiki, or the archives of this mailinglist, but this time I ran into a few things that I can't figure out. Here's the first one: I'm using the Grid component to display a list of some entities. The Grid itself has a few parameters to adjust paging behavior (namely pagerPosition and rowsPerPage) but there's no parameter to configure GridPager's "range" parameter. Now, I searched wherever I could, but didn't find a single example on how to adjust the default values of "range" which is 5. I have tried to do this declaratively, programmatically in the page's backing class, but just couldn't find the way to do this. So my question is: is there an easy way to do this? And if not - is there a hard way to do this? :) I think I mainly need some pointers to get me started. Thanks in advance! Rado -- View this message in context: http://www.nabble.com/Setting-the-GridPager-range-tp18870199p18870199.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]