Some Redirect after Post issues
Hi *, In my project (tap 4.02) I make heavy use of the redirect-after-post pattern with listeners such as this: public ILink onSubmit() { ... return getLinkService().getLink(...); } I have noticed that the PageValidationListener for the old page is always called when submitting a form, even when the form submission listener redirects to a different page. Sometimes this failed in my project. My question is: is it really necessary for tapestry to call this listener in case of redirect-after-post? From my point of view it would be sufficient when it is called after the redirect. Second, I also noticed that form validation with delegates does not work with redirect-after-post. So for all forms that need to be validated, I cannot use this pattern which is not so nice. Has this been changed in newer tapestry versions? Regards Bastian Voigt -- Bastian Voigt Neumünstersche Straße 4 20251 Hamburg mobil 0179/4826359 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Howto get locales's messages from a database
Hello, I would like to store locales messages in a database. In my application project, some users can translate messages by them self to create new locales or change some messages. It will be better if they can do that online via a web interface. I think it would not be great and dangerous if they directly edit messages files, so I need to store messages in a database. With a ORM like Hibernate and a cache system, performances should be good enough. Do you know where I've to start ? Thanks Cyrille - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Howto get locales's messages from a database
Cyrille37 a écrit : I would like to store locales messages in a database. In my application project, some users can translate messages by them self to create new locales or change some messages. It will be better if they can do that online via a web interface. I think it would not be great and dangerous if they directly edit messages files, so I need to store messages in a database. With a ORM like Hibernate and a cache system, performances should be good enough. Do you know where I've to start ? I've found in the hivemodule.xml of tapestry-4.0.2.jar a contribution : contribution configuration-id=Infrastructure property name=componentMessagesSource object=service:ComponentMessagesSource/ ... /contribution service-point id=ComponentMessagesSource Used to provide components (including pages) with access to their own localized messages. invoke-factory construct class=impl.ComponentMessagesSourceImpl event-listener service-id=ResetEventHub/ set-object property=componentPropertySource value=infrastructure:componentPropertySource/ /construct /invoke-factory /service-point Should I look that way to implement my need ?? Cyrille Thanks Cyrille - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Howto get locales's messages from a database
Yep, that's the way... There's also the wiki! http://wiki.apache.org/tapestry/UsingCustomResourceSource Cyrille37 wrote: Cyrille37 a écrit : I would like to store locales messages in a database. In my application project, some users can translate messages by them self to create new locales or change some messages. It will be better if they can do that online via a web interface. I think it would not be great and dangerous if they directly edit messages files, so I need to store messages in a database. With a ORM like Hibernate and a cache system, performances should be good enough. Do you know where I've to start ? I've found in the hivemodule.xml of tapestry-4.0.2.jar a contribution : contribution configuration-id=Infrastructure property name=componentMessagesSource object=service:ComponentMessagesSource/ ... /contribution service-point id=ComponentMessagesSource Used to provide components (including pages) with access to their own localized messages. invoke-factory construct class=impl.ComponentMessagesSourceImpl event-listener service-id=ResetEventHub/ set-object property=componentPropertySource value=infrastructure:componentPropertySource/ /construct /invoke-factory /service-point Should I look that way to implement my need ?? Cyrille Thanks Cyrille - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr Tapestry / Tacos developer Open Source / J2EE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Some Redirect after Post issues
Additionally, it seems that even pageBeginRender is called when using redirect after post. Now this really makes no sense does it? On Tuesday 12 December 2006 10:50, Bastian Voigt wrote: Hi *, In my project (tap 4.02) I make heavy use of the redirect-after-post pattern with listeners such as this: public ILink onSubmit() { ... return getLinkService().getLink(...); } I have noticed that the PageValidationListener for the old page is always called when submitting a form, even when the form submission listener redirects to a different page. Sometimes this failed in my project. My question is: is it really necessary for tapestry to call this listener in case of redirect-after-post? From my point of view it would be sufficient when it is called after the redirect. Second, I also noticed that form validation with delegates does not work with redirect-after-post. So for all forms that need to be validated, I cannot use this pattern which is not so nice. Has this been changed in newer tapestry versions? Regards Bastian Voigt -- Bastian Voigt Neumünstersche Straße 4 20251 Hamburg mobil 0179/4826359 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Some Redirect after Post issues
Bastian Voigt wrote: Additionally, it seems that even pageBeginRender is called when using redirect after post. Now this really makes no sense does it? It makes perfect sense to me ! (See more inline) On Tuesday 12 December 2006 10:50, Bastian Voigt wrote: Hi *, In my project (tap 4.02) I make heavy use of the redirect-after-post pattern with listeners such as this: public ILink onSubmit() { ... return getLinkService().getLink(...); } I have noticed that the PageValidationListener for the old page is always called when submitting a form, even when the form submission listener redirects to a different page. Sometimes this failed in my project. Why exactly does it fail? My question is: is it really necessary for tapestry to call this listener in case of redirect-after-post? Well, tapestry doesn't really know that you're to do a RAP. And even if it did, the PageValidationListener should still be called - perhaps the user doesn't have permission to submit the form - how would you capture this? And anyway, this is standard documented behavior of page and direct services. Howard's Tapestry in Actions contains several sequence diagrams that explain the process, i.e. when PageValidationListeners and PageBeginRenderListeners are called From my point of view it would be sufficient when it is called after the redirect. Second, I also noticed that form validation with delegates does not work with redirect-after-post. Why exactly don't they work? Are you persisting them somehow? You have to keep in mind that a RAP actually does a 2nd request , which means that unless you persist stuff, they're going to be gone after the 1st submit. That's where the tapestry-flash can help - so that you get minimum session usage. So for all forms that need to be validated, I cannot use this pattern which is not so nice. Has this been changed in newer tapestry versions? Regards Bastian Voigt -- Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr Tapestry / Tacos developer Open Source / J2EE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Translator and formating
Hello :-) Is it valid use to employ a translator to force input into a certain format? In particular, I want a string that is made up of 4 letters and 7 number to be formatted with dashes at the letters and numbers boundary and once again for the final number, e.g. ABCD-123456-7. If so, which translator would you recommend? Thank you, Yiannis Note:__ This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Jaguar Freight Services and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. This e-mail has been scanned for all known viruses. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Howto get locales's messages from a database
Andreas Andreou a écrit : Yep, that's the way... There's also the wiki! http://wiki.apache.org/tapestry/UsingCustomResourceSource YEAH ! That's it ! Thank you Andreas. Cyrille. Cyrille37 wrote: Cyrille37 a écrit : I would like to store locales messages in a database. In my application project, some users can translate messages by them self to create new locales or change some messages. It will be better if they can do that online via a web interface. I think it would not be great and dangerous if they directly edit messages files, so I need to store messages in a database. With a ORM like Hibernate and a cache system, performances should be good enough. Do you know where I've to start ? I've found in the hivemodule.xml of tapestry-4.0.2.jar a contribution : contribution configuration-id=Infrastructure property name=componentMessagesSource object=service:ComponentMessagesSource/ ... /contribution service-point id=ComponentMessagesSource Used to provide components (including pages) with access to their own localized messages. invoke-factory construct class=impl.ComponentMessagesSourceImpl event-listener service-id=ResetEventHub/ set-object property=componentPropertySource value=infrastructure:componentPropertySource/ /construct /invoke-factory /service-point Should I look that way to implement my need ?? Cyrille Thanks Cyrille - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
BeanPropertySelectionModel Dont't Work... (Tap 4.1.1 JPOX 1.1)
¿Why the Property Selection Model dont initialize the value to usuario.servicio? It returns OK the value selected but it dont initialize. Please . Help I have: (UsuarioPage.html): ... th align=rightServicio/th td select jwcid=[EMAIL PROTECTED] value=ognl:usuario.servicio model=ognl:ServicioSelection /select /td /tr .. (UsuarioPage.java): ... @Persist(session) public abstract Usuario getUsuario(); public abstract void setUsuario(Usuario usuario); ... public IPropertySelectionModel getServicioSelection() { if (servicios==null) { if (service==null) service = new AcidoService(); servicios = new BeanPropertySelectionModel( service.getLista(Servicio.class),descripcion); } return servicios; } ... public void pageBeginRender(PageEvent event) { Usuario usuario = new Usuario(); if (service==null) service = new AcidoService(); if (!event.getRequestCycle().isRewinding()) { if (!getNuevo()) usuario= (Usuario) service.findById(Usuario.class, getIdInterno()); this.setUsuario(usuario); /**setServicio(usuario.getServicio());**/ /**servicios = new BeanPropertySelectionModel( service.getLista(Servicio.class),descripcion);**/ /**ubicaciones = new MapSelectionModel(service.getMap(Ubicacion.class));**/ /**/ } } ... Thanks Juan Carlos García García
Re: Problem generating content based on a conditional statement!
Hey Nick, thanks for the explanation. I change my span tag like you suggested to span jwcid=@If condition=ognl:businessCardListEntry.isHavingPendingSiteContactDTO and now everything is working just fine Cheers, Jacob -- View this message in context: http://www.nabble.com/Problem-generating-content-based-on-a-conditional-statement%21-tf2796443.html#a7834666 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: Some Redirect after Post issues
On Tuesday 12 December 2006 13:36, Andreas Andreou wrote: I have noticed that the PageValidationListener for the old page is always called when submitting a form, even when the form submission listener redirects to a different page. Sometimes this failed in my project. Why exactly does it fail? It fails because the form does not include some parameters which are required for the page. The page validation listener throws a redirect exception when these parameters are not set. Let me further explain what I am doing - Some pages in my application are area dependent, i.e. a parameter area is required for accessing these pages. I need the area as a real parameter in the URL, because I use a FriendlyURL filter to make URLs like mysite.com/hamburg/index.html, mysite.com/london/index.html etc. That's why I do not persist the area. Now when I use a form on one of my area pages which redirects to a non-area dependent page, then I do not include the area name as part of the form. In these cases my PageValidation listener jumps in and redirects me to an error page. Well, tapestry doesn't really know that you're to do a RAP. And even if it did, the PageValidationListener should still be called - perhaps the user doesn't have permission to submit the form - how would you capture this? But I cannot capture this with the PageValidationListener either, because it does not tell me whether a form was submitted or just the page was accessed normally. And anyway, this is standard documented behavior of page and direct services. Howard's Tapestry in Actions contains several sequence diagrams that explain the process, i.e. when PageValidationListeners and PageBeginRenderListeners are called Then it's perhaps a wording issue. The name PageBeginRenderListener implies to me that it is called when a page is to be rendered. But in case of RAP, no page is going to be rendered after the first request. Why exactly don't they work? Are you persisting them somehow? You have to keep in mind that a RAP actually does a 2nd request , which means that unless you persist stuff, they're going to be gone after the 1st submit. Yes, I am using the @Persist(session) annotation. Adding validators to the form text fields simply has no effect. The values are always accepted. That's where the tapestry-flash can help - so that you get minimum session usage. Yes, I am using that for rendering some error messages, so that they disappear after the next action. -- Bastian Voigt Neumünstersche Straße 4 20251 Hamburg mobil 0179/4826359 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
After all this? Tapester 4.1 and JDK 1.4?!
Ack! So I think I sorted out everything in moving from 4.0 - 4.1! Does 4.1 support JDK 1.4?! I get some oh-so-familiar errors ---Original exception--- java.lang.UnsupportedClassVersionError: org/apache/tapestry/ApplicationServlet (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code)) I'd get these with other libraries that were compiled for 1.5 only! Say it isn't so?!?! Thanks, Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Some Redirect after Post issues
Bastian Voigt wrote: On Tuesday 12 December 2006 13:36, Andreas Andreou wrote: I have noticed that the PageValidationListener for the old page is always called when submitting a form, even when the form submission listener redirects to a different page. Sometimes this failed in my project. Why exactly does it fail? It fails because the form does not include some parameters which are required for the page. The page validation listener throws a redirect exception when these parameters are not set. Let me further explain what I am doing - Some pages in my application are area dependent, i.e. a parameter area is required for accessing these pages. I need the area as a real parameter in the URL, because I use a FriendlyURL filter to make URLs like mysite.com/hamburg/index.html, mysite.com/london/index.html etc. That's why I do not persist the area. Now when I use a form on one of my area pages which redirects to a non-area dependent page, then I do not include the area name as part of the form. In these cases my PageValidation listener jumps in and redirects me to an error page. Since the form is in an 'area page' and tapestry's submits trigger the same page (i.e. the listeners are found on the current page) it's only normal that the validation listener will complain... Can't you include the current area as a hidden form field, so that it gets submitted and your validation listener gets satisfied? This, (though I dislike it) could also work: http://mail-archives.apache.org/mod_mbox/jakarta-tapestry-user/200512.mbox/[EMAIL PROTECTED] Well, tapestry doesn't really know that you're to do a RAP. And even if it did, the PageValidationListener should still be called - perhaps the user doesn't have permission to submit the form - how would you capture this? But I cannot capture this with the PageValidationListener either, because it does not tell me whether a form was submitted or just the page was accessed normally. Can't you try cycle.getParameter or something? And anyway, this is standard documented behavior of page and direct services. Howard's Tapestry in Actions contains several sequence diagrams that explain the process, i.e. when PageValidationListeners and PageBeginRenderListeners are called Then it's perhaps a wording issue. The name PageBeginRenderListener implies to me that it is called when a page is to be rendered. But in case of RAP, no page is going to be rendered after the first request. Why exactly don't they work? Are you persisting them somehow? You have to keep in mind that a RAP actually does a 2nd request , which means that unless you persist stuff, they're going to be gone after the 1st submit. Yes, I am using the @Persist(session) annotation. Adding validators to the form text fields simply has no effect. The values are always accepted. That's where the tapestry-flash can help - so that you get minimum session usage. Yes, I am using that for rendering some error messages, so that they disappear after the next action. -- Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr Tapestry / Tacos developer Open Source / J2EE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
dojo error
Hi, i am using tapestry-annotations-4.1.1-20061211.220316-20.jar and tapestry-framework-4.1.1-20061203.170421-12.jar. i get this error when i try to load my app DEBUG: failed loading /northstaradmin/assets/static/dojo/../tapestry/ namespace.js with error: [TypeError: dojo.hostenv.moduleHasPrefix is not a function, file: http://localhost:8080/northstaradmin/assets/ static/dojo/dojo.js, line: 116] I didnt have this issue with the official tapestry4.1 jar. I need to use the dojo modal dialog and it wasnt working in my @shell everthough i gave parsewidgets=true for my @shell component. But with this snapshot, my model dialog seems to be working, but get this dojo error. Can some one help me out please? Thanks a lot! Anjana Gopinath
Re: Translator and formating
I think MaskEdit would work for you. http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/maskedit.html On 12/12/06, Yiannis Mavroukakis [EMAIL PROTECTED] wrote: Hello :-) Is it valid use to employ a translator to force input into a certain format? In particular, I want a string that is made up of 4 letters and 7 number to be formatted with dashes at the letters and numbers boundary and once again for the final number, e.g. ABCD-123456-7. If so, which translator would you recommend? Thank you, Yiannis Note:__ This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Jaguar Freight Services and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. This e-mail has been scanned for all known viruses. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Translator and formating
Thank you Jesse..I assume this is available for 4.0.x correct? On Tue, 2006-12-12 at 11:41 -0500, Jesse Kuhnert wrote: I think MaskEdit would work for you. http://tapestry.apache.org/tapestry4.1/tapestry-contrib/componentreference/maskedit.html On 12/12/06, Yiannis Mavroukakis [EMAIL PROTECTED] wrote: Hello :-) Is it valid use to employ a translator to force input into a certain format? In particular, I want a string that is made up of 4 letters and 7 number to be formatted with dashes at the letters and numbers boundary and once again for the final number, e.g. ABCD-123456-7. If so, which translator would you recommend? Thank you, Yiannis Note:__ This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Jaguar Freight Services and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. This e-mail has been scanned for all known viruses. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Type Converter question
When refreshing a form, I get the error: No type converter for type TypeABC My question is: Why does Tapestry (4.0) invoke a type converter. What does Tapestry use it for? Ed
Tapestry Component using another Component (in this case JSCookMenu)
Hi! I've build a Home page with the JsCookMenu. No problems doing so, it works according to the example of the JSCookMenu site. The problem is that instad of using the Jscookmenu on the Home page, I've built Border component, where on the HTML template page I've put the jscookmenu. Well I'm unable to make it work... My .JWC file: component-specification asset path=classpath:/com/part/tapestry/start-menu.xml name=xmlModel / parameter name=source property=menuModel /parameter parameter name=value property=menuItem /parameter parameter name=theme default-value=Office2003/parameter parameter name=position default-value=hbr /parameter /component-specification My HTML file: html head/head body jwcid=@Body table border=0 width=100% thead tr th span jwcid=@menu:JSCookMenu source=ognl:menuModel value=ognl:menuItem theme=Office2003 position=hbr effect=CMSlidingEffect(8) a href=# jwcid=[EMAIL PROTECTED] listener=listener:onNavigate parameters=ognl:menuItem.value span jwcid=@Insert value=ognl:menuItem.value/ /a /span /th The Java page is the one from the jscookmenu site for the JSCookMenu component. So there is no error, but the menu doesn't render. html head/head body script type=text/javascript src=/apliapp/app?digest=b190e8e8797dfda62ef63c45592706e8amp;service=assetamp;path=%2FJSCookMenu-mod.js/script script type=text/javascript src=/apliapp/app?digest=10368912e50baa9b12ed0b1e8d94e0edamp;service=assetamp;path=%2FLinkDecorator.js/script script type=text/javascript src=/apliapp/app?digest=a70eeb758ec04c69dcc4b45f4a31c8daamp;service=assetamp;path=%2Feffect.js/script script type=text/javascript!-- var NPHome__Border__JSCookMenu_divId = new Object(); NPHome__Border__JSCookMenu_divId['effect'] = new CMSlidingEffect(8); // --/script table border=0 width=100% thead tr th link rel=stylesheet href=/apliapp/app?resType=cssservice=jscookthemetheme=Office2003timestamp=1165944336111 type=text/css/ script type=text/javascript src=/apliapp/app?resType=jsamp;service=jscookthemeamp;theme=Office2003amp;timestamp=1165944336111/script div id=Home__Border__JSCookMenu_divIdul style=visibility: hidden;/ul/div script type=text/javascript!-- themeOffice2003_Draw('Home__Border__JSCookMenu_divId', 'hbr', NPHome__Border__JSCookMenu_divId, null, null, null, '1165944382427'); // --/script /th It seems that the page doesn't find the resources needed to render the menu. Do I need to put something on the component specification regarding the Jscookmenu assets? Any ideas, tips? Thanks! Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Just out of curiousity[OT]
Hi Jesse, I'm a Tapestry user and while googling today I found a message from you to the Wicket user mailing list. Are you a commiter/user of Wicket as well? Emmanuel
RE: Getting rid of .getVisit()
Okay, I've set this up in my ApplicationServlet's init() method Registry myRegistry = RegistryBuilder.constructDefaultRegistry(); PCTAdminApplicationServlet.asm = (ApplicationStateManager)myRegistry.getService(ApplicationStateManager.class); then i have this in a new method I made called getAdminVisit() --- AdminVisit aVisit = (AdminVisit) PCTAdminApplicationServlet.asm.get(visit); if (aVisit == null) aVisit = new AdminVisit(); PCTAdminApplicationServlet.asm.store(visit, aVisit); return aVisit; -- However, I get a null pointer exception on the very first line there. Any ideas? I find where Tapestry and Hivemind meet is very hard to get any documentation on, it's like a fringe area... Thanks, Greg -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Dennis Sinelnikov Sent: Friday, December 08, 2006 9:45 PM To: users@tapestry.apache.org Subject: Re: Getting rid of .getVisit() [EMAIL PROTECTED] wrote: Unfortunately I'm stuck with JDK 1.4 since our appserver is Websphere 5.1 :-( -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Friday, December 08, 2006 3:34 PM To: Tapestry users Subject: Re: Getting rid of .getVisit() Not if you use annotations. Unlike xml - annotations can actually be inherited very easily. On 12/8/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: So every .page file needs this? :o -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Friday, December 08, 2006 3:27 PM To: Tapestry users Subject: Re: Getting rid of .getVisit() You can have it injected into something via a .page/.jwc file by doing something like: inject property=registration type=state object=registration-data/ (http://tapestry.apache.org/tapestry4.1/usersguide/state.html) or you use an annotation to do the same: @InjectState public abstract MyAppVisit getVisit(); http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html#InjectState On 12/8/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks, I'll start tackling the hivemodule.xml I suppose to just create an instance of my class instead of whatever default Visit tap provides. How do I go about actually retrieving this object with Hivemind? Wh -Original Message- From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] Sent: Friday, December 08, 2006 3:11 PM To: Tapestry users Subject: Re: Getting rid of .getVisit() I'll have to check into that particular claim in the current documentation to be sure. Previously I think a HashMap was created by default but since removal of the (as of 4.0 deprecated visit) functionality all of that logic may be moot. An easy example of doing this can be found here, you want to look at the very first block of xml in the file for configuration : http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/WEB-INF/hivemodule.xml?view=markup I'll gmail start this email either way and try to make sure that page of documentation is updated , as well as hopefully providing a friendlier online example than that had by browsing svn source. On 12/8/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Alright so I'm making the jump to 4.1, which totally kills BasePage.getVisit()! I knew I should of cleaned up my act in 4.0 :) Can anyone help me switch over? I'm reading this page http://tapestry.apache.org/tapestry4.1/usersguide/state.html#state.aso I'm confused if I need to actually do some hivemind stuff.. it says it still provides a default Visit object... so can I use that default object somehow? Thanks, Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Another option would be to create a singleton to hold onto tapestry's hivemind registry, you can do this in your
Optgroup
I have an implementation of IPropertySelectionModel that works fine, but I was looking for an easy way to divide them into groups using the optgroup tag like so: select optgroup label=food optionburger/option optionhot dog/option /optgroup optgroup label=drink optionbeer/option optionsoda/option /optgroup /select What is the easiest way to accomplish this without rewriting too much? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Automated Testing Tool
Hi all, Are there any tools that allow to build automated tests for tapestry apps? Do they suport Tacos and Dojo? cheers, miguel
Re: Automated Testing Tool
Selenium and its wrapper STIQ. --- Miguel Angel Hernández [EMAIL PROTECTED] wrote: Hi all, Are there any tools that allow to build automated tests for tapestry apps? Do they suport Tacos and Dojo? cheers, miguel Konstantin Ignatyev PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000 Bowers, C.A. The Culture of Denial: Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools. New York: State University of New York Press, 1997: (4) (5) (p.206) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Optgroup
There is a renderer parameter to the PropertySelection component, which sadly is being ignored. here are the classes, you can just copy, set the package and use. They are a modified version of the PropertySelection component cheers, Ron == import org.apache.tapestry.*; import org.apache.tapestry.form.*; import org.apache.tapestry.valid.ValidatorException; /** * A component used to render a drop-down list of options that the user may select. [ a * href=../../../../../ComponentReference/PropertySelection.htmlComponent Reference /a] * p * Earlier versions of PropertySelection (through release 2.2) were more flexible, they included a * brenderer /b property that controlled how the selection was rendered. Ultimately, this proved * of little value and this portion of functionality was deprecated in 2.3 and will be removed in * 2.3. * p * Typically, the values available to be selected are defined using an * [EMAIL PROTECTED] org.apache.commons.lang.enum.Enum}. A PropertySelection is dependent on an * [EMAIL PROTECTED] IPropertySelectionModel} to provide the list of possible values. * p * Often, this is used to select a particular [EMAIL PROTECTED] org.apache.commons.lang.enum.Enum} to assign to * a property; the [EMAIL PROTECTED] EnumPropertySelectionModel} class simplifies this. * p * Often, a drop-down list will contain an initial option that serves both as a label and to represent * that nothing is selected. This can behavior can easily be achieved by decorating an existing * [EMAIL PROTECTED] IPropertySelectionModel} with a [EMAIL PROTECTED] LabeledPropertySelectionModel}. * p * As of 4.0, this component can be validated. * * @author Howard Lewis Ship * @author Paul Ferraro */ public abstract class RendererPropertySelection extends PropertySelection implements ValidatableField { /** * @see org.apache.tapestry.form.AbstractFormComponent#renderFormComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle) */ protected void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle) { renderDelegatePrefix(writer, cycle); writer.begin(select); writer.attribute(name, getName()); if (isDisabled()) writer.attribute(disabled, disabled); if (getSubmitOnChange()) writer.attribute(onchange, javascript: this.form.events.submit();); renderIdAttribute(writer, cycle); renderDelegateAttributes(writer, cycle); getValidatableFieldSupport().renderContributions(this, writer, cycle); // Apply informal attributes. renderInformalParameters(writer, cycle); writer.println(); IPropertySelectionModel model = getModel(); if (model == null) throw Tapestry.createRequiredParameterException(this, model); int count = model.getOptionCount(); boolean foundSelected = false; Object value = getValue(); IPropertySelectionRenderer renderer = getRenderer(); if ( renderer == null ( model instanceof IPropertySelectionRenderer ) ) if ( ! isDefaultRenderer() ) renderer = (IPropertySelectionRenderer) model; for (int i = 0; i count; i++) { Object option = model.getOption(i); boolean isSelected = !foundSelected isEqual(option, value); if ( renderer != null ) renderer.renderOption( this , writer, cycle , model , option, i , isSelected ); else { writer.begin(option); writer.attribute(value, model.getValue(i)); if ( isSelected ) { writer.attribute(selected, selected); foundSelected = true; } writer.print(model.getLabel(i)); writer.end(); } writer.println(); } writer.end(); // select renderDelegateSuffix(writer, cycle); } /** * @see org.apache.tapestry.form.AbstractFormComponent#rewindFormComponent(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle) */ protected void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle) { String value = cycle.getParameter(getName()); Object object = (value == null) ? null : getModel().translateValue(value); try { getValidatableFieldSupport().validate(this, writer, cycle, object); setValue(object); } catch (ValidatorException e) { getForm().getDelegate().record(e); } } private boolean isEqual(Object left, Object right) { // Both null, or same object, then are equal if (left == right)
Re: Some Redirect after Post issues
Andreas Andreou schrieb: Since the form is in an 'area page' and tapestry's submits trigger the same page (i.e. the listeners are found on the current page) it's only normal that the validation listener will complain... Can't you include the current area as a hidden form field, so that it gets submitted and your validation listener gets satisfied? Yes, this is my actual workaraound for the problem. But this means that I need to add the hidden field to each and every form component that might be used on an area page. This is not what I would call intuitive. If ever someone else is to work on my code and add another form, he/she will be totally confused by the error thrown by the page validation listener, imho. This, (though I dislike it) could also work: http://mail-archives.apache.org/mod_mbox/jakarta-tapestry-user/200512.mbox/[EMAIL PROTECTED] Maybe I'll try that one :-) I could make an empty page which is used only for redirect-after-post and which has no page validation listener or begin render listener. However, this is also quite confusing since the listeners are in a separate class... Regards Bastian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Some Redirect after Post issues
Bastian Voigt wrote: Andreas Andreou schrieb: Since the form is in an 'area page' and tapestry's submits trigger the same page (i.e. the listeners are found on the current page) it's only normal that the validation listener will complain... Can't you include the current area as a hidden form field, so that it gets submitted and your validation listener gets satisfied? Yes, this is my actual workaraound for the problem. But this means that I need to add the hidden field to each and every form component that might be used on an area page. or create AreaForm, your own Form component that handles this transparently to its users! Perhaps there's an even cleaner solution... it eludes me -- Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr Tapestry / Tacos developer Open Source / J2EE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: @EventListener question
I think what Jesse says is exactly what is expected and intuitive, but I've just spent 3 hours proving that it needs those redundant divs if you want it to work (unless I've misunderstood, or am approaching this wrong). Case in point, using the Dec 12, 4.1.1 snapshot: @EventListener( events = onchange, targets=hotspotSelection, async=true, submitForm = hotspotSelectForm, validateForm = false) public void viewHotspot(IRequestCycle cycle) { cycle.getResponseBuilder().updateComponent(hotspotId); } -- input jwcid=[EMAIL PROTECTED] value=ognl: selectedHotspot.id / -- doesn't work. The proper ajax response is returned with the correct data, but the hotspotId is never updated in js (not sure why). Wrapping it in a div fixes the problem: @EventListener( events = onchange, targets=hotspotSelection, async=true, submitForm = hotspotSelectForm, validateForm = false) public void viewHotspot(IRequestCycle cycle) { cycle.getResponseBuilder().updateComponent(hotspotIdDiv); } -- div jwcid=[EMAIL PROTECTED]input jwcid=[EMAIL PROTECTED] value=ognl: selectedHotspot.id //div -- Hopefully that helps someone else. BTW, I love the new AJAX functionality and appreciate everyone's work!! J On 10-Sep-06, at 8:43 AM, Jesse Kuhnert wrote: Also, just as an FYI a lot of the examples I've been seeing lately include what appears to be a lot of redundant div enclosures around content you want to update. I've worked very hard to make sure the component id logic is universally correct, so you should be able to just reference a particular component directly for updating.. The only time you need to enclose something is when it may not actually be rendered yet (and therefore not have any html element to replace on an update)..One example of this is a span jwcid=@If type block. On 9/9/06, Josh Long [EMAIL PROTECTED] wrote: I'm not 100% sure, but try changing div id =quoteDiv to div jwcid=[EMAIL PROTECTED] ... That way, builder.updateComponent wil update a tapestry component.. Peace, Josh On 9/8/06, Vinicius Carvalho [EMAIL PROTECTED] wrote: Hello there! Does EventListener + ResponseBuilder supports all components? For instance, is it possible to update contents presented by a @Insert? I was trying a simple quote app and can't get it working: @EventListener(elements = fetchQuotes, events=onmouseover) public void getQuotes(IRequestCycle cycle){ ResponseBuilder builder = cycle.getResponseBuilder(); setQuote(getQuotesFromDB()); builder.updateComponent(quoteDiv); } div id=fetchQuotesspan jwcid=@Insert value=ognl:now/Mouse over here to get more quotes.../divbrbr div id=quoteDivspan jwcid=[EMAIL PROTECTED] value=ognl:quote/span/div What's the right way? Regards - -- Julian Wood [EMAIL PROTECTED] Software Engineer Teaching Learning Centre University of Calgary http://tlc.ucalgary.ca
Re: Type Converter question
Chances are good this is related to a client-side persistent property, or a property stored inside a form using Hidden. A type converter is most likely being used to convert from a string to some server-side type. Perhaps you tried to update a property that is really an entity type? A stack trace would help narrow it down. On 12/12/06, Ed Cohen [EMAIL PROTECTED] wrote: When refreshing a form, I get the error: No type converter for type TypeABC My question is: Why does Tapestry (4.0) invoke a type converter. What does Tapestry use it for? Ed -- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com