Re: How to set actionlink id dynamically
Tapestry automatically assigns unique id to every object in the page. it is created something along the lines of id underscore number (id, id_0, id_1, id_2). However, if the event handler that handles the actionlink click should receive the actionId then it should be the context. context=item.actionId and then in Java Object onActionFromMyAction(Long actionId){ ... do stuff ... return where-to-go (see http://tapestry.apache.org/tapestry5/guide/pagenav.html) } Also try to drop the t: from the id clause. That might let tapestry to treat the id as html parameter instead of tapestry id. Dont know if that is generally advisable, but I've used it couple of times. (This of course works only if you need just the ids to client side.) - Ville div id=navigation xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; table trtd ul t:loop source=itens value=item li id=${item.menuId} t:actionlink t:zone=content t:id=myAction id=${item.actionId} context=item.actionId${item.menuDescription}/t:actionlink /li /t:loop /ul /td/tr /table /div andrethiago wrote: Hi all! I want to build a menu inside a loop. Something like this: div id=navigation xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; table trtd ul t:loop source=itens value=item li id=${item.menuId} t:actionlink t:zone=content t:id=${item.actionId}${item.menuDescription}/t:actionlink /li /t:loop /ul /td/tr /table /div I want to generate the Actionlink id dinamically. But t:id=${item.actionId} does not work. Can anyone give me a way to do this? -- View this message in context: http://www.nabble.com/How-to-set-actionlink-id-dynamically-tp22148516p22157988.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.0.18] Setter method was not called when '@Validate' was set.
Using the @Property annotation will make Tapestry add getters and setters for this property during class transformation that will override your supplied ones. Leave out the @Property annotation and specify your own getters and setters and you should be fine. Uli inyokoyoko-deve...@yahoo.co.jp schrieb: Hi, You can encounter the same problem with the following code in a freshly set up project. Please try. Click the submit button. Test.java - package org.example.myapp.pages; import java.util.Date; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.beaneditor.Validate; public class Test{ @Property( write = false ) @Validate( required) // == when this line is added, setName() is not called private String name; public void setName( String name ){ this.name = name; } } - Test.tml - html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head title/title /head body form t:type=form t:clientValidation=false input t:id=name t:type=textfield type=text / input type=submit value=submit / /form /body /html - osamuo I'm using the same version as you do - 5.0.18 Have you tried the same code in a freshly set up project? The problem seems to be somewhere else in your project. On Sun, Feb 22, 2009 at 5:55 PM, wrote: Hi, What version are you using? With the following code setName() was called. @Property( write = false ) private String name; public void setName( String name ){ == called ... this.name = } With the following code setName() was not called. @Property( write = false ) @Validate( Required,MinLength=5,MaxLength=16 ) private String name; public void setName( String name ){ == not called ... this.name = } I don't know why the setter is not called if I add @Validate. osamuo Markus Lux wrote: With your example code I'm getting an ComponentEventException saying that name is read-only. Try adding a public-modifier to your setter. That worked for me. On Sun, Feb 22, 2009 at 3:49 PM, wrote: Hi, When I set '@Validate' for a TextField, the setter was never called. It seems to be a bug. @Property( write = false ) @Validate( Required,MinLength=5,MaxLength=16 ) private String name; void setName( String name ){ === not called ... this.name = } Thanks, osamuo - Power up the Internet with Yahoo! Toolbar. - Power up the Internet with Yahoo! Toolbar. - Power up the Internet with Yahoo! Toolbar. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Chenille Kit components inside a Zone - Request/Guidance
Hi All, I am using a lot of the Chenille Kit components to build my applications and they are great! But i am having a lot of issues with them when i try to use them inside of a Zone. If i position a Chenille Component (so far this has happened with Window, Slider, Rating) inside a zone i get a javascript error (Client Exception processing response. TypeErorr: Exisiting is null). Has anybody had the same issue? How could i solve this (I could send the patch, but i just don't know to fix it so any clues would be handy) Thanks a lot for your help Juan
Re: [T5.0.18] Setter method was not called when '@Validate' was set.
Hi, I have already known a solution. It seems to be a bug. Don't you think so? osamuo Using the @Property annotation will make Tapestry add getters and setters for this property during class transformation that will override your supplied ones. Leave out the @Property annotation and specify your own getters and setters and you should be fine. Uli inyokoyoko-deve...@yahoo.co.jp schrieb: Hi, You can encounter the same problem with the following code in a freshly set up project. Please try. Click the submit button. Test.java - package org.example.myapp.pages; import java.util.Date; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.beaneditor.Validate; public class Test{ @Property( write = false ) @Validate( required) // == when this line is added, setName() is not called private String name; public void setName( String name ){ this.name = name; } } - Test.tml - [input] [input] - osamuo I'm using the same version as you do - 5.0.18 Have you tried the same code in a freshly set up project? The problem seems to be somewhere else in your project. On Sun, Feb 22, 2009 at 5:55 PM, wrote: Hi, What version are you using? With the following code setName() was called. @Property( write = false ) private String name; public void setName( String name ){ == called ... this.name = } With the following code setName() was not called. @Property( write = false ) @Validate( Required,MinLength=5,MaxLength=16 ) private String name; public void setName( String name ){ == not called ... this.name = } I don't know why the setter is not called if I add @Validate. osamuo Markus Lux wrote: With your example code I'm getting an ComponentEventException saying that name is read-only. Try adding a public-modifier to your setter. That worked for me. On Sun, Feb 22, 2009 at 3:49 PM, wrote: Hi, When I set '@Validate' for a TextField, the setter was never called. It seems to be a bug. @Property( write = false ) @Validate( Required,MinLength=5,MaxLength=16 ) private String name; void setName( String name ){ === not called ... this.name = } Thanks, osamuo - Power up the Internet with Yahoo! Toolbar. - Power up the Internet with Yahoo! Toolbar. - Power up the Internet with Yahoo! Toolbar. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - Power up the Internet with Yahoo! Toolbar.
Re: [T5.0.18] Setter method was not called when '@Validate' was set.
No, it's not. This is expected behaviour. Uli inyokoyoko-deve...@yahoo.co.jp schrieb: Hi, I have already known a solution. It seems to be a bug. Don't you think so? osamuo Using the @Property annotation will make Tapestry add getters and setters for this property during class transformation that will override your supplied ones. Leave out the @Property annotation and specify your own getters and setters and you should be fine. Uli inyokoyoko-deve...@yahoo.co.jp schrieb: Hi, You can encounter the same problem with the following code in a freshly set up project. Please try. Click the submit button. Test.java - package org.example.myapp.pages; import java.util.Date; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.beaneditor.Validate; public class Test{ @Property( write = false ) @Validate( required) // == when this line is added, setName() is not called private String name; public void setName( String name ){ this.name = name; } } - Test.tml - [input] [input] - osamuo I'm using the same version as you do - 5.0.18 Have you tried the same code in a freshly set up project? The problem seems to be somewhere else in your project. On Sun, Feb 22, 2009 at 5:55 PM, wrote: Hi, What version are you using? With the following code setName() was called. @Property( write = false ) private String name; public void setName( String name ){ == called ... this.name = } With the following code setName() was not called. @Property( write = false ) @Validate( Required,MinLength=5,MaxLength=16 ) private String name; public void setName( String name ){ == not called ... this.name = } I don't know why the setter is not called if I add @Validate. osamuo Markus Lux wrote: With your example code I'm getting an ComponentEventException saying that name is read-only. Try adding a public-modifier to your setter. That worked for me. On Sun, Feb 22, 2009 at 3:49 PM, wrote: Hi, When I set '@Validate' for a TextField, the setter was never called. It seems to be a bug. @Property( write = false ) @Validate( Required,MinLength=5,MaxLength=16 ) private String name; void setName( String name ){ === not called ... this.name = } Thanks, osamuo - Power up the Internet with Yahoo! Toolbar. - Power up the Internet with Yahoo! Toolbar. - Power up the Internet with Yahoo! Toolbar. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - Power up the Internet with Yahoo! Toolbar. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
t5: Filter and Session conflict?
Hi, I use the code at end of this message to strip the Jsessionid, it works very well, however it started to have error when I call this in my T5 app: Session session = request.getSession(false); if (session != null) { session.invalidate(); } cookies.removeCookieValue(logKey); can this problem be fixed? Thanks, Angelo [ERROR] [default] Servlet.service() for servlet default threw exception java.lang.IllegalStateException: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2221) at org.apache.catalina.connector.Request.getSession(Request.java:2031) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:832) at org.apache.tapestry5.internal.services.RequestImpl.getSession(RequestImpl.java:99) ... at org.myapp.Filter.doFilter(Filter.java:37) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) ... at java.lang.Thread.run(Thread.java:613) // http://www.nabble.com/T5%3A-what-part-of-tapestry-adds-Jsessionid-td18385573.html#a18388334 Code from Filip S. Adamsen-2 public class Filter implements javax.servlet.Filter { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!(request instanceof HttpServletRequest)) { chain.doFilter(request, response); return; } HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; if (httpRequest.isRequestedSessionIdFromURL()) { HttpSession session = httpRequest.getSession(); if (session != null) session.invalidate(); } HttpServletResponseWrapper wrappedResponse = new StripUrlSessionIdHttpServletResponseWrapper(httpResponse); chain.doFilter(request, wrappedResponse); } public void init(FilterConfig config) throws ServletException { } public void destroy() { } private static class StripUrlSessionIdHttpServletResponseWrapper extends HttpServletResponseWrapper { public StripUrlSessionIdHttpServletResponseWrapper(HttpServletResponse httpResponse) { super(httpResponse); } public String encodeRedirectUrl(String url) { return url; } public String encodeRedirectURL(String url) { return url; } public String encodeUrl(String url) { return url; } public String encodeURL(String url) { return url; } } } -- View this message in context: http://www.nabble.com/t5%3A-Filter-and-Session-conflict--tp22161170p22161170.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: Disabling onBlur field validation
2009/1/22 scott russell scottam...@hotmail.com Hi all, I have just started with Tapestry 5 (having previously used versions 3 and 4), and have found that while I like the new client-side validation bubbles, they are very distracting and annoying when they appear for every focus change between form fields. So my question is - does anyone know a way to turn them off for onBlur events only, but retain them for form submit events? It's quite unlikely customers will tolerate these error messages appearing every time they click between fields, but I would prefer to not turn off client-side validation completely, which looks like the only alternative at the moment. cheers, Scott Russell +1 for turning off the onBlur validation We have done some UI testing on users trying to use a registration wizard which collects some mandatory data on step 1 and have found it unacceptable that validation bubbles are popping up whenever users jump between fields. Do I have to ditch custom side validation altogether or is there a workaround? I would like the custom side validation only happens when the user submits the form(fragment). Cheers, Borut
Re: Chenille Kit components inside a Zone - Request/Guidance
On Mon, Feb 23, 2009 at 11:47 AM, Juan E. Maya maya.j...@gmail.com wrote: Hi All, I am using a lot of the Chenille Kit components to build my applications and they are great! But i am having a lot of issues with them when i try to use them inside of a Zone. If i position a Chenille Component (so far this has happened with Window, Slider, Rating) inside a zone i get a javascript error (Client Exception processing response. TypeErorr: Exisiting is null). Has anybody had the same issue? How could i solve this (I could send the patch, but i just don't know to fix it so any clues would be handy) Thanks a lot for your help Would you like to post to ChenilleKit user's mailing list so we can take care of it please. Regards -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Chenille Kit components inside a Zone - Request/Guidance
Oh i am sorry :) i didnt' know there was a mailing list! Great! thanks On Mon, Feb 23, 2009 at 2:57 PM, Massimo Lusetti mluse...@gmail.com wrote: On Mon, Feb 23, 2009 at 11:47 AM, Juan E. Maya maya.j...@gmail.com wrote: Hi All, I am using a lot of the Chenille Kit components to build my applications and they are great! But i am having a lot of issues with them when i try to use them inside of a Zone. If i position a Chenille Component (so far this has happened with Window, Slider, Rating) inside a zone i get a javascript error (Client Exception processing response. TypeErorr: Exisiting is null). Has anybody had the same issue? How could i solve this (I could send the patch, but i just don't know to fix it so any clues would be handy) Thanks a lot for your help Would you like to post to ChenilleKit user's mailing list so we can take care of it please. Regards -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: [T5-OSGi] Javassist
Just in cas someone wanted to know, our relay team in India found a solution adding javassist.runtime.Desc.useContextClassLoader = true in AppModule did the trick. /** * This module is automatically included as part of the Tapestry IoC Registry, it's a good place to * configure and extend Tapestry, or to place your own service definitions. */ public class AppModule { public static void bind(ServiceBinder binder) { javassist.runtime.Desc.useContextClassLoader = true; } -Original Message- From: Robert, Brice Sent: Friday, February 20, 2009 3:01 PM To: Tapestry users Subject: RE: [T5-OSGi] Javassist Thanks for Javassist explanation. I do use the Felix maven bundle plugin generated by the command: mvn archetype:generate 32: internal - spring-osgi-bundle-archetype (Spring-OSGi archetype) It would be great if you can load your T5 bundle to the spring Repo http://www.springsource.com/repository/app/faq#q9 Thanks, Brice -Original Message- From: Igor Drobiazko [mailto:igor.drobia...@gmail.com] Sent: Friday, February 20, 2009 2:49 PM To: Tapestry users Subject: Re: [T5-OSGi] Javassist Well, I never tried to run a Tapestry 4.1.5 app in an OSGi environment. We use T5 and OSGi. T5 needs Javassist 3.0.9ga, so please use this version. Furthermore I encourage you to generate you Manifest with Felix BND Maven Plugin. http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html On Fri, Feb 20, 2009 at 8:15 PM, Robert, Brice brice.rob...@alliancebernstein.com wrote: Igor, Thanks for your answer. I looked at the Tapestry 4.1.5 bundle created and posted by Jessie kuhnert on the Spring DM Server repository http://www.springsource.com/repository and I must say that the Manifest I created is just a big bag of everything. I have some Spring Cleaning to do. But why Javassist 3.0.9.ga, are there any specifics one need to know? Brice -Original Message- From: Igor Drobiazko [mailto:igor.drobia...@gmail.com] Sent: Friday, February 20, 2009 1:21 PM To: Tapestry users Subject: Re: [T5-OSGi] Javassist First of all you need the version 3.9.0.ga. It looks like your Tapestry bundle cannot resolve import of javassist packages. Without any look at your Manifest it is almost impossible to give you any advice. On Fri, Feb 20, 2009 at 6:33 PM, Robert, Brice brice.rob...@alliancebernstein.com wrote: Hi, I was able to run T5 under SpringSource DM Server but I am running into problems. I just wanted to know if someone has gone further than where I am. The stack trace is below [2009-02-20 12:13:22.578] server-tomcat-thread-25 apestry5.services.TapestryModule.RequestExceptionHandler.unknown E Processing of request failed with uncaught exception: javassist/runtime/Desc java.lang.NoClassDefFoundError: javassist/runtime/Desc at org.apache.tapestry5.corelib.components.Grid._$environment_read_formSupp ort(Grid.java) I use the javassist bundle provided by SpringSource http://www.springsource.com/repository/app/bundle/version/detail?name=co m.springsource.javassistversion=3.3.0.gasearchType=bundlesByNamesearc hQuery=javassist Thanks, Brice --- The information contained in the linked e-mail transmission and any attachments may be privileged and confidential and is intended only for the use of the person(s) named in the linked e-mail transmission. If you are not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you should not review, disseminate, distribute or duplicate this e-mail transmission or any attachments. If you are not the intended recipient, please contact the sender immediately by reply e-mail and destroy all copies of the original message. We do not accept account orders and/or instructions related to AllianceBernstein products or services by e-mail, and therefore will not be responsible for carrying out such orders and/or instructions. The linked e-mail transmission and any attachments are provided for informational purposes only and should not be construed in any manner as any solicitation or offer to buy or sell any investment opportunities or any related financial instruments and should not be construed in any manner as a public offer of any investment opportunities or any related financial instruments. If you, as the intended recipient of the linked e-mail transmission, the purpose of which is to inform and update our clients, prospects and consultants of developments relating to our services and products, would not like to receive further e-mail correspondence from the sender, please reply to the sender indicating your wishes. Although we attempt to sweep e-mail and attachments for viruses, we will not be liable for any damages arising from the alteration of the contents
Re: [T5.0.18] Setter method was not called when '@Validate' was set.
I haven't tested this behavior, but I would consider it a bug for two reasons: 1) write = false is specified for @Property. So tapestry really shouldn't be creating any setters for this property during the class transformation. 2) From Osamuo's text, it sounds like that if you don't have @Validate, the custom setter is called just fine. It's only when you add @Validate that the set fails. Is that the case? If so, it's definitely a bug. It either needs to fail in both cases, or succeed in both cases. Robert On Feb 23, 2009, at 2/236:05 AM , Ulrich Stärk wrote: No, it's not. This is expected behaviour. Uli inyokoyoko-deve...@yahoo.co.jp schrieb: Hi, I have already known a solution. It seems to be a bug. Don't you think so? osamuo Using the @Property annotation will make Tapestry add getters and setters for this property during class transformation that will override your supplied ones. Leave out the @Property annotation and specify your own getters and setters and you should be fine. Uli inyokoyoko-deve...@yahoo.co.jp schrieb: Hi, You can encounter the same problem with the following code in a freshly set up project. Please try. Click the submit button. Test.java - package org.example.myapp.pages; import java.util.Date; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.beaneditor.Validate; public class Test{ @Property( write = false ) @Validate( required) // == when this line is added, setName() is not called private String name; public void setName( String name ){ this.name = name; } } - Test.tml - [input][input] - osamuo I'm using the same version as you do - 5.0.18 Have you tried the same code in a freshly set up project? The problem seems to be somewhere else in your project. On Sun, Feb 22, 2009 at 5:55 PM, wrote: Hi, What version are you using? With the following code setName() was called. @Property( write = false ) private String name; public void setName( String name ){ == called ... this.name = } With the following code setName() was not called. @Property( write = false ) @Validate( Required,MinLength=5,MaxLength=16 ) private String name; public void setName( String name ){ == not called ... this.name = } I don't know why the setter is not called if I add @Validate. osamuo Markus Lux wrote: With your example code I'm getting an ComponentEventException saying that name is read-only. Try adding a public-modifier to your setter. That worked for me. On Sun, Feb 22, 2009 at 3:49 PM, wrote: Hi, When I set '@Validate' for a TextField, the setter was never called. It seems to be a bug. @Property( write = false ) @Validate( Required,MinLength=5,MaxLength=16 ) private String name; void setName( String name ){ === not called ... this.name = } Thanks, osamuo - Power up the Internet with Yahoo! Toolbar. - Power up the Internet with Yahoo! Toolbar. - Power up the Internet with Yahoo! Toolbar. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - Power up the Internet with Yahoo! Toolbar. - 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.0.18] Setter method was not called when '@Validate' was set.
I suspect that setName() isn't being called because the input destined for the property fails validation. On Mon, Feb 23, 2009 at 8:35 AM, Robert Zeigler robe...@scazdl.org wrote: I haven't tested this behavior, but I would consider it a bug for two reasons: 1) write = false is specified for @Property. So tapestry really shouldn't be creating any setters for this property during the class transformation. 2) From Osamuo's text, it sounds like that if you don't have @Validate, the custom setter is called just fine. It's only when you add @Validate that the set fails. Is that the case? If so, it's definitely a bug. It either needs to fail in both cases, or succeed in both cases. Robert On Feb 23, 2009, at 2/236:05 AM , Ulrich Stärk wrote: No, it's not. This is expected behaviour. Uli inyokoyoko-deve...@yahoo.co.jp schrieb: Hi, I have already known a solution. It seems to be a bug. Don't you think so? osamuo Using the @Property annotation will make Tapestry add getters and setters for this property during class transformation that will override your supplied ones. Leave out the @Property annotation and specify your own getters and setters and you should be fine. Uli inyokoyoko-deve...@yahoo.co.jp schrieb: Hi, You can encounter the same problem with the following code in a freshly set up project. Please try. Click the submit button. Test.java - package org.example.myapp.pages; import java.util.Date; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.beaneditor.Validate; public class Test{ @Property( write = false ) @Validate( required) // == when this line is added, setName() is not called private String name; public void setName( String name ){ this.name = name; } } - Test.tml - [input] [input] - osamuo I'm using the same version as you do - 5.0.18 Have you tried the same code in a freshly set up project? The problem seems to be somewhere else in your project. On Sun, Feb 22, 2009 at 5:55 PM, wrote: Hi, What version are you using? With the following code setName() was called. @Property( write = false ) private String name; public void setName( String name ){ == called ... this.name = } With the following code setName() was not called. @Property( write = false ) @Validate( Required,MinLength=5,MaxLength=16 ) private String name; public void setName( String name ){ == not called ... this.name = } I don't know why the setter is not called if I add @Validate. osamuo Markus Lux wrote: With your example code I'm getting an ComponentEventException saying that name is read-only. Try adding a public-modifier to your setter. That worked for me. On Sun, Feb 22, 2009 at 3:49 PM, wrote: Hi, When I set '@Validate' for a TextField, the setter was never called. It seems to be a bug. @Property( write = false ) @Validate( Required,MinLength=5,MaxLength=16 ) private String name; void setName( String name ){ === not called ... this.name = } Thanks, osamuo - Power up the Internet with Yahoo! Toolbar. - Power up the Internet with Yahoo! Toolbar. - Power up the Internet with Yahoo! Toolbar. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - Power up the Internet with Yahoo! Toolbar. - 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 -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5.0.18] Setter method was not called when '@Validate' was set.
I set up a fresh application from the maven quickstart archetype and added the sample code posted earlier by osamuo. I also added one sysout to see if the setter is called. I cannot confirm that the setter isn't called when @Validate( required) is added to the property and you type at least one character into the textfield and submit the form. The quickstart archetype uses Tapestry 5.0.18. On Mon, Feb 23, 2009 at 5:41 PM, Howard Lewis Ship hls...@gmail.com wrote: I suspect that setName() isn't being called because the input destined for the property fails validation. On Mon, Feb 23, 2009 at 8:35 AM, Robert Zeigler robe...@scazdl.org wrote: I haven't tested this behavior, but I would consider it a bug for two reasons: 1) write = false is specified for @Property. So tapestry really shouldn't be creating any setters for this property during the class transformation. 2) From Osamuo's text, it sounds like that if you don't have @Validate, the custom setter is called just fine. It's only when you add @Validate that the set fails. Is that the case? If so, it's definitely a bug. It either needs to fail in both cases, or succeed in both cases. Robert On Feb 23, 2009, at 2/236:05 AM , Ulrich Stärk wrote: No, it's not. This is expected behaviour. Uli inyokoyoko-deve...@yahoo.co.jp schrieb: Hi, I have already known a solution. It seems to be a bug. Don't you think so? osamuo Using the @Property annotation will make Tapestry add getters and setters for this property during class transformation that will override your supplied ones. Leave out the @Property annotation and specify your own getters and setters and you should be fine. Uli inyokoyoko-deve...@yahoo.co.jp schrieb: Hi, You can encounter the same problem with the following code in a freshly set up project. Please try. Click the submit button. Test.java - package org.example.myapp.pages; import java.util.Date; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.beaneditor.Validate; public class Test{ @Property( write = false ) @Validate( required) // == when this line is added, setName() is not called private String name; public void setName( String name ){ this.name = name; } } - Test.tml - [input] [input] - osamuo I'm using the same version as you do - 5.0.18 Have you tried the same code in a freshly set up project? The problem seems to be somewhere else in your project. On Sun, Feb 22, 2009 at 5:55 PM, wrote: Hi, What version are you using? With the following code setName() was called. @Property( write = false ) private String name; public void setName( String name ){ == called ... this.name = } With the following code setName() was not called. @Property( write = false ) @Validate( Required,MinLength=5,MaxLength=16 ) private String name; public void setName( String name ){ == not called ... this.name = } I don't know why the setter is not called if I add @Validate. osamuo Markus Lux wrote: With your example code I'm getting an ComponentEventException saying that name is read-only. Try adding a public-modifier to your setter. That worked for me. On Sun, Feb 22, 2009 at 3:49 PM, wrote: Hi, When I set '@Validate' for a TextField, the setter was never called. It seems to be a bug. @Property( write = false ) @Validate( Required,MinLength=5,MaxLength=16 ) private String name; void setName( String name ){ === not called ... this.name = } Thanks, osamuo - Power up the Internet with Yahoo! Toolbar. - Power up the Internet with Yahoo! Toolbar. - Power up the Internet with Yahoo! Toolbar. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - Power up the Internet with Yahoo! Toolbar. - 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 -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind
Re: 5.1.0.0 upgrade issues.
Any chance the PageTester's contributeApplicationDefaults() issues (... should use FactoryDefaults instead of ApplicationDefaults...) will be fixed in 5.1.0.0-GA? thanks - alex Howard Lewis Ship wrote: Thanks for the input; I definitely changed a few things in PageTester to simplify the behavior and make it use more of the same code pathways that a deployed application would. I'll see about fixing these. On Fri, Feb 20, 2009 at 6:39 PM, alex_yt_cheung alex_yt_che...@yahoo.com wrote: Yes baby, 5.1.0.0, fresh off the press and already running.. mostly:-) Just want to share my experience and ask how best to resolve some issues. * Some refactoring for new interface adaptations: LinkFactory, use of ValueEncoder instead of PrimaryKeyEncoder...etc. nothing too serious to get the code compile and running. LinkFactory is internal and 5.1 has and will have more ways to accomplish the same goals that used to involve overriding LinkFactory. PKE: this change is quasi-backwards compatible; you may find that you can keep your PKE but have to use a different constructor of DefaultPrimaryKeyEncoder (to pass up the type of the key). * Tapestry module class is restricted to builders, contributions, decorators and bind methods. If you have convenient methods inside the module classes, you will need to do some refactoring. You can use private methods for these convieniences. * The PageTester don't support parameters with space, comma, %, or + anymore. Ended up reducing the complexity of the strings to allow the tests to run. It will be great I can go back to having more complex strings as parameters to my test pages. Please add a detailed issue to JIRA for this. * Not sure if it is the PageTester or the rendering sequence, but I notice a difference in behavior on exception handling when using the PageTester. The call to renderPage() seems to have processed the exception, where previously the exception was thrown to the caller. The announing part is that the document returned only tells you the exception, in my case, a ClassNotFoundException was thrown while loading the xxxPage, but I can't tell which class was really not found. * There is a PageTesterModule that contributes to the PageTester environment. My issue is with contributeApplicationDefaults(), our module also issue an configuration.add(SymbolConstants.FORCE_ABSOLUTE_URIS, true). It turned out that an IllegalArgumentException is thrown when tapestry sees two add() calls for the same key. I use configuration.override() to fix my test, but that break my dev/prod environment because override() throws IllegalArgumentException when trying to override() an non-existent key. The IllegalArgumentException exception is thrown from MappedConfiguration.apply():line 42. That requires knowing if the key exists prior to calling override. Maybe a new API to peek into the config for existence check will do nicely. Actualy, PageTester should override FactoryDefaults, rather than provide ApplicationDefaults. This can be fixed. I have some work-arounds, but will be grateful for patches or better solutions. thanks in advance. - alex -- View this message in context: http://www.nabble.com/5.1.0.0-upgrade-issues.-tp22132202p22132202.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 -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - 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/5.1.0.0-upgrade-issues.-tp22132202p22166911.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
http error on exception
Hello All, I search a solution to launch an http error (500) when tapestry throw an Exception. I have found documentation on how to override tapestry Exception ... but that launch a 200 OK have you a solution ? -- Thomas Clavier http://www.tcweb.org Argia Engineering JabberID : clav...@argia.fr +33 (0)6 20 81 81 30 +33 (0)950 783 783 signature.asc Description: OpenPGP digital signature
Re: http error on exception
Never tested it but you should be able to inject Response, call response.setStatus(500) and response.sendRedirect(Link/String). Uli Thomas Clavier schrieb: Hello All, I search a solution to launch an http error (500) when tapestry throw an Exception. I have found documentation on how to override tapestry Exception ... but that launch a 200 OK have you a solution ? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 5.1.0.0 upgrade issues.
Oh yes; 5.1.0.0 is just an alpha release (that hasn't even been fully voted up yet). I hope to address glaring bugs in it in a follow on release in a couple of weeks, and progress quickly to a final release. Thanks for checking it out so early! On Mon, Feb 23, 2009 at 10:13 AM, alex_yt_cheung alex_yt_che...@yahoo.com wrote: Any chance the PageTester's contributeApplicationDefaults() issues (... should use FactoryDefaults instead of ApplicationDefaults...) will be fixed in 5.1.0.0-GA? thanks - alex Howard Lewis Ship wrote: Thanks for the input; I definitely changed a few things in PageTester to simplify the behavior and make it use more of the same code pathways that a deployed application would. I'll see about fixing these. On Fri, Feb 20, 2009 at 6:39 PM, alex_yt_cheung alex_yt_che...@yahoo.com wrote: Yes baby, 5.1.0.0, fresh off the press and already running.. mostly:-) Just want to share my experience and ask how best to resolve some issues. * Some refactoring for new interface adaptations: LinkFactory, use of ValueEncoder instead of PrimaryKeyEncoder...etc. nothing too serious to get the code compile and running. LinkFactory is internal and 5.1 has and will have more ways to accomplish the same goals that used to involve overriding LinkFactory. PKE: this change is quasi-backwards compatible; you may find that you can keep your PKE but have to use a different constructor of DefaultPrimaryKeyEncoder (to pass up the type of the key). * Tapestry module class is restricted to builders, contributions, decorators and bind methods. If you have convenient methods inside the module classes, you will need to do some refactoring. You can use private methods for these convieniences. * The PageTester don't support parameters with space, comma, %, or + anymore. Ended up reducing the complexity of the strings to allow the tests to run. It will be great I can go back to having more complex strings as parameters to my test pages. Please add a detailed issue to JIRA for this. * Not sure if it is the PageTester or the rendering sequence, but I notice a difference in behavior on exception handling when using the PageTester. The call to renderPage() seems to have processed the exception, where previously the exception was thrown to the caller. The announing part is that the document returned only tells you the exception, in my case, a ClassNotFoundException was thrown while loading the xxxPage, but I can't tell which class was really not found. * There is a PageTesterModule that contributes to the PageTester environment. My issue is with contributeApplicationDefaults(), our module also issue an configuration.add(SymbolConstants.FORCE_ABSOLUTE_URIS, true). It turned out that an IllegalArgumentException is thrown when tapestry sees two add() calls for the same key. I use configuration.override() to fix my test, but that break my dev/prod environment because override() throws IllegalArgumentException when trying to override() an non-existent key. The IllegalArgumentException exception is thrown from MappedConfiguration.apply():line 42. That requires knowing if the key exists prior to calling override. Maybe a new API to peek into the config for existence check will do nicely. Actualy, PageTester should override FactoryDefaults, rather than provide ApplicationDefaults. This can be fixed. I have some work-arounds, but will be grateful for patches or better solutions. thanks in advance. - alex -- View this message in context: http://www.nabble.com/5.1.0.0-upgrade-issues.-tp22132202p22132202.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 -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - 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/5.1.0.0-upgrade-issues.-tp22132202p22166911.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 -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
AJAX Events
Hi! I've found some tutorials for AJAX in Tapestry, but there all about action event, fired form actionlink component. My questions is how to define custom events, i.e.. when some div is dropped. Thanks!
T5 : optional parameters in tml
I would like to know what's the best way to manage optional parameters in the tml template ? For example, if i have to write a tag like : div t:id=zipCodeField t:type=TextField value=zipcode validate=required / or div t:id=zipCodeField t:type=TextField value=zipcode / based on the value of a property. In one hand, i would rather avoid t:if tags in the template but in the other hand, something simple like validate=${myvalue} won't work. So, is there a simple way to do this ? Thanks in advance. Stephane
Re: [T5.1] Running on Glassfish?
Thanks Alex. Are you using Tapestry 5.1? Cheers, Levi akochnev wrote: I had tested my app on Glassfish v. 2 and v. 3 prelude and didn't have any issues. Cheers, Alex K -- View this message in context: http://n2.nabble.com/-T5.1--Running-on-Glassfish--tp2362542p2374812.html Sent from the Tapestry Users 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] Running on Glassfish?
Hi Howard, Does Tapestry set any of these system properties: javax.xml.stream.XMLEventFactory javax.xml.stream.XMLInputFactory javax.xml.stream.XMLOutputFactory and if so, to what values? Thanks, Levi Howard Lewis Ship wrote: 5.1 parses templates using the Woodstock STaX parser ... and it uses a couple of Woodstock extensions. I'm not familiar with Glassfish, but I suspect it is forcing its own STaX parser on you, ignoring the Woodstock parser. There probably an option to turn that off. -- View this message in context: http://n2.nabble.com/-T5.1--Running-on-Glassfish--tp2362542p2374826.html Sent from the Tapestry Users 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 : optional parameters in tml
I've found that the inherit: parameter binding makes quite a good job in this case ! Stephane Stephane Decleire a écrit : I would like to know what's the best way to manage optional parameters in the tml template ? For example, if i have to write a tag like : div t:id=zipCodeField t:type=TextField value=zipcode validate=required / or div t:id=zipCodeField t:type=TextField value=zipcode / based on the value of a property. In one hand, i would rather avoid t:if tags in the template but in the other hand, something simple like validate=${myvalue} won't work. So, is there a simple way to do this ? Thanks in advance. Stephane
Providing service mocks for integration tests
I'm implementing my user interface tests using selenium and the provided AbstractIntegrationTestSuite class. Everything is working fine. Still, i'd like to replace my DAO services implementation with some mock ones when i run the tests. The problem is that the services are declared in the application module so how do i override those declarations for testing purposes ? One workaround i found was to pass a VM parameter when i run the test goal and then in the bind method implementation i check for the parameter and declare either the prodution implementation or the mock one. Although this works it forces me to implement the mock objects in the main sources and not on the test sources where they should be. I was wondering if anyone had a better way to do this. Thanks.
Grid: multiple tr within grid row
Hi, I'd like to render multiple tr elements within the same grid row. Searching this mailing list seems to come up with a combination of subclassing Grid and GridRows (i.e. http://tapestry.markmail.org/search/?q=override+gridrows#query:override%20gridrows+page:1+mid:ztjjoksxggnbkstv+state:results_) -- was wondering if there was a more elegant way to do this? Thanks, Jason
t:beandisplay
Using the t:beandisplay I noticed a subtle bug? Normally, empty fields get a label on the left and a nbsp; on the right. This keeps the spacing correct. E.g., my Hibernate Entity has two java.util.Date classes, createdOn and modifiedOn. When I display the Entity via t:beandisplay, the outer brown background doesn't extend down to cover the last two properties -- so I investigated and it turns out that for the empty date values, the nbsp; is being left out of the right hand dd - which is throwing the entire display out of alignment. Right hand values get shifted up (two rows in my case) and start to line up with incorrect left hand labels. dt class=aboutAbout/dtdd class=aboutnbsp;/dd dt class=authorsAuthors/dtdd class=authorsnbsp;/dd dt class=contentContent/dtdd class=contentnbsp;/dd *dt class=createdOnCreated On/dtdd class=createdOn/dd dt class=modifiedOnModified On/dtdd class=modifiedOn/dd *dt class=parentParent/dtdd class=parent[0] Unfiled/dd dt class=tagsTags/dtdd class=tagsnbsp;/dd dt class=titleTitle/dtdd class=titleUnfiled/dd I think the java.util.Date fields should render nbsp; Does that sound correct? -Luther
Re: Providing service mocks for integration tests
What I do is, for test, to create a new application module almost the same as the one used in production, and then replace with mock dao if necessary. So the mock dao can be put in the test sources. Thanks! DH - Original Message - From: Hugo Palma hugo.m.pa...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Tuesday, February 24, 2009 8:06 AM Subject: Providing service mocks for integration tests I'm implementing my user interface tests using selenium and the provided AbstractIntegrationTestSuite class. Everything is working fine. Still, i'd like to replace my DAO services implementation with some mock ones when i run the tests. The problem is that the services are declared in the application module so how do i override those declarations for testing purposes ? One workaround i found was to pass a VM parameter when i run the test goal and then in the bind method implementation i check for the parameter and declare either the prodution implementation or the mock one. Although this works it forces me to implement the mock objects in the main sources and not on the test sources where they should be. I was wondering if anyone had a better way to do this. Thanks.
Re: App Block
On Sun, Feb 22, 2009 at 8:17 PM, Luther Baker lutherba...@gmail.com wrote: I have written an application property block (per the BeanEditForm tutorial) for a custom type. Is there a ideal event in the block component when I can assign the property to the PropertyEditContext? You don't assign values to PropertyEditContext: BeanEditorForm/BeanEditor does that for you automatically. Note that the tutorial never assign values to it. c) one final note - if I validate the custom property in this edit block - how do I indicate the problem ... if I don't have a form object etc as the Validation page suggests, Use BeanEditor instead. BeanEditForm is nothing more than a Form component with an Errors and a BeanEditor component declared inside it. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: @Validate a user defined property
On Sun, Feb 22, 2009 at 6:48 PM, Luther Baker lutherba...@gmail.com wrote: Now, I'd like to add @Validate(required) to this entity - only it isn't having any effect. I guess it only works for types Tapestry know how to handle (DefaultDataTypeAnalyzer, DataTypeAnalyzer). Maybe this could be expanded to handle any nullable type. I can create a t:form and manually validate this 'onSuccess' ( You should perform validations on onValidate(), not onSuccess(). The 'success' word here means that validation was successful. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Providing service mocks for integration tests
One thing I've done is to create a test module that @SubModule's the application module, and then uses alias/alias overrides to spot- override services from the sub-module (the application module) with test-specific services. Works pretty well. Robert On Feb 23, 2009, at 2/236:06 PM , Hugo Palma wrote: I'm implementing my user interface tests using selenium and the provided AbstractIntegrationTestSuite class. Everything is working fine. Still, i'd like to replace my DAO services implementation with some mock ones when i run the tests. The problem is that the services are declared in the application module so how do i override those declarations for testing purposes ? One workaround i found was to pass a VM parameter when i run the test goal and then in the bind method implementation i check for the parameter and declare either the prodution implementation or the mock one. Although this works it forces me to implement the mock objects in the main sources and not on the test sources where they should be. I was wondering if anyone had a better way to do this. Thanks. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
[T5.0.18] event method of actionlink was called twice
Hello, The event method of ActionLink seems to be called twice. Is this expected behavior? If yes, is there any way to let the event method to be called only once? osamuo -- View this message in context: http://www.nabble.com/-T5.0.18--event-method-of-actionlink-was-called-twice-tp22176003p22176003.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