Re: Tapestry 5.0.12
Hi Howard! Don't forget to release Tapestry 5.0.12 together with a useful demo application once the time is ripe. The more demos, the bettermaybe even a Petshop 2.0 with Ajax widgets? So long Tobias Original-Nachricht Datum: Tue, 22 Apr 2008 20:20:49 -0700 Von: Howard Lewis Ship [EMAIL PROTECTED] An: Tapestry users users@tapestry.apache.org Betreff: Tapestry 5.0.12 People have been leaving messages on my blog that they want Tapestry 5.0.12. I don't think it's time yet. I'm using T5 for a client project with a fair amount of DHTML (fancy hiding and revealing menus) and a chunk of Ajax. This is giving me a chance to nail down some limitations and omissions, and tackle some nasty InternetExplorer-is-brain-dead issues. Given how easy it is to get a nightly build, or build locally, I don't think there's that much advantage to cranking out an official release -- a process that requires several days to vote, and an hour or two of my time to perform the builds and uploads. A new feature about to roll out is a client-side JavaScript console which will make debugging (especially on IE) a lot easier. I've also been developing for my app an AjaxFormLoop, a way of combining Loop, FormInjector and a few other bits and pieces to allow dynamic addition and removal of items from a list; basically, the kind of thing you do for master/detail relationships. Anyway, please be patient or use the nightlies. Tapestry 5 is getting very close to a next release (which I think may even be a release candidate), but that's no reason to ship it early. Let me continue to use it in anger and find the rough spots. -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - 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]
Re: [T4]hivemind variables in components
What about a new binding? You could inject a service into the binding which is responsible for resolving HiveMind symbols. On Wed, Apr 23, 2008 at 1:12 AM, Patrick Moore [EMAIL PROTECTED] wrote: Hi there -- O.k. I feel silly -- but how do I use hivemind variables directly in a component. I know how to pass hivemind variables to services. But how to use those values in the components? For example, I would like to use the hivemind variable 'amplafi.production' as the condition in a @If for example,: span jwcid=@If condition=amplafi.production hey there amplafi.production is true! /span -Pat -- Best regards, Igor Drobiazko
Is it possible to prevent the render method in parent component from being invoked?
Hi, First I know it is a feature that parent method is prior to child's. I need to extend GridPager component because the action link in GridPager doesn't have a context parameter, so the context info of the link is very limited(only the page No.). And I don't like to persist context in session. The case is that in a user list page with search function and Grid component, user input keyword username, role and so on, and then click 'search' button, the relevant result will be shown in a Grid's page 1, but when user clicks page 2, the search keyword is missing, then the result is wrong which is not expected. So I extend GridPager to provide context to actionlink, but because it (as parent) implements a method beginRender() which is always invoked by Tapestry5 ahead of my GridPager's beginRender(), so now there would be two pager generated in list page. So is there a way to prevent the render method in parent from being invoked? And how? And what's the best practice here dealing with search funcion with Grid? Anyone please share your experience. Thanks in advance. DH
How to have default /app rootContext web access pass the dispatcher chain
Hi, I've written an adapter - inspired by work by Chris. However when I access my application the 'rootContext' web access, doesn't pass thru this dispatcher. Basically what I want is for every request to be introspected by my dispatcher. Is that possible? -J. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Is it possible to prevent the render method in parent component from being invoked?
Hi, First I know it is a feature that parent method is prior to child's. I need to extend GridPager component because the action link in GridPager doesn't have a context parameter, so the context info of the link is very limited(only the page No.). And I don't like to persist context in session. The case is that in a user list page with search function and Grid component, user input keyword username, role and so on, and then click 'search' button, the relevant result will be shown in a Grid's page 1, but when user clicks page 2, the search keyword is missing, then the result is wrong which is not expected. So I extend GridPager to provide context to actionlink, but because it (as parent) implements a method beginRender() which is always invoked by Tapestry5 ahead of my GridPager's beginRender(), so now there would be two pager generated in list page. So is there a way to prevent the render method in parent from being invoked? And how? And what's the best practice here dealing with search funcion with Grid? Anyone please share your experience. Thanks in advance. DH
Is it possible to prevent the render method in parent component from being invoked?
Hi, First I know it is a feature that parent method is prior to child's. I need to extend GridPager component because the action link in GridPager doesn't have a context parameter, so the context info of the link is very limited(only the page No.). And I don't like to persist context in session. The case is that in a user list page with search function and Grid component, user input keyword username, role and so on, and then click 'search' button, the relevant result will be shown in a Grid's page 1, but when user clicks page 2, the search keyword is missing, then the result is wrong which is not expected. So I extend GridPager to provide context to actionlink, but because it (as parent) implements a method beginRender() which is always invoked by Tapestry5 ahead of my GridPager's beginRender(), so now there would be two pager generated in list page. So is there a way to prevent the render method in parent from being invoked? And how? And what's the best practice here dealing with search funcion with Grid? Anyone please share your experience. Thanks in advance. DH
T5 contributeMasterDispatcher - how to have default rootContext access be part of it
Hi, Just posted a question on dispatcher chain - but I think the subject line was way to unclear - so sorry for asking the question again. I want all of my pages (also the one that is shown when I access root context without anything - so no '/start') to be passed thru my dispatcher. How can I do that? -J. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5]: javax.mail from Tapestry
Hello, In my dev environment (running jetty6 from inside Eclipse), I'm able to use javax.mail classes and successfully connect to my mail server to send a message. But when I migrate the code to my production server (jetty6 also), everything seems to work correctly except that the app doesn't connect to the outbound mail server. I've watched the packets (tcpdump), so I know that the webserver isn't even trying to connect to the mail server. There are no errors mentioned in the log. In fact, I can only get startup/shutdown messages and Hibernate messages written to the log, for some reason I can't seem to control what's being logged in production (although I can in dev). The logging is not my major issue...I don't care about that as long as I get mail working (I'll go back and fix logging later). Can someone help me with javax.mail? Here is the relevant line from my pom.xml: dependency groupIdjavax.mail/groupId artifactIdmail/artifactId version1.4.1/version /dependency Help? Perhaps the first step is to try to get logging working. Thanks, Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 contributeMasterDispatcher - how to have default rootContext access be part of it
Hi Jan, The first 2 paragraphs of this article cover what you want to do: http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher Included also are relevant links to javadocs, as well as references to the TapestryModule, where you can see how it influences dispatcher ordering. chris Jan Vissers wrote: Hi, Just posted a question on dispatcher chain - but I think the subject line was way to unclear - so sorry for asking the question again. I want all of my pages (also the one that is shown when I access root context without anything - so no '/start') to be passed thru my dispatcher. How can I do that? -J. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- http://thegodcode.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5]: javax.mail from Tapestry
Hi Andy, If exceptions aren't being thrown from the services/pages that use the mail classes, then the javax.mail is present. Is it possible that your server (or it's network) is blocking outbound smtp connections? chris Andy Huhn wrote: Hello, In my dev environment (running jetty6 from inside Eclipse), I'm able to use javax.mail classes and successfully connect to my mail server to send a message. But when I migrate the code to my production server (jetty6 also), everything seems to work correctly except that the app doesn't connect to the outbound mail server. I've watched the packets (tcpdump), so I know that the webserver isn't even trying to connect to the mail server. There are no errors mentioned in the log. In fact, I can only get startup/shutdown messages and Hibernate messages written to the log, for some reason I can't seem to control what's being logged in production (although I can in dev). The logging is not my major issue...I don't care about that as long as I get mail working (I'll go back and fix logging later). Can someone help me with javax.mail? Here is the relevant line from my pom.xml: dependency groupIdjavax.mail/groupId artifactIdmail/artifactId version1.4.1/version /dependency Help? Perhaps the first step is to try to get logging working. Thanks, Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- http://thegodcode.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 contributeMasterDispatcher - how to have default rootContext access be part of it
Hi Chris, Thank you. As a matter of fact I used your wiki entries as my main inspiration. So what I do now is: use: before:RootPath for the contributation and return 'false' on the dispath for '/login and '/assets/' This works but in the background the following stuff is logged (To be more precise I'm using an ASO in my dispatcher) Question is: should this worry me? [DEBUG] SecurityController In dispatch for / [INFO] TimingFilter Request time: 1 ms [ERROR] RequestExceptionHandler Processing of request failed with uncaught exception: Cannot create a session after the response has been committed org.apache.tapestry.runtime.ComponentEventException: Cannot create a session after the response has been committed at org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1021) at org.apache.tapestry.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:52) at org.apache.tapestry.services.TapestryModule $29.handle(TapestryModule.java:1607) at $PageRenderRequestHandler_1197add4787.handle($PageRenderRequestHandler_1197add4787.java) at $PageRenderRequestHandler_1197add4779.handle($PageRenderRequestHandler_1197add4779.java) at org.apache.tapestry.internal.services.RootPathDispatcher.dispatch(RootPathDispatcher.java:61) at $Dispatcher_1197add4781.dispatch($Dispatcher_1197add4781.java) at $Dispatcher_1197add4772.dispatch($Dispatcher_1197add4772.java) at org.apache.tapestry.services.TapestryModule $13.service(TapestryModule.java:944) at com.*.lighting.guidecontrol.view.services.AppModule $1.service(AppModule.java:83) at $RequestFilter_1197add4771.service($RequestFilter_1197add4771.java) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:42) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.services.TapestryModule $3.service(TapestryModule.java:553) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.services.TapestryModule $2.service(TapestryModule.java:520) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:93) at org.apache.tapestry.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:84) at org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77) at org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at $RequestHandler_1197add476a.service($RequestHandler_1197add476a.java) at org.apache.tapestry.services.TapestryModule $12.service(TapestryModule.java:924) at org.apache.tapestry.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $HttpServletRequestFilter_1197add4769.service($HttpServletRequestFilter_1197add4769.java) at $HttpServletRequestHandler_1197add476b.service($HttpServletRequestHandler_1197add476b.java) at $HttpServletRequestHandler_1197add4768.service($HttpServletRequestHandler_1197add4768.java) at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:168) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint $Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:735) Caused by: java.lang.IllegalStateException: Cannot create a session after the response has been committed at
Re: [T5]: javax.mail from Tapestry
I thought about that, but wouldn't tcpdump show the packets, even if they were being blocked? I was looking for all packets with port 25. Also, my code that's using javax.mail to send a message is looking for exceptions, and writing to the log file if that happens. I haven't seen anything in the log file (although, like I mentioned, it's possible that my logging is broken). Heading off to work now...I'll check in on this again tonight/tomorrow morning. Thanks again for all your help (in advance), Andy On Wed, 2008-04-23 at 12:37 +0200, Chris Lewis wrote: Hi Andy, If exceptions aren't being thrown from the services/pages that use the mail classes, then the javax.mail is present. Is it possible that your server (or it's network) is blocking outbound smtp connections? chris Andy Huhn wrote: Hello, In my dev environment (running jetty6 from inside Eclipse), I'm able to use javax.mail classes and successfully connect to my mail server to send a message. But when I migrate the code to my production server (jetty6 also), everything seems to work correctly except that the app doesn't connect to the outbound mail server. I've watched the packets (tcpdump), so I know that the webserver isn't even trying to connect to the mail server. There are no errors mentioned in the log. In fact, I can only get startup/shutdown messages and Hibernate messages written to the log, for some reason I can't seem to control what's being logged in production (although I can in dev). The logging is not my major issue...I don't care about that as long as I get mail working (I'll go back and fix logging later). Can someone help me with javax.mail? Here is the relevant line from my pom.xml: dependency groupIdjavax.mail/groupId artifactIdmail/artifactId version1.4.1/version /dependency Help? Perhaps the first step is to try to get logging working. Thanks, Andy - 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]
Re: [T5]: javax.mail from Tapestry
Sounds like an issue with the server configuration, I suggest you get the logs to work first, then you might get a better idea of why the mail isn't working... if it works in development then chances are you are missing a host entry or something small like that, which will pop up in the logs. Andy Huhn wrote: Hello, In my dev environment (running jetty6 from inside Eclipse), I'm able to use javax.mail classes and successfully connect to my mail server to send a message. But when I migrate the code to my production server (jetty6 also), everything seems to work correctly except that the app doesn't connect to the outbound mail server. I've watched the packets (tcpdump), so I know that the webserver isn't even trying to connect to the mail server. There are no errors mentioned in the log. In fact, I can only get startup/shutdown messages and Hibernate messages written to the log, for some reason I can't seem to control what's being logged in production (although I can in dev). The logging is not my major issue...I don't care about that as long as I get mail working (I'll go back and fix logging later). Can someone help me with javax.mail? Here is the relevant line from my pom.xml: dependency groupIdjavax.mail/groupId artifactIdmail/artifactId version1.4.1/version /dependency Help? Perhaps the first step is to try to get logging working. Thanks, Andy - 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]
Is it possible to prevent the render method in parent component from being invoked?
Hi, First I know it is a feature that parent method is prior to child's. I need to extend GridPager component because the action link in GridPager doesn't have a context parameter, so the context info of the link is very limited(only the page No.). And I don't like to persist context in session. The case is that in a user list page with search function and Grid component, user input keyword username, role and so on, and then click 'search' button, the relevant result will be shown in a Grid's page 1, but when user clicks page 2, the search keyword is missing, then the result is wrong which is not expected. So I extend GridPager to provide context to actionlink, but because it (as parent) implements a method beginRender() which is always invoked by Tapestry5 ahead of my GridPager's beginRender(), so now there would be two pager generated in list page. So is there a way to prevent the render method in parent from being invoked? And how? And what's the best practice here dealing with search funcion with Grid? Anyone please share your experience. Thanks in advance. DH
RE: T5: Forms - Best Practice
Jim, I have a T4 application that uses domain-object level security implemented using the Acegi framework. I have used custom authorization code more appropriate for my task, rather than the built-in Acegi method. It works beautifully, and I've certainly seen people attempting to access things they shouldn't. Jonathan -Original Message- From: Jim [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 22, 2008 10:08 PM To: Tapestry users Subject: Re: T5: Forms - Best Practice Hi Christoph, I know you're mostly asking about best-practice of process rather than security, but I think it's nonetheless important to bring up the issues that can arise when embedding primary keys of your entities client-side. I'm still a T4 user, but when you say a PageLink on a PersonSearch page, which has the Person's primary id as context, I assume that's analogous to the parameters attribute on a DirectLink in T4, in that the parameter is embedded in the page. Even if that's not the case, I'll continue anyway :P Building on your example, let's say that the logged-in user should only be able to search/edit people within his/her department. If we're only passing the PersonID to the PersonEdit page, and that ID is embedded in each rendered link on the PersonSearch page output, then the user could hack the form/link from the PersonSearch page to pass an arbitrary PersonID to PersonEdit, potentially giving the user the ability to perform unauthorized edits. I've started taking the approach of embedding not the ID, but a piece of information that's unique within the security-context (by security-context, in this case I mean department). In this case, assuming that a person's full name is unique within a department, we could embed the person's full name into the PageLink, and the PersonEdit page would search not on the primary key of the person, but instead on the combination of the DepartmentID (retrieved from the session if we're keeping a User object in the session) and the full name we passed in. Since we're using the DepartmentID from the session, then the user can hack the form/link all he/she wants, and the best they'll do is bring up the editing form for someone that wasn't in the search results but is still in their department, so it'd still be an authorized action. This sort of approach is annoying, because we'd love to be cleanly using solid efficient primary keys, but it probably pays to be paranoid. Anyone have a better approach on this issue? Particularly with regard to search pages? Jim Christoph Jäger wrote: Hi, Sorry for this long post. I spent quite some time now to try to figure out how to use forms to edit/update objects the right way (you know, simple, stable, elegant, easy to read, easy add things, ...). I use Tapestry 5.0.11. I am almost satisfied with what I came up with now, but some improvements need to be done. Maybe someone on this list can help with some ideas. As an example, lets have a PersonEdit page, with a PersonDao injected. You can create new Person entries or edit existing ones. To edit an existing person, there is a PageLink on a PersonSearch page, which has the Person's primary id as context. To create a new Person, a PageLink with 0 as context is used. To make this work, we have onActivate() and onPassivate() methods in PersonEdit: void onActivate(int id) { _id = id; if (id == 0) { _person = new Person(); } else { _person=personDao.get(id); } } int onPassivate() { return _id; } This way we can avoid using @Persist on the Person property (because, for instance, we want a user to be able to open two browser windows, viewing two different Person entries side by side and edit and save both of them. I think this would be problematic if we use @Persist, but please correct me if I am wrong). Now, editing an existing user works like this: - click the edit user XYZ PageLink on the PersonSearch page - in onActivate(), the personDao is used to query the Person from the database - an HTML form is rendered to let the user edit the values Up to here everything looks perfect. - the user edits the Person's data and hits the save button - onActivate() is called, a fresh Person is loaded from the database - for each field in the HTML form, validation is done (if defined), and a property in the fresh Person instance is set if the validation was successful - onValidateForm() is called if existing to allow for cross-field validation - if all validations were successful, onSuccess() is called. Here we call _person=personDao.save(_person). This save method returns a new Person instance, exactly as it was written to the database (primary id may be generated by the database, time stamps or version numbers updated, ...). We use this new Person's id : _id=_person.getId() to make sure we have the correct if
Problems with Javascript in Tapestry 4.1.5
Hi all, We moved from tapestry 4.0.2 to 4.1.5 we were using a script file and in had used the initialization/initialization tag to initialize the values used in script functions. The variables defined in this tag were working as global variable and we used to get the value of these variables in any script function. After shifting to 4.1.5 the initialization is treated as a different function and so the variables defined there are local to it, these variables loose there values as we try to access them in different script functions. the code is as follows initialization var thArray = new Array(); foreach key=th expression=ths thArray[t++] = new Th(${th.thId}, ${th.position}); /foreach swapThArray(); /initialization function swapThArray() { var tswap = thArray.length; for (var k = t; k t + (thArray.length - t - 1)/2; k++) { var tempth = thArray[--tswap]; thArray[tswap] = thArray[k]; thArray[k] = tempth; } } getting a javascript error in swapThArray that thArray has no properties thanks in advance, regards, -- Rohan Kalyan Indygo - www.indygo.in
Re: Problems with Javascript in Tapestry 4.1.5
You need to do something like: document.thArray = new Array(); On Wed, Apr 23, 2008 at 3:43 PM, Rohan Kalyan [EMAIL PROTECTED] wrote: Hi all, We moved from tapestry 4.0.2 to 4.1.5 we were using a script file and in had used the initialization/initialization tag to initialize the values used in script functions. The variables defined in this tag were working as global variable and we used to get the value of these variables in any script function. After shifting to 4.1.5 the initialization is treated as a different function and so the variables defined there are local to it, these variables loose there values as we try to access them in different script functions. the code is as follows initialization var thArray = new Array(); foreach key=th expression=ths thArray[t++] = new Th(${th.thId}, ${th.position}); /foreach swapThArray(); /initialization function swapThArray() { var tswap = thArray.length; for (var k = t; k t + (thArray.length - t - 1)/2; k++) { var tempth = thArray[--tswap]; thArray[tswap] = thArray[k]; thArray[k] = tempth; } } getting a javascript error in swapThArray that thArray has no properties thanks in advance, regards, -- Rohan Kalyan Indygo - www.indygo.in -- Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to update a list from a checkbox in a loop in t5
Hi All I this scenario: t:loop source=myDOA value=selectedDOA encoder=encoder t:checkbox t:id=archived / /t:loop How do I use the checkbox correctly when the user clicks it? 'I want to associate it with an object' via a primary key perhaps...but the checkbox only seems to have a value property of the type boolean: http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Checkbox.html Sorry if this question seems trivial, but I have been scratching my head for a while now. thanks, Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to update a list from a checkbox in a loop in t5
try adding an index to the loop, and then using this index to do the translation b/n the getters/setters. (but I don't know anything about encoders) --nK On Wed, Apr 23, 2008 at 3:24 PM, Peter Stavrinides [EMAIL PROTECTED] wrote: Hi All I this scenario: t:loop source=myDOA value=selectedDOA encoder=encoder t:checkbox t:id=archived / /t:loop How do I use the checkbox correctly when the user clicks it? 'I want to associate it with an object' via a primary key perhaps...but the checkbox only seems to have a value property of the type boolean: http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Checkbox.html Sorry if this question seems trivial, but I have been scratching my head for a while now. thanks, Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: Automatic class reloading on Tomcat 6 not working for me
Hi Josh, I am pleasantly surprised to hear it works in IntelliJ, has anyone got it working in eclipse? Josh Canfield wrote: Hmm... after reading the title again I guess the fact that it works in Tomcat 5.5 is irrelevant... sorry for the sidetrack. On Thu, Apr 17, 2008 at 10:01 AM, Josh Canfield [EMAIL PROTECTED] wrote: I use Tomcat 5.5 and IntelliJ, I haven't tried tomcat in eclipse. I've found that if I don't allow IntelliJ to replace the classes while debugging then the Tapestry reloading will work. Otherwise, it might work once then goes back to the old class. Josh On Thu, Apr 17, 2008 at 2:44 AM, Martin Kersten [EMAIL PROTECTED] wrote: Is it still true? I use hot replacement for components and somehow the class is reloaded. I thought this issue was solved. Do I miss something? (Using also T6) -Ursprüngliche Nachricht- Von: Peter Stavrinides [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. April 2008 11:05 An: Tapestry users Betreff: Re: AW: Automatic class reloading on Tomcat 6 not working for me You cannot use Tomcat for class reloading, this is not a bug, it's a feature which apparently is a result of the limitations Java has for package traversal and exploration, Jetty somehow gets around this partially but its also not perfect... http://tapestryjava.blogspot.com/2007/02/fighting-with-tomcat.html Filip S. Adamsen wrote: There's an equivalent antiResource(s)Locking attribute as well that I think you might need. I use Jetty for all my development, though, and only test in Tomcat before deploying my applications. -Filip On 2008-04-16 18:45, Javier Molina wrote: Do you work on Windows? I've changed my packaging to build a .jar with my classes and put it in WEB-INF/lib instead of having the exploded classes in WEB-INF/classes but once the webapp is started, I can't replace the .jar, the file is locked. I have tried to set antiJARLocking=true in the Context element but that doesn't help. Is anyone working with tapestry 5 and tomcat on windows with working auto-reload of classes? Filip S. Adamsen escribió: I believe the reloading is the only Tapestry-related thing affected by this. But I use Maven and archiveClasses in both development and production so I can't say for sure. -Filip On 2008-04-16 16:38, Stranzenbach, Ralf wrote: Hi. Does this tomcat bug affect only the class/page reloading process or is there any other significant problem that may arise during development / production. I've tried to create a sample application using Tomcat + Tapestry 5.0.10 and everything seems to work fine beside that reloading issues. - Ralf Von: Filip S. Adamsen [mailto:[EMAIL PROTECTED] Gesendet: Mi 16.04.2008 16:36 An: Tapestry users Betreff: Re: Automatic class reloading on Tomcat 6 not working for me Hi, Due to the way class loaders work in Tomcat you have to jar your classes etc. and put the jar into WEB-INF/lib. http://tapestry.apache.org/tapestry5/tomcat.html -Filip On 2008-04-16 13:42, Javier Molina wrote: I'm working with Tapestry 5.0.11 and Tomcat 6 (tested on 6.0.14 and 6.0.16). Automatic class reloading doesn't work for pages (there are no components yet in this test application, so I haven't checked that). Jetty 6 works fine and does autoreload pages. Is this a known issue? Do I have to configure anything in Tomcat to get class reloading to work? Thank you. --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** The information in this email is confidential and may be legally privileged. Access to this email by anyone other than the intended addressee is unauthorized. If you are not the intended recipient of this message, any review, disclosure, copying, distribution, retention, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. If you are not the intended recipient, please reply to or forward a copy of this message to the sender and delete the message, any attachments, and any copies thereof from your system. *** BearingPoint GmbH Geschäftsführer: Peter Mockler (Vorsitzender), Marcel Nickler (stellv. Vorsitzender), Wilfried Erber, Werner Kreutzmann, Hans-Werner Wurzel Aufsichtsratsvorsitzender: Roderick McGeary Sitz: Frankfurt am Main Registergericht: Amtsgericht Frankfurt am Main HRB 55490 --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For
RE: AW: Automatic class reloading on Tomcat 6 not working for me
Tomcat 5.5 live reloading works for me with Eclipse. I followed the setup process from the Tapestry 5 - Building Web Applications book and it works fine. I've not really got into figuring out how a real dev environment should be set up yet - I'm just evaluating/prototyping so far. I've not tried TC6. -Original Message- From: Peter Stavrinides [mailto:[EMAIL PROTECTED] Sent: 23 April 2008 15:44 To: Tapestry users Subject: Re: AW: Automatic class reloading on Tomcat 6 not working for me Hi Josh, I am pleasantly surprised to hear it works in IntelliJ, has anyone got it working in eclipse? Josh Canfield wrote: Hmm... after reading the title again I guess the fact that it works in Tomcat 5.5 is irrelevant... sorry for the sidetrack. On Thu, Apr 17, 2008 at 10:01 AM, Josh Canfield [EMAIL PROTECTED] wrote: I use Tomcat 5.5 and IntelliJ, I haven't tried tomcat in eclipse. I've found that if I don't allow IntelliJ to replace the classes while debugging then the Tapestry reloading will work. Otherwise, it might work once then goes back to the old class. Josh On Thu, Apr 17, 2008 at 2:44 AM, Martin Kersten [EMAIL PROTECTED] wrote: Is it still true? I use hot replacement for components and somehow the class is reloaded. I thought this issue was solved. Do I miss something? (Using also T6) -Ursprüngliche Nachricht- Von: Peter Stavrinides [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. April 2008 11:05 An: Tapestry users Betreff: Re: AW: Automatic class reloading on Tomcat 6 not working for me You cannot use Tomcat for class reloading, this is not a bug, it's a feature which apparently is a result of the limitations Java has for package traversal and exploration, Jetty somehow gets around this partially but its also not perfect... http://tapestryjava.blogspot.com/2007/02/fighting-with-tomcat.html Filip S. Adamsen wrote: There's an equivalent antiResource(s)Locking attribute as well that I think you might need. I use Jetty for all my development, though, and only test in Tomcat before deploying my applications. -Filip On 2008-04-16 18:45, Javier Molina wrote: Do you work on Windows? I've changed my packaging to build a .jar with my classes and put it in WEB-INF/lib instead of having the exploded classes in WEB-INF/classes but once the webapp is started, I can't replace the .jar, the file is locked. I have tried to set antiJARLocking=true in the Context element but that doesn't help. Is anyone working with tapestry 5 and tomcat on windows with working auto-reload of classes? Filip S. Adamsen escribió: I believe the reloading is the only Tapestry-related thing affected by this. But I use Maven and archiveClasses in both development and production so I can't say for sure. -Filip On 2008-04-16 16:38, Stranzenbach, Ralf wrote: Hi. Does this tomcat bug affect only the class/page reloading process or is there any other significant problem that may arise during development / production. I've tried to create a sample application using Tomcat + Tapestry 5.0.10 and everything seems to work fine beside that reloading issues. - Ralf Von: Filip S. Adamsen [mailto:[EMAIL PROTECTED] Gesendet: Mi 16.04.2008 16:36 An: Tapestry users Betreff: Re: Automatic class reloading on Tomcat 6 not working for me Hi, Due to the way class loaders work in Tomcat you have to jar your classes etc. and put the jar into WEB-INF/lib. http://tapestry.apache.org/tapestry5/tomcat.html -Filip On 2008-04-16 13:42, Javier Molina wrote: I'm working with Tapestry 5.0.11 and Tomcat 6 (tested on 6.0.14 and 6.0.16). Automatic class reloading doesn't work for pages (there are no components yet in this test application, so I haven't checked that). Jetty 6 works fine and does autoreload pages. Is this a known issue? Do I have to configure anything in Tomcat to get class reloading to work? Thank you. --- -- To unsubscribe, e-mail: users- [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** The information in this email is confidential and may be legally privileged. Access to this email by anyone other than the intended addressee is unauthorized. If you are not the intended recipient of this message, any review, disclosure, copying, distribution, retention, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. If you are not the intended recipient, please reply to or forward a copy of this message to the sender and delete the message, any attachments, and any copies thereof from your system.
My breadcrumb component from T4 to T5
Hi, Need some advice. In T4 I had a breadcrumb component that got its information from a breadcrumb model structure. Each page that needed to go onto the crumb path would implement some base page class. This page class implemented PageRenderListener and IExternalPage. The former to add info to the model and the latter to remove info from the model (btw the breadcrumb model was an ASO). Basically the model consisted of some key, name/title and (constructed) link tuple. The link basically pointed to an IExternalPage implemented page class - so to be precise the whole breadcrumb path consisted of bookmarkable pages. I'm trying to mimic this behavior with T5, using the BeginRender annotation on a basepage class method called initPage() and also on the basepage class a onActivate() method. I have some questions about it. Below the specific base page code: protected String getBreadCrumbTitle() { return resources.getMessages().get(title- + resources.getPageName().toLowerCase()); } protected Object[] getLinkParameters() { return null; } @BeginRender public void initPage() { String pageName = resources.getPageName(); Link link = resources.createPageLink(resources.getPageName(), true, getLinkParameters()); breadCrumbHolder.checkBreadCrumbForAdd(pageName, getBreadCrumbTitle(), link.toRedirectURI()); } public void onActivate() { String pageName = resources.getPageName(); breadCrumbHolder.checkBreadCrumbForRemove(pageName); } Q1: the initPage() method is there to create a 'bookmarkable' link - amongst others - and store that information in the breadcrumb model. The getLinkParameters() is there for a subclass to provide its specific activation parameters to be used. Should I use another way to create bookmarable links? Q2: the onActivate() method is there to remove one (or more) crumbs from the crumbpath. Since other pages will also need activation - potentially with additional arguments - is this onActivate() the best way/place to manipulate the model? I'm getting the idea that onActivate() is not the designated alternative for T4's activateExternalPage(Object[] parameters, IRequestCycle cycle) in IExternalPage interface. Currently all of this works - although haven't tested activation with activation context parameters yet. Thx. -J. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic list of strings in a form
Thank you very much, that was exactly what I was looking for. I am new to tapestry and it was not clear for me how loops are working, but now I understand it. :-) Also many thanks to the other guys that replied. @Marcus: Grid didn’t work for me, because I didn't have any Bean that I could pass. @Francois: Looks like a nice component and a generic solution for that kind of problem. But I think it was bit overkill for me. @Igor: FormInjector may work, if I always start with one input field. But I also have to provide an edit form where already can be a set of values. I am not sure how I could implement this using the FormInjector. Regards, Michael Josh Canfield schrieb: Hey Michael, I know a couple of guys have replied, but I think there is a much simpler answer to your problem. drop the item property from your page and add getter/setters that update the your items list based on the index in the loop: @Property private int _index; public String getItem() { if ( items.size() = _index ) { // what to do when the index is out of bounds? } return items.get(_index); } public void setItem(String s) { if ( items.size() = _index ) { // what to do when the index is out of bounds? } items.set(_index, s); } and update the loop div in your template to bind the index property: div t:type=loop t:source=items t:value=item t:index=index The way your page was written you were telling tapestry to update the item property for each value in the list, which it dutifully did. But, what you really wanted was it to put the items into your list. Hope that helps, Josh On Tue, Apr 15, 2008 at 6:51 AM, Michael Dukaczewski [EMAIL PROTECTED] wrote: I am using Tapestry 5.0.11 and have a problem with a dynamic list of strings in a form. What I am trying, is the following: In the Page.java: @Persist private ListString items; @Property private String item; public ListString getItems() { if (items == null) { items = new LinkedListString(); } return items; } public void onSelectedFromAdd() { getItems().add(); } And in the Page.tml: t:form div t:type=loop t:source=items t:value=item t:textfield value=item / /div divt:submit t:id=add value=more//div divt:submit t:id=save value=save//div /t:form I have a list of values, the user has to enter. The number of values, that have to be typed in, is dynamic, so the user has to extend the form. The add button works, but the values are not saved. Can someone tell me, that I am doing wrong? - 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]
Re: Form with a Zone - ComponentEventException
Maybe because IE you need edit tapestry.js about linkZone:function... element.onsubmit = handler; replace to: Event.observe(element, 'submit', handler); and element.onclick = handler; replace to:Event.observe(element, 'click', handler); and need add line :Event.stop(event); after new Ajax.Request(element.href, { onSuccess : successHandler }); @see http://www.prototypejs.org/2007/10/16/prototype-1-6-0-rc1-changes-to-the-class-and-event-apis-hash-rewrite-and-bug-fixes #Changes to the Event API Petros Petrou wrote: When the userSearchForm of the code below is submitted I am getting the following exception A component event handler method returned the value [EMAIL PROTECTED] Return type org.apache.internal.structure.BlockImpl can not be handled. Configured return types are java.lang.Class, java.lang.String, java.net.URL, org.apache.tapestry.Link, org.apache.tapestry.StreamResponse, org.apache.tapestry.runtime.Component. I am trying to update the search results table when the form is submited as an Ajax call. Any ideas ? UserPicker.java @Inject private Block searchResultsBlock; Object onSuccessFromUserSearchForm() { foundUsers = userManager.findUsers(...); return searchResultsBlock; } UserPicker.tml ... html body form t:id=userSearchForm zone=searchResultsZone ... input t:type=Submit value=Find Users/ /form div t:type=Zone t:id=searchResultZone/ div t:type=Block t:id=searchResultsBlock table t:type=Grid source=foundUsers/ /div /body html -- View this message in context: http://www.nabble.com/Form-with-a-Zone--%3E-ComponentEventException-tp16346150p16834687.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 contributeMasterDispatcher - how to have default rootContext access be part of it
Sorry to jump in here Chris... Jan not exactly sure what you are doing since you haven't shown your code, but the exception is telling you the response has been committed , which means you are trying to modify a Response that is being processed, i.e.: it is read only. If you interrupt the response, for example with a redirect, then try returning true. if(interruptHere)){ response.sendRedirect(/login); return true; } return false; Peter Jan Vissers wrote: Hi Chris, Thank you. As a matter of fact I used your wiki entries as my main inspiration. So what I do now is: use: before:RootPath for the contributation and return 'false' on the dispath for '/login and '/assets/' This works but in the background the following stuff is logged (To be more precise I'm using an ASO in my dispatcher) Question is: should this worry me? [DEBUG] SecurityController In dispatch for / [INFO] TimingFilter Request time: 1 ms [ERROR] RequestExceptionHandler Processing of request failed with uncaught exception: Cannot create a session after the response has been committed org.apache.tapestry.runtime.ComponentEventException: Cannot create a session after the response has been committed at org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1021) at org.apache.tapestry.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:52) at org.apache.tapestry.services.TapestryModule $29.handle(TapestryModule.java:1607) at $PageRenderRequestHandler_1197add4787.handle($PageRenderRequestHandler_1197add4787.java) at $PageRenderRequestHandler_1197add4779.handle($PageRenderRequestHandler_1197add4779.java) at org.apache.tapestry.internal.services.RootPathDispatcher.dispatch(RootPathDispatcher.java:61) at $Dispatcher_1197add4781.dispatch($Dispatcher_1197add4781.java) at $Dispatcher_1197add4772.dispatch($Dispatcher_1197add4772.java) at org.apache.tapestry.services.TapestryModule $13.service(TapestryModule.java:944) at com.*.lighting.guidecontrol.view.services.AppModule $1.service(AppModule.java:83) at $RequestFilter_1197add4771.service($RequestFilter_1197add4771.java) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:42) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.services.TapestryModule $3.service(TapestryModule.java:553) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.services.TapestryModule $2.service(TapestryModule.java:520) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:93) at org.apache.tapestry.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:84) at org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77) at org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at $RequestHandler_1197add476a.service($RequestHandler_1197add476a.java) at org.apache.tapestry.services.TapestryModule $12.service(TapestryModule.java:924) at org.apache.tapestry.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $HttpServletRequestFilter_1197add4769.service($HttpServletRequestFilter_1197add4769.java) at $HttpServletRequestHandler_1197add476b.service($HttpServletRequestHandler_1197add476b.java) at $HttpServletRequestHandler_1197add4768.service($HttpServletRequestHandler_1197add4768.java) at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:168) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at
Re: My breadcrumb component from T4 to T5
I used T4 for a short period a long time ago, so I'm not understanding the parallels that you are making. Can you describe the workflow that you are shooting for? I'm not clear why you'd remove the breadcrumb in the activate event and the add it again the beginrender event. Josh On Wed, Apr 23, 2008 at 8:19 AM, Jan Vissers [EMAIL PROTECTED] wrote: Hi, Need some advice. In T4 I had a breadcrumb component that got its information from a breadcrumb model structure. Each page that needed to go onto the crumb path would implement some base page class. This page class implemented PageRenderListener and IExternalPage. The former to add info to the model and the latter to remove info from the model (btw the breadcrumb model was an ASO). Basically the model consisted of some key, name/title and (constructed) link tuple. The link basically pointed to an IExternalPage implemented page class - so to be precise the whole breadcrumb path consisted of bookmarkable pages. I'm trying to mimic this behavior with T5, using the BeginRender annotation on a basepage class method called initPage() and also on the basepage class a onActivate() method. I have some questions about it. Below the specific base page code: protected String getBreadCrumbTitle() { return resources.getMessages().get(title- + resources.getPageName().toLowerCase()); } protected Object[] getLinkParameters() { return null; } @BeginRender public void initPage() { String pageName = resources.getPageName(); Link link = resources.createPageLink(resources.getPageName(), true, getLinkParameters()); breadCrumbHolder.checkBreadCrumbForAdd(pageName, getBreadCrumbTitle(), link.toRedirectURI()); } public void onActivate() { String pageName = resources.getPageName(); breadCrumbHolder.checkBreadCrumbForRemove(pageName); } Q1: the initPage() method is there to create a 'bookmarkable' link - amongst others - and store that information in the breadcrumb model. The getLinkParameters() is there for a subclass to provide its specific activation parameters to be used. Should I use another way to create bookmarable links? Q2: the onActivate() method is there to remove one (or more) crumbs from the crumbpath. Since other pages will also need activation - potentially with additional arguments - is this onActivate() the best way/place to manipulate the model? I'm getting the idea that onActivate() is not the designated alternative for T4's activateExternalPage(Object[] parameters, IRequestCycle cycle) in IExternalPage interface. Currently all of this works - although haven't tested activation with activation context parameters yet. Thx. -J. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: My breadcrumb component from T4 to T5
I used T4 for a short period a long time ago, so I'm not understanding the parallels that you are making. Can you describe the workflow that you are shooting for? I'm not clear why you'd remove the breadcrumb in the activate event and the add it again the beginrender event. beginRender will : create a bookmarkable link : store (if necessary) in the model of breadcrumbs. onActivate gets called whenever a breadcrumb - rendered as link is clicked and will : remove a crumbs that are listed after the clicked link, cleaning up the trail I think the workflow is okay - as it is proven in T4. I'm just looking for the correct points to hook it into T5. Thx, -J. Josh On Wed, Apr 23, 2008 at 8:19 AM, Jan Vissers [EMAIL PROTECTED] wrote: Hi, Need some advice. In T4 I had a breadcrumb component that got its information from a breadcrumb model structure. Each page that needed to go onto the crumb path would implement some base page class. This page class implemented PageRenderListener and IExternalPage. The former to add info to the model and the latter to remove info from the model (btw the breadcrumb model was an ASO). Basically the model consisted of some key, name/title and (constructed) link tuple. The link basically pointed to an IExternalPage implemented page class - so to be precise the whole breadcrumb path consisted of bookmarkable pages. I'm trying to mimic this behavior with T5, using the BeginRender annotation on a basepage class method called initPage() and also on the basepage class a onActivate() method. I have some questions about it. Below the specific base page code: protected String getBreadCrumbTitle() { return resources.getMessages().get(title- + resources.getPageName().toLowerCase()); } protected Object[] getLinkParameters() { return null; } @BeginRender public void initPage() { String pageName = resources.getPageName(); Link link = resources.createPageLink(resources.getPageName(), true, getLinkParameters()); breadCrumbHolder.checkBreadCrumbForAdd(pageName, getBreadCrumbTitle(), link.toRedirectURI()); } public void onActivate() { String pageName = resources.getPageName(); breadCrumbHolder.checkBreadCrumbForRemove(pageName); } Q1: the initPage() method is there to create a 'bookmarkable' link - amongst others - and store that information in the breadcrumb model. The getLinkParameters() is there for a subclass to provide its specific activation parameters to be used. Should I use another way to create bookmarable links? Q2: the onActivate() method is there to remove one (or more) crumbs from the crumbpath. Since other pages will also need activation - potentially with additional arguments - is this onActivate() the best way/place to manipulate the model? I'm getting the idea that onActivate() is not the designated alternative for T4's activateExternalPage(Object[] parameters, IRequestCycle cycle) in IExternalPage interface. Currently all of this works - although haven't tested activation with activation context parameters yet. Thx. -J. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - 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]
Re: T5 contributeMasterDispatcher - how to have default rootContext access be part of it
Great Peter, This was indeed the problem. As I pointed out earlier - I use(d) Chris great writeup on dispatchers on the wiki and also another follow up article by Stephane Decleire - http://wiki.apache.org/tapestry/Tapestry5HowToControlAccess Which contains the same anomaly. Thx again, -J. Sorry to jump in here Chris... Jan not exactly sure what you are doing since you haven't shown your code, but the exception is telling you the response has been committed , which means you are trying to modify a Response that is being processed, i.e.: it is read only. If you interrupt the response, for example with a redirect, then try returning true. if(interruptHere)){ response.sendRedirect(/login); return true; } return false; Peter Jan Vissers wrote: Hi Chris, Thank you. As a matter of fact I used your wiki entries as my main inspiration. So what I do now is: use: before:RootPath for the contributation and return 'false' on the dispath for '/login and '/assets/' This works but in the background the following stuff is logged (To be more precise I'm using an ASO in my dispatcher) Question is: should this worry me? [DEBUG] SecurityController In dispatch for / [INFO] TimingFilter Request time: 1 ms [ERROR] RequestExceptionHandler Processing of request failed with uncaught exception: Cannot create a session after the response has been committed org.apache.tapestry.runtime.ComponentEventException: Cannot create a session after the response has been committed at org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1021) at org.apache.tapestry.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:52) at org.apache.tapestry.services.TapestryModule $29.handle(TapestryModule.java:1607) at $PageRenderRequestHandler_1197add4787.handle($PageRenderRequestHandler_1197add4787.java) at $PageRenderRequestHandler_1197add4779.handle($PageRenderRequestHandler_1197add4779.java) at org.apache.tapestry.internal.services.RootPathDispatcher.dispatch(RootPathDispatcher.java:61) at $Dispatcher_1197add4781.dispatch($Dispatcher_1197add4781.java) at $Dispatcher_1197add4772.dispatch($Dispatcher_1197add4772.java) at org.apache.tapestry.services.TapestryModule $13.service(TapestryModule.java:944) at com.*.lighting.guidecontrol.view.services.AppModule $1.service(AppModule.java:83) at $RequestFilter_1197add4771.service($RequestFilter_1197add4771.java) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:42) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.services.TapestryModule $3.service(TapestryModule.java:553) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.services.TapestryModule $2.service(TapestryModule.java:520) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:93) at org.apache.tapestry.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:84) at org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77) at org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at $RequestHandler_1197add476a.service($RequestHandler_1197add476a.java) at org.apache.tapestry.services.TapestryModule $12.service(TapestryModule.java:924) at org.apache.tapestry.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $HttpServletRequestFilter_1197add4769.service($HttpServletRequestFilter_1197add4769.java) at $HttpServletRequestHandler_1197add476b.service($HttpServletRequestHandler_1197add476b.java) at $HttpServletRequestHandler_1197add4768.service($HttpServletRequestHandler_1197add4768.java) at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:168) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at
Re: My breadcrumb component from T4 to T5
Ah, by workflow I meant to ask when you expected the events to get fired, which you answered for the onactivate handler. So, why not do this all in one event handler, perhaps setupRender? On Wed, Apr 23, 2008 at 11:44 AM, Jan Vissers [EMAIL PROTECTED] wrote: I used T4 for a short period a long time ago, so I'm not understanding the parallels that you are making. Can you describe the workflow that you are shooting for? I'm not clear why you'd remove the breadcrumb in the activate event and the add it again the beginrender event. beginRender will : create a bookmarkable link : store (if necessary) in the model of breadcrumbs. onActivate gets called whenever a breadcrumb - rendered as link is clicked and will : remove a crumbs that are listed after the clicked link, cleaning up the trail I think the workflow is okay - as it is proven in T4. I'm just looking for the correct points to hook it into T5. Thx, -J. Josh On Wed, Apr 23, 2008 at 8:19 AM, Jan Vissers [EMAIL PROTECTED] wrote: Hi, Need some advice. In T4 I had a breadcrumb component that got its information from a breadcrumb model structure. Each page that needed to go onto the crumb path would implement some base page class. This page class implemented PageRenderListener and IExternalPage. The former to add info to the model and the latter to remove info from the model (btw the breadcrumb model was an ASO). Basically the model consisted of some key, name/title and (constructed) link tuple. The link basically pointed to an IExternalPage implemented page class - so to be precise the whole breadcrumb path consisted of bookmarkable pages. I'm trying to mimic this behavior with T5, using the BeginRender annotation on a basepage class method called initPage() and also on the basepage class a onActivate() method. I have some questions about it. Below the specific base page code: protected String getBreadCrumbTitle() { return resources.getMessages().get(title- + resources.getPageName().toLowerCase()); } protected Object[] getLinkParameters() { return null; } @BeginRender public void initPage() { String pageName = resources.getPageName(); Link link = resources.createPageLink(resources.getPageName(), true, getLinkParameters()); breadCrumbHolder.checkBreadCrumbForAdd(pageName, getBreadCrumbTitle(), link.toRedirectURI()); } public void onActivate() { String pageName = resources.getPageName(); breadCrumbHolder.checkBreadCrumbForRemove(pageName); } Q1: the initPage() method is there to create a 'bookmarkable' link - amongst others - and store that information in the breadcrumb model. The getLinkParameters() is there for a subclass to provide its specific activation parameters to be used. Should I use another way to create bookmarable links? Q2: the onActivate() method is there to remove one (or more) crumbs from the crumbpath. Since other pages will also need activation - potentially with additional arguments - is this onActivate() the best way/place to manipulate the model? I'm getting the idea that onActivate() is not the designated alternative for T4's activateExternalPage(Object[] parameters, IRequestCycle cycle) in IExternalPage interface. Currently all of this works - although haven't tested activation with activation context parameters yet. Thx. -J. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - 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] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 contributeMasterDispatcher - how to have default rootContext access be part of it
Peter, Thanks fo jumping in :-) - I was away and I wouldn't have readily known the answer anyway, so I along with Jan appreciate your sharing. Jan, So is there something incorrect in the wiki, or perhaps something that would be worth adding as a warning? chris Jan Vissers wrote: Great Peter, This was indeed the problem. As I pointed out earlier - I use(d) Chris great writeup on dispatchers on the wiki and also another follow up article by Stephane Decleire - http://wiki.apache.org/tapestry/Tapestry5HowToControlAccess Which contains the same anomaly. Thx again, -J. Sorry to jump in here Chris... Jan not exactly sure what you are doing since you haven't shown your code, but the exception is telling you the response has been committed , which means you are trying to modify a Response that is being processed, i.e.: it is read only. If you interrupt the response, for example with a redirect, then try returning true. if(interruptHere)){ response.sendRedirect(/login); return true; } return false; Peter Jan Vissers wrote: Hi Chris, Thank you. As a matter of fact I used your wiki entries as my main inspiration. So what I do now is: use: before:RootPath for the contributation and return 'false' on the dispath for '/login and '/assets/' This works but in the background the following stuff is logged (To be more precise I'm using an ASO in my dispatcher) Question is: should this worry me? [DEBUG] SecurityController In dispatch for / [INFO] TimingFilter Request time: 1 ms [ERROR] RequestExceptionHandler Processing of request failed with uncaught exception: Cannot create a session after the response has been committed org.apache.tapestry.runtime.ComponentEventException: Cannot create a session after the response has been committed at org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1021) at org.apache.tapestry.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:52) at org.apache.tapestry.services.TapestryModule $29.handle(TapestryModule.java:1607) at $PageRenderRequestHandler_1197add4787.handle($PageRenderRequestHandler_1197add4787.java) at $PageRenderRequestHandler_1197add4779.handle($PageRenderRequestHandler_1197add4779.java) at org.apache.tapestry.internal.services.RootPathDispatcher.dispatch(RootPathDispatcher.java:61) at $Dispatcher_1197add4781.dispatch($Dispatcher_1197add4781.java) at $Dispatcher_1197add4772.dispatch($Dispatcher_1197add4772.java) at org.apache.tapestry.services.TapestryModule $13.service(TapestryModule.java:944) at com.*.lighting.guidecontrol.view.services.AppModule $1.service(AppModule.java:83) at $RequestFilter_1197add4771.service($RequestFilter_1197add4771.java) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:42) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.services.TapestryModule $3.service(TapestryModule.java:553) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.services.TapestryModule $2.service(TapestryModule.java:520) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:93) at org.apache.tapestry.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:84) at org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77) at org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at $RequestHandler_1197add476a.service($RequestHandler_1197add476a.java) at org.apache.tapestry.services.TapestryModule $12.service(TapestryModule.java:924) at org.apache.tapestry.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $HttpServletRequestFilter_1197add4769.service($HttpServletRequestFilter_1197add4769.java) at $HttpServletRequestHandler_1197add476b.service($HttpServletRequestHandler_1197add476b.java) at $HttpServletRequestHandler_1197add4768.service($HttpServletRequestHandler_1197add4768.java) at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:168) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at
tooltips (hints) for form components
Hello, is it way to extend all form input components with function witch onFocus shows hint (tooltip) onBlur hides? Any suggestions? -- View this message in context: http://www.nabble.com/tooltips-%28hints%29-for-form-components-tp16834806p16834806.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Forms - Best Practice
Hi Jim, I like to use the primary key, because it is short and by definition unique, and usually the quickest way to retrieve an object from the database. For the problem you describe, users are only allowed to view people in their own department, three different solutions come to my mind: 1. in onActivate(), where the personDao is queried for the Person with the given id, check if the logged in user may view the requested Person information 2. in the PersonDao itself check for permissions 3. as Jonathan Barker wrote in an email in this thread, use domain- object level security 1 is the quick and dirty way, easy to leave some holes open, but it should work in any environment. 2 only works if personDao (wherever it is executed, might be a remote call on some different server than your web-app) knows about the logged in user, and for 3 you probably have to use some framework like Acegi or some container managed authentication and authorization. But there is a different scenario, where we have to find a different solution: imagine some web-frontend to a database of companies. Everyone can search for companies, but you want to limit the search to show only the top 10 results, so no one can harvest your whole database. Using the primary key here proves to be easily exploitable, just try the result page with ids from 1 to 1 (it is quite easy to use wget and some lines of perl code to extract the whole database this way). You can try to limit the rate of requests from a single IP address and stuff like this, but this only slows down things. And you can not use security settings here, because everyone is meant to be able to view each entry (only not all of them). I did not yet have to solve a problem like this (only discussed it). You could probably use some alternate keys, created as hash values from your primary key and some secret string, or use UUIDs like Cesar Lesc mentioned in his post on this thread. Best Regards, Christoph On Apr 23, 2008, at 04:08 , Jim wrote: Hi Christoph, I know you're mostly asking about best-practice of process rather than security, but I think it's nonetheless important to bring up the issues that can arise when embedding primary keys of your entities client-side. I'm still a T4 user, but when you say a PageLink on a PersonSearch page, which has the Person's primary id as context, I assume that's analogous to the parameters attribute on a DirectLink in T4, in that the parameter is embedded in the page. Even if that's not the case, I'll continue anyway :P Building on your example, let's say that the logged-in user should only be able to search/edit people within his/her department. If we're only passing the PersonID to the PersonEdit page, and that ID is embedded in each rendered link on the PersonSearch page output, then the user could hack the form/link from the PersonSearch page to pass an arbitrary PersonID to PersonEdit, potentially giving the user the ability to perform unauthorized edits. I've started taking the approach of embedding not the ID, but a piece of information that's unique within the security-context (by security-context, in this case I mean department). In this case, assuming that a person's full name is unique within a department, we could embed the person's full name into the PageLink, and the PersonEdit page would search not on the primary key of the person, but instead on the combination of the DepartmentID (retrieved from the session if we're keeping a User object in the session) and the full name we passed in. Since we're using the DepartmentID from the session, then the user can hack the form/link all he/she wants, and the best they'll do is bring up the editing form for someone that wasn't in the search results but is still in their department, so it'd still be an authorized action. This sort of approach is annoying, because we'd love to be cleanly using solid efficient primary keys, but it probably pays to be paranoid. Anyone have a better approach on this issue? Particularly with regard to search pages? Jim Christoph Jäger wrote: Hi, Sorry for this long post. I spent quite some time now to try to figure out how to use forms to edit/update objects the right way (you know, simple, stable, elegant, easy to read, easy add things, ...). I use Tapestry 5.0.11. I am almost satisfied with what I came up with now, but some improvements need to be done. Maybe someone on this list can help with some ideas. As an example, lets have a PersonEdit page, with a PersonDao injected. You can create new Person entries or edit existing ones. To edit an existing person, there is a PageLink on a PersonSearch page, which has the Person's primary id as context. To create a new Person, a PageLink with 0 as context is used. To make this work, we have onActivate() and onPassivate() methods in PersonEdit: void
Re: tooltips (hints) for form components
Hello, The Tooltip component of tapestry5-components (http://code.google.com/p/tapestry5-components/) may help you: http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/components/Tooltip.html ice96 wrote: Hello, is it way to extend all form input components with function witch onFocus shows hint (tooltip) onBlur hides? Any suggestions? -- http://thegodcode.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T4]hivemind variables in components
too much work. the alternative is just read env var On 4/23/08, Igor Drobiazko [EMAIL PROTECTED] wrote: What about a new binding? You could inject a service into the binding which is responsible for resolving HiveMind symbols. On Wed, Apr 23, 2008 at 1:12 AM, Patrick Moore [EMAIL PROTECTED] wrote: Hi there -- O.k. I feel silly -- but how do I use hivemind variables directly in a component. I know how to pass hivemind variables to services. But how to use those values in the components? For example, I would like to use the hivemind variable 'amplafi.production' as the condition in a @If for example,: span jwcid=@If condition=amplafi.production hey there amplafi.production is true! /span -Pat -- Best regards, Igor Drobiazko -- Patrick Moore Amplafi 650-207-9792 ... because someone else wants to share your content. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Forms - Best Practice
Hi Geoff, it seems your JIRA describes just what I would like to have. I especially like the idea with the conversation id, because my next thought would have been: what happens if the user edits two different persons in two different windows of his web browser at the same time (over a slow network, it might actually be not too difficult to have the two requests for each page interleaved). Unfortunately, there does not seem to be a lot of interest in your issue, no fix version, no assignee :(. I just voted for it, maybe this helps (I know, the best thing would be to fix it myself, but this seems to be a bit big for a first contribution). The conversation id would be a nice tool anyhow, this way you could persist things in the session without having to worry about different requests to the same page mix things up. Is there something like a conversation id in Tapestry right now? Best Regards, Christoph On Apr 23, 2008, at 00:45 , Geoff Callender wrote: Totally agree! See https://issues.apache.org/jira/browse/ TAPESTRY-2138 Workaround is @Persist combined with nullifying the persisted object in cleanupRender(). Geoff http://files.doublenegative.com.au/jumpstart/ On 23/04/2008, at 6:54 AM, Christoph Jäger wrote: Hi, Sorry for this long post. I spent quite some time now to try to figure out how to use forms to edit/update objects the right way (you know, simple, stable, elegant, easy to read, easy add things, ...). I use Tapestry 5.0.11. I am almost satisfied with what I came up with now, but some improvements need to be done. Maybe someone on this list can help with some ideas. As an example, lets have a PersonEdit page, with a PersonDao injected. You can create new Person entries or edit existing ones. To edit an existing person, there is a PageLink on a PersonSearch page, which has the Person's primary id as context. To create a new Person, a PageLink with 0 as context is used. To make this work, we have onActivate() and onPassivate() methods in PersonEdit: void onActivate(int id) { _id = id; if (id == 0) { _person = new Person(); } else { _person=personDao.get(id); } } int onPassivate() { return _id; } This way we can avoid using @Persist on the Person property (because, for instance, we want a user to be able to open two browser windows, viewing two different Person entries side by side and edit and save both of them. I think this would be problematic if we use @Persist, but please correct me if I am wrong). Now, editing an existing user works like this: - click the edit user XYZ PageLink on the PersonSearch page - in onActivate(), the personDao is used to query the Person from the database - an HTML form is rendered to let the user edit the values Up to here everything looks perfect. - the user edits the Person's data and hits the save button - onActivate() is called, a fresh Person is loaded from the database - for each field in the HTML form, validation is done (if defined), and a property in the fresh Person instance is set if the validation was successful - onValidateForm() is called if existing to allow for cross-field validation - if all validations were successful, onSuccess() is called. Here we call _person=personDao.save(_person). This save method returns a new Person instance, exactly as it was written to the database (primary id may be generated by the database, time stamps or version numbers updated, ...). We use this new Person's id : _id=_person.getId() to make sure we have the correct if for the next onPassivate() - onPassivate() is called - result sent to browser, redirect - onActivate() loads Person again - new form is rendered This is good, but I think it could be improved. 1. The Person is loaded from the database twice (using personDao.get()), and saved once. The save() method of personDao already gives us a new, fresh instance of Person, it seems like a waste to load it again after the redirect. 2. During validation, we check if there is already a Person with the same userid (in onValidateForm(), or in onValidateFromUserId()) and warn the user if this is the case. But what happens if a new Person with this userId is added just after onValidateForm() is called, but before onSuccess() is called, where we want to save? To make our program solid, we have to take this into account. In case save() does not work, we do not want to see some exception page, but the form, as it was filled, with a hint what might have gone wrong, so the user can try again. To make this possible, we have to move the save() to onValidateForm(), because there we can still record form errors (I think there is a JIRA for an improvement to this situation). 3. We want to give the user feedback of what happened. After clicking the save button, we want to show a message like Successfully saved new person information above the form (at the same place you would see error
Re: T5 contributeMasterDispatcher - how to have default rootContext access be part of it
I've already sent a direct e-mail out to Stephane Decleire with the info of this small error. I'll keep an eye out for the change on the wiki and if it doesn't get thru, do the extra effort of signing-up and trying to make the change myself ;-) Anyways - another great example of the building T5 community. Keep it up guys, -J. Peter, Thanks fo jumping in :-) - I was away and I wouldn't have readily known the answer anyway, so I along with Jan appreciate your sharing. Jan, So is there something incorrect in the wiki, or perhaps something that would be worth adding as a warning? chris Jan Vissers wrote: Great Peter, This was indeed the problem. As I pointed out earlier - I use(d) Chris great writeup on dispatchers on the wiki and also another follow up article by Stephane Decleire - http://wiki.apache.org/tapestry/Tapestry5HowToControlAccess Which contains the same anomaly. Thx again, -J. Sorry to jump in here Chris... Jan not exactly sure what you are doing since you haven't shown your code, but the exception is telling you the response has been committed , which means you are trying to modify a Response that is being processed, i.e.: it is read only. If you interrupt the response, for example with a redirect, then try returning true. if(interruptHere)){ response.sendRedirect(/login); return true; } return false; Peter Jan Vissers wrote: Hi Chris, Thank you. As a matter of fact I used your wiki entries as my main inspiration. So what I do now is: use: before:RootPath for the contributation and return 'false' on the dispath for '/login and '/assets/' This works but in the background the following stuff is logged (To be more precise I'm using an ASO in my dispatcher) Question is: should this worry me? [DEBUG] SecurityController In dispatch for / [INFO] TimingFilter Request time: 1 ms [ERROR] RequestExceptionHandler Processing of request failed with uncaught exception: Cannot create a session after the response has been committed org.apache.tapestry.runtime.ComponentEventException: Cannot create a session after the response has been committed at org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1021) at org.apache.tapestry.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:52) at org.apache.tapestry.services.TapestryModule $29.handle(TapestryModule.java:1607) at $PageRenderRequestHandler_1197add4787.handle($PageRenderRequestHandler_1197add4787.java) at $PageRenderRequestHandler_1197add4779.handle($PageRenderRequestHandler_1197add4779.java) at org.apache.tapestry.internal.services.RootPathDispatcher.dispatch(RootPathDispatcher.java:61) at $Dispatcher_1197add4781.dispatch($Dispatcher_1197add4781.java) at $Dispatcher_1197add4772.dispatch($Dispatcher_1197add4772.java) at org.apache.tapestry.services.TapestryModule $13.service(TapestryModule.java:944) at com.*.lighting.guidecontrol.view.services.AppModule $1.service(AppModule.java:83) at $RequestFilter_1197add4771.service($RequestFilter_1197add4771.java) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:42) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.services.TapestryModule $3.service(TapestryModule.java:553) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.services.TapestryModule $2.service(TapestryModule.java:520) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at org.apache.tapestry.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:93) at org.apache.tapestry.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:84) at org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77) at org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106) at $RequestHandler_1197add4773.service($RequestHandler_1197add4773.java) at $RequestHandler_1197add476a.service($RequestHandler_1197add476a.java) at org.apache.tapestry.services.TapestryModule $12.service(TapestryModule.java:924) at org.apache.tapestry.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $HttpServletRequestFilter_1197add4769.service($HttpServletRequestFilter_1197add4769.java) at $HttpServletRequestHandler_1197add476b.service($HttpServletRequestHandler_1197add476b.java) at
Re: My breadcrumb component from T4 to T5
Hi, I'm not sure if I understand... Do you mean to say that manipulating the breadcrumb path (adding or removing crumbs) should/could all go into one event handler? -J. Ah, by workflow I meant to ask when you expected the events to get fired, which you answered for the onactivate handler. So, why not do this all in one event handler, perhaps setupRender? On Wed, Apr 23, 2008 at 11:44 AM, Jan Vissers [EMAIL PROTECTED] wrote: I used T4 for a short period a long time ago, so I'm not understanding the parallels that you are making. Can you describe the workflow that you are shooting for? I'm not clear why you'd remove the breadcrumb in the activate event and the add it again the beginrender event. beginRender will : create a bookmarkable link : store (if necessary) in the model of breadcrumbs. onActivate gets called whenever a breadcrumb - rendered as link is clicked and will : remove a crumbs that are listed after the clicked link, cleaning up the trail I think the workflow is okay - as it is proven in T4. I'm just looking for the correct points to hook it into T5. Thx, -J. Josh On Wed, Apr 23, 2008 at 8:19 AM, Jan Vissers [EMAIL PROTECTED] wrote: Hi, Need some advice. In T4 I had a breadcrumb component that got its information from a breadcrumb model structure. Each page that needed to go onto the crumb path would implement some base page class. This page class implemented PageRenderListener and IExternalPage. The former to add info to the model and the latter to remove info from the model (btw the breadcrumb model was an ASO). Basically the model consisted of some key, name/title and (constructed) link tuple. The link basically pointed to an IExternalPage implemented page class - so to be precise the whole breadcrumb path consisted of bookmarkable pages. I'm trying to mimic this behavior with T5, using the BeginRender annotation on a basepage class method called initPage() and also on the basepage class a onActivate() method. I have some questions about it. Below the specific base page code: protected String getBreadCrumbTitle() { return resources.getMessages().get(title- + resources.getPageName().toLowerCase()); } protected Object[] getLinkParameters() { return null; } @BeginRender public void initPage() { String pageName = resources.getPageName(); Link link = resources.createPageLink(resources.getPageName(), true, getLinkParameters()); breadCrumbHolder.checkBreadCrumbForAdd(pageName, getBreadCrumbTitle(), link.toRedirectURI()); } public void onActivate() { String pageName = resources.getPageName(); breadCrumbHolder.checkBreadCrumbForRemove(pageName); } Q1: the initPage() method is there to create a 'bookmarkable' link - amongst others - and store that information in the breadcrumb model. The getLinkParameters() is there for a subclass to provide its specific activation parameters to be used. Should I use another way to create bookmarable links? Q2: the onActivate() method is there to remove one (or more) crumbs from the crumbpath. Since other pages will also need activation - potentially with additional arguments - is this onActivate() the best way/place to manipulate the model? I'm getting the idea that onActivate() is not the designated alternative for T4's activateExternalPage(Object[] parameters, IRequestCycle cycle) in IExternalPage interface. Currently all of this works - although haven't tested activation with activation context parameters yet. Thx. -J. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - 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] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - 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]
Re: My breadcrumb component from T4 to T5
I'm not sure if I understand... Do you mean to say that manipulating the breadcrumb path (adding or removing crumbs) should/could all go into one event handler? Sure, couldn't they? I'm not sure why they are split up into the two different event handlers. Except in the case of action links and form submission both the onAction and beginRender events are going to fire in a request. You haven't mentioned a need to do anything different with the information between when the two events fire, so why not handle it in one place? Or am I missing something? On Wed, Apr 23, 2008 at 2:27 PM, Jan Vissers [EMAIL PROTECTED] wrote: Hi, I'm not sure if I understand... Do you mean to say that manipulating the breadcrumb path (adding or removing crumbs) should/could all go into one event handler? -J. Ah, by workflow I meant to ask when you expected the events to get fired, which you answered for the onactivate handler. So, why not do this all in one event handler, perhaps setupRender? On Wed, Apr 23, 2008 at 11:44 AM, Jan Vissers [EMAIL PROTECTED] wrote: I used T4 for a short period a long time ago, so I'm not understanding the parallels that you are making. Can you describe the workflow that you are shooting for? I'm not clear why you'd remove the breadcrumb in the activate event and the add it again the beginrender event. beginRender will : create a bookmarkable link : store (if necessary) in the model of breadcrumbs. onActivate gets called whenever a breadcrumb - rendered as link is clicked and will : remove a crumbs that are listed after the clicked link, cleaning up the trail I think the workflow is okay - as it is proven in T4. I'm just looking for the correct points to hook it into T5. Thx, -J. Josh On Wed, Apr 23, 2008 at 8:19 AM, Jan Vissers [EMAIL PROTECTED] wrote: Hi, Need some advice. In T4 I had a breadcrumb component that got its information from a breadcrumb model structure. Each page that needed to go onto the crumb path would implement some base page class. This page class implemented PageRenderListener and IExternalPage. The former to add info to the model and the latter to remove info from the model (btw the breadcrumb model was an ASO). Basically the model consisted of some key, name/title and (constructed) link tuple. The link basically pointed to an IExternalPage implemented page class - so to be precise the whole breadcrumb path consisted of bookmarkable pages. I'm trying to mimic this behavior with T5, using the BeginRender annotation on a basepage class method called initPage() and also on the basepage class a onActivate() method. I have some questions about it. Below the specific base page code: protected String getBreadCrumbTitle() { return resources.getMessages().get(title- + resources.getPageName().toLowerCase()); } protected Object[] getLinkParameters() { return null; } @BeginRender public void initPage() { String pageName = resources.getPageName(); Link link = resources.createPageLink(resources.getPageName(), true, getLinkParameters()); breadCrumbHolder.checkBreadCrumbForAdd(pageName, getBreadCrumbTitle(), link.toRedirectURI()); } public void onActivate() { String pageName = resources.getPageName(); breadCrumbHolder.checkBreadCrumbForRemove(pageName); } Q1: the initPage() method is there to create a 'bookmarkable' link - amongst others - and store that information in the breadcrumb model. The getLinkParameters() is there for a subclass to provide its specific activation parameters to be used. Should I use another way to create bookmarable links? Q2: the onActivate() method is there to remove one (or more) crumbs from the crumbpath. Since other pages will also need activation - potentially with additional arguments - is this onActivate() the best way/place to manipulate the model? I'm getting the idea that onActivate() is not the designated alternative for T4's activateExternalPage(Object[] parameters, IRequestCycle cycle) in IExternalPage interface. Currently all of this works - although haven't tested activation with activation context parameters yet. Thx. -J. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: question about onValidate and form reset
On 4/22/08, Kevin C. Dorff [EMAIL PROTECTED] wrote: NOW, to help with some future questions: With T3/T4 it was pretty easy to determine what methods to use for what, just look at the objects I was extending or implementing and I could see what method to implement or override to get what functionality. But since T5 uses POJO's, I am left trying to discover methods like onSubmit onValidateForm onValidateFromPassword onSelectedFromResetButton You can use the @OnEvent(component = componentName, value=eventName) annotation (http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/annotations/OnEvent.html) instead of method name conventions and then you can name your method any way suits you best. I prefer this than using name conventions, as a single typo and a name convention fails. -- Thiago - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: question about onValidate and form reset
On 4/23/08, Thiago HP [EMAIL PROTECTED] wrote: You can use the @OnEvent(component = componentName, value=eventName) annotation (http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/annotations/OnEvent.html) instead of method name conventions and then you can name your method any way suits you best. I prefer this than using name conventions, as a single typo and a name convention fails. More info here: http://tapestry.apache.org/tapestry5/tapestry-core/guide/event.html. -- Thiago - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
t5.0.11 help in update my own components
in my component a html select tag is rendered,and I want to add a onchange envent to it. below is some code ... select.attribute(onchange,alert(this.options[this.selectedIndex].value); ); select is a element created by /*writer.element(select)*/ trigering a javascript event is ok here .. but my problem is how to triger this component itself with onchange event. updating itself in result any one in warm heart could help me? thanks in advance!!! -- View this message in context: http://www.nabble.com/t5.0.11-help-in-update-my-own-components-tp16836395p16836395.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Is it possible to receive uploaded files from non-tapestry pages?
Hi. I wrote simple HTML like below start.html: form action=/myapp/upload method=post enctype=multipart/form-data input type=file/ input type=submit/ /form and very very simple tapestry codes. Upload.java: public class Upload {} When I press submit button in the HTML file, following error is occurred. What I should to do? Thanks for advice. [ERROR] RequestExceptionHandler Processing of request failed with uncaught exception: getReader() or getInputStream() called java.lang.IllegalStateException: getReader() or getInputStream() called at org.mortbay.jetty.servlet.ServletHttpRequest.setCharacterEncoding(ServletHttpRequest.java:602) at com.example.myapp.services.AppModule$1.service(AppModule.java:74) at $RequestFilter_1197ee90f59.service($RequestFilter_1197ee90f59.java) at $RequestHandler_1197ee90f5b.service($RequestHandler_1197ee90f5b.java) at org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:42) at $RequestHandler_1197ee90f5b.service($RequestHandler_1197ee90f5b.java) at org.apache.tapestry.services.TapestryModule$3.service(TapestryModule.java:553) at $RequestHandler_1197ee90f5b.service($RequestHandler_1197ee90f5b.java) at org.apache.tapestry.services.TapestryModule$2.service(TapestryModule.java:520) at $RequestHandler_1197ee90f5b.service($RequestHandler_1197ee90f5b.java) at org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79) at $RequestHandler_1197ee90f5b.service($RequestHandler_1197ee90f5b.java) at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93) at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84) at org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77) at org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106) at $RequestHandler_1197ee90f5b.service($RequestHandler_1197ee90f5b.java) at $RequestHandler_1197ee90f51.service($RequestHandler_1197ee90f51.java) at org.apache.tapestry.services.TapestryModule$12.service(TapestryModule.java:924) at org.apache.tapestry.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:43) at $HttpServletRequestHandler_1197ee90f52.service($HttpServletRequestHandler_1197ee90f52.java) at org.apache.tapestry.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $HttpServletRequestFilter_1197ee90f50.service($HttpServletRequestFilter_1197ee90f50.java) at $HttpServletRequestHandler_1197ee90f52.service($HttpServletRequestHandler_1197ee90f52.java) at $HttpServletRequestHandler_1197ee90f4e.service($HttpServletRequestHandler_1197ee90f4e.java) at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:168) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:820) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]