Re: T5: integer input box query
Hi Thiago, Thanks for your suggestion. Yes, the CSS is included correctly. The problem goes away when I use an Integer rather than an int. p. Quoting "Thiago H. de Paula Figueiredo" : Check if the Tapestry CSS file is being correctly included in your pages, because that's the one who hides the red X image when the textfield is rendered without errors. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: auto class reloading no longer works
Quoting Borut BolĨina : First, calm down :-) :-) Try with fresh maven tapestry 5 project. Thanks, although everything in my project is working and I'd rather understand how the class reloading works and how I can fix my non-working version than start from scratch. Perhaps http://bbwebcraft.blogspot.com/2009/01/task-3-rapid-turnaround-in-tapestry-5.htmlwill help. Thanks, I will read it. p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5: integer input box query
I have an input box that accepts an int. It is enabled/disabled by a selection from a combobox. Whenever it is enabled it shows a red border and red X next to it, even though the value in the box is correct (and is initialised with a value when the page is initially shown). Here is my mark-up: value="keywordVisual.keyword.proximity" t:disabled="keywordVisual.inverseUseProximity"/> keywordVisual.keyword.proximity is of type "int". Why is this occuring? thanks, p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5: auto class reloading no longer works
A while ago I had a problem with Maven deciding to wreck my Eclipse environment. I managed to fix all the problems, but I noticed class reloading no longer works. It's beginning to drive me insane, having to restart Jetty all the time... Where abouts should I look to get class reloading working again? p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Partly OT: problems with Eclipse / T5 (solved)
Please ignore previous posting. Problem (2) was caused by further problems courtesy of Maven screwing up my Eclipse environment. All fixed now. Apologies! p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Partly OT: problems with Eclipse / T5
Nothing much to see... I'm perplexed! I've fixed all my Maven problems now. So this leaves problem (2) - the uncatchable exception. The code in getRecordIdsByKeywordGroupsLC() correctly throws the exception. The catch never catches it. There is only one exception class with the name TooManyResultsException. It won't even catch it as Throwable. The following snippet is inside my onSuccess() method: try { System.out.println("START SearchResults"); searchResults = repository.getRecordIdsByKeywordGroupsLC(keywordGroups); // THIS IS LINE 231 } catch (TooManyResultsException e) { System.out.println("INSIDE TMRException Handler"); tooManyResults = e.getMaxNumber(); } Output is: onActivate :[uk.bl.dportal.marcdb.marckeywordvis...@1105f32] START SearchResults Process New Marc Group KSF = a lcqr=+value:church +marcField:245 +subField:a uk.bl.dportal.marcdb.TooManyResultsException at uk.bl.dportal.marcdb.HibernateMarcRepository.getRecordIdsByKeywordGroupsLC(HibernateMarcRepository.java:369) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)qryr=+value:church +marcField:245 +subField:asize = 76609 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy20.getRecordIdsByKeywordGroupsLC(Unknown Source) at uk.bl.dportal.pages.SearchMarc.onSuccess(SearchMarc.java:231) at uk.bl.dportal.pages.SearchMarc.dispatchComponentEvent(SearchMarc.java) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:886) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1059) at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.triggerContextEvent(InternalComponentResourcesImpl.java:228) at org.apache.tapestry5.corelib.components.Form._$advised$onAction(Form.java:408) at org.apache.tapestry5.corelib.components.Form$onAction$invocation_12019405399.invokeAdvisedMethod(Form$onAction$invocation_12019405399.java) at org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:71) at org.apache.tapestry5.ioc.internal.services.LoggingAdvice.advise(LoggingAdvice.java:37) at org.apache.tapestry5.internal.transform.LogWorker$1.advise(LogWorker.java:54) at org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:80) at org.apache.tapestry5.corelib.components.Form.onAction(Form.java) Quoting Andy Pahne : Sounds interesting somehow. Do you have some code to see? tapestryphoto schrieb: Hi, I'm using Jetty/T5/Eclipse. Earlier this-afternoon I made the mistake of doing a Maven "Update Project Configuration" and Maven anihilated my build setup. I have set the classpath back to what it was and everything compiles and the application works as expected EXCEPT: 1) I no longer seem to have the T5 / Jetty auto class reloading - changes I now make to my pages and the classes no longer appear without restarting Jetty. Check your workspace settings and verify that "Build automaticaly" is on. I had this problem once because of this setting. 2) I have a try/catch block that no longer catches an exception! I've tried everything, including changing it to catch(Throwable e) but to no avail. The code is being recompiled and called because any changes I make to the surrounding code (e.g.: adding System.outs) appears fine. The exception is just thrown as per normal and never caught by the surrounding catch block. It's almost like something is not now happening when Tapestry augments the class... Any ideas? It's the end of the day here and my brain is fried - nor can I believe what I'm
Partly OT: problems with Eclipse / T5
Hi, I'm using Jetty/T5/Eclipse. Earlier this-afternoon I made the mistake of doing a Maven "Update Project Configuration" and Maven anihilated my build setup. I have set the classpath back to what it was and everything compiles and the application works as expected EXCEPT: 1) I no longer seem to have the T5 / Jetty auto class reloading - changes I now make to my pages and the classes no longer appear without restarting Jetty. 2) I have a try/catch block that no longer catches an exception! I've tried everything, including changing it to catch(Throwable e) but to no avail. The code is being recompiled and called because any changes I make to the surrounding code (e.g.: adding System.outs) appears fine. The exception is just thrown as per normal and never caught by the surrounding catch block. It's almost like something is not now happening when Tapestry augments the class... Any ideas? It's the end of the day here and my brain is fried - nor can I believe what I'm seeing. p. PS: I have checked the classpath but cannot see any duplicate jar files which may be causing problem (2), so, other possibilities? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: timeout exception when using Grid - Solved, but query
Many thanks Ville. Quite obvious when one sees how to do it! p. Quoting Ville Virtanen : This is what we use, and it works well: @Retain private BeanModel model; { model = beanModelSource.createEditModel(Organization.class, messages); model.add("organizationType"); model.add("parentOrganization"); } public BeanModel getModel() { return model; } - Ville tapestryphoto wrote: My grid data required a model. In copying this in from an example I had: @SuppressWarnings("unchecked") @Property @Retain private BeanModel _myModel; The key here is @Retain. This works fine until there is a timeout (default 10 mins) and the page is returned to the pool whereupon it becomes null and thus causes Grid to fall over when it attempts to render. Changing Retain to Persist cured the problem. That's rather a nasty gotcha. QUESTION Currently I am creating my model in initialisePage(). If I were to contnue to use @Retain rather than @Persist, where should I be initialising my model? thanks, p. Quoting tapestryphoto : Further investigation reveals this is happening due to the page timing out and being returned to the pool by the timeout specified by the configuration option: tapestry.page-pool.active-window (which defaults to 10 minutes) So it would appear that it's being reset when returned to the pool. Unfortunately I'm not very knowledgable about this - even after reading the relevant info on page lifecycles. Can someone please shed some light on this? p. Quoting tapestryphoto : Hi! I have a form and a grid component on one of my pages (the grid is outside the form). All operates normally (using Jetty) unless I leave it for 10 minutes. If I then attempt to perform a submit I get the Null Pointer Exception listed below. It only happens on pages with the grid component. My Jetty session timeout (in webdefault.xml) is set to 30 minutes. I'm not quite sure how to proceed in tracking the problem down as the error is taking place in Grid. The ten minutes suggests a timeout - but where? Help appreciated. Thanks, p. java.lang.NullPointerException Stack trace * org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java:112) * org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl$13$1.run(ComponentPageElementImpl.java:495) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:917) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$200(ComponentPageElementImpl.java:50) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl$13.render(ComponentPageElementImpl.java:499) * org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72) * org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) * org.apache.tapestry5.services.TapestryModule$19.renderMarkup(TapestryModule.java:1200) * org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1580) * org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1561) * org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1543) * org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1525) * org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1495) * org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) * org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:57) * org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:59) * org.apache.tapestry5.services.TapestryModule$35.handle(TapestryModule.java:1779) * org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:92) * org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:71) * org.apache.tapestry5.services.TapestryModule$17.service(TapestryModule.java:1029) - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail
Re: T5: timeout exception when using Grid - Solved, but query
My grid data required a model. In copying this in from an example I had: @SuppressWarnings("unchecked") @Property @Retain private BeanModel _myModel; The key here is @Retain. This works fine until there is a timeout (default 10 mins) and the page is returned to the pool whereupon it becomes null and thus causes Grid to fall over when it attempts to render. Changing Retain to Persist cured the problem. That's rather a nasty gotcha. QUESTION Currently I am creating my model in initialisePage(). If I were to contnue to use @Retain rather than @Persist, where should I be initialising my model? thanks, p. Quoting tapestryphoto : Further investigation reveals this is happening due to the page timing out and being returned to the pool by the timeout specified by the configuration option: tapestry.page-pool.active-window (which defaults to 10 minutes) So it would appear that it's being reset when returned to the pool. Unfortunately I'm not very knowledgable about this - even after reading the relevant info on page lifecycles. Can someone please shed some light on this? p. Quoting tapestryphoto : Hi! I have a form and a grid component on one of my pages (the grid is outside the form). All operates normally (using Jetty) unless I leave it for 10 minutes. If I then attempt to perform a submit I get the Null Pointer Exception listed below. It only happens on pages with the grid component. My Jetty session timeout (in webdefault.xml) is set to 30 minutes. I'm not quite sure how to proceed in tracking the problem down as the error is taking place in Grid. The ten minutes suggests a timeout - but where? Help appreciated. Thanks, p. java.lang.NullPointerException Stack trace * org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java:112) * org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl$13$1.run(ComponentPageElementImpl.java:495) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:917) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$200(ComponentPageElementImpl.java:50) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl$13.render(ComponentPageElementImpl.java:499) * org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72) * org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) * org.apache.tapestry5.services.TapestryModule$19.renderMarkup(TapestryModule.java:1200) * org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1580) * org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1561) * org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1543) * org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1525) * org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1495) * org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) * org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:57) * org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:59) * org.apache.tapestry5.services.TapestryModule$35.handle(TapestryModule.java:1779) * org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:92) * org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:71) * org.apache.tapestry5.services.TapestryModule$17.service(TapestryModule.java:1029) - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: timeout exception when using Grid
Further investigation reveals this is happening due to the page timing out and being returned to the pool by the timeout specified by the configuration option: tapestry.page-pool.active-window (which defaults to 10 minutes) So it would appear that it's being reset when returned to the pool. Unfortunately I'm not very knowledgable about this - even after reading the relevant info on page lifecycles. Can someone please shed some light on this? p. Quoting tapestryphoto : Hi! I have a form and a grid component on one of my pages (the grid is outside the form). All operates normally (using Jetty) unless I leave it for 10 minutes. If I then attempt to perform a submit I get the Null Pointer Exception listed below. It only happens on pages with the grid component. My Jetty session timeout (in webdefault.xml) is set to 30 minutes. I'm not quite sure how to proceed in tracking the problem down as the error is taking place in Grid. The ten minutes suggests a timeout - but where? Help appreciated. Thanks, p. java.lang.NullPointerException Stack trace * org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java:112) * org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl$13$1.run(ComponentPageElementImpl.java:495) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:917) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$200(ComponentPageElementImpl.java:50) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl$13.render(ComponentPageElementImpl.java:499) * org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72) * org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) * org.apache.tapestry5.services.TapestryModule$19.renderMarkup(TapestryModule.java:1200) * org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1580) * org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1561) * org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1543) * org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1525) * org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1495) * org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) * org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:57) * org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:59) * org.apache.tapestry5.services.TapestryModule$35.handle(TapestryModule.java:1779) * org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:92) * org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:71) * org.apache.tapestry5.services.TapestryModule$17.service(TapestryModule.java:1029) - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5: timeout exception when using Grid
Hi! I have a form and a grid component on one of my pages (the grid is outside the form). All operates normally (using Jetty) unless I leave it for 10 minutes. If I then attempt to perform a submit I get the Null Pointer Exception listed below. It only happens on pages with the grid component. My Jetty session timeout (in webdefault.xml) is set to 30 minutes. I'm not quite sure how to proceed in tracking the problem down as the error is taking place in Grid. The ten minutes suggests a timeout - but where? Help appreciated. Thanks, p. java.lang.NullPointerException Stack trace * org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java:112) * org.apache.tapestry5.corelib.components.GridColumns.setupRender(GridColumns.java) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl$13$1.run(ComponentPageElementImpl.java:495) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:917) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$200(ComponentPageElementImpl.java:50) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl$13.render(ComponentPageElementImpl.java:499) * org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72) * org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) * org.apache.tapestry5.services.TapestryModule$19.renderMarkup(TapestryModule.java:1200) * org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1580) * org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1561) * org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1543) * org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1525) * org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1495) * org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) * org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:57) * org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:59) * org.apache.tapestry5.services.TapestryModule$35.handle(TapestryModule.java:1779) * org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:92) * org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:71) * org.apache.tapestry5.services.TapestryModule$17.service(TapestryModule.java:1029) - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5: how to invalidate session on logout?
I need to be able to reset everything when the user logs out. Currently @Persist objects are still available if the user logs in again with the same browser instance. This isn't very optimal. I have searched the mail archive and found some comments on this issue made at the end of 2007. I'm wondering if there is a standard way to do this. The Wiki appears to be silent on the issue - I would have thought this would have had more importance than it seems to have. According to these prehistoric ;-) postings to the mailing list, one should inject RequestGlobals and then call invalidate() on the session. Is this still the way to do this? It seems rather clunky and non-obvious - especially for the novice T5 programmer who is shown numerous examples of logins and ASOs and how to use @Persist. The T5 page about persistance strategies is also silent on the issue (apart from mentioning discardPersistentFieldChanges() - but that would require running the method on every page when logging out). Thoughts? p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
How to specify onUnload in ?
Hi, I have a template component that is used by all my pages. I'd like to be able to specify for one of those pages. Unfortunately it doesn't seem to matter what way I try I cannot get it to work. I can't include a in the page because then there will be two such tags (Firefox doesn't mind, but IE doesn't recognise the second body tag - plus it is poor form anyway). I can't include onUnload in the template because it appears to just be replaced with a standard tag when the page is rendered. I can't use any form of ... (which I would have liked to do - passing the onUnload string into my template and then choosing a single or parameterised version depending on whether the value was null) because has to match with and the tag obviously screws this up. I can't use t:outputRaw to generate my tag because it won't generate special characters properly ("<" and ">"). I don't recall having these sorts of problems with Tapestry 3 when I used it many moons ago. It seems T5 is really rather limited in this respect. Is there any way to do what I want? It is rather critical that I can perform onUnload. thanks, p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5]: query regarding streaming data
Thanks Julian - that did the trick. Much appreciated. p. Quoting Julian Wood : It works fine. Try something like this: public class TestPage { public Object onPDF(Long id) { return new PDFStreamResponse(dao.getPDF(id)); } public Link getPDFLink() { return resources.createActionLink("pdf", false); } } public class PDFStreamResponse implements StreamResponse { byte[] pdf; public PDFStreamResponse(byte[] pdf) { this.pdf = pdf; } public String getContentType() { return "application/pdf"; } public InputStream getStream() throws IOException { return new ByteArrayInputStream(pdf); } public void prepareResponse(Response response) { } } TestPage.tml: Open a PDF J On Dec 15, 2008, at 7:59 AM, tapestryphoto wrote: Thanks Olle, However, reading the docs I see that the Streaming applies to components. In my situation I need to open a new window, which I currently do with JavaScript (in this example I'm obviously opening a local file, but as I said, in the real version it needs to come from the DB): e.g.: Open a PDF which is so I can auto-close the window: function openPdf(url) { windowprops = "left=10,top=10,width=1000,height=1100"; if (ChildWin) { return false; } ChildWin = window.open(url, "ChildWin", windowprops); ResetTimer(); if (TimeOut && RefreshRate) { setTimeout("CheckClose();",RefreshRate * 1000); } } I really need the streaming to be coming from a URL I am opening and as far as I can see that won't work as StreamResponse applies to Components only. Hmmm. ! p. Quoting Olle Hallin : Yes, there is. Let your handler method return a StreamResponse object. See http://tapestry.apache.org/tapestry5/guide/pagenav.html and http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/StreamResponse.html. Olle 2008/12/15 tapestryphoto Hi, possibly not Tapestry specific and I'm not knowledgable enough on this subject, so apologies. I would like to be able to display a PDF that I obtain from a database using Hibernate via Tapestry. Is there a way to stream the data? thanks, p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5]: query regarding streaming data
Thanks Olle, However, reading the docs I see that the Streaming applies to components. In my situation I need to open a new window, which I currently do with JavaScript (in this example I'm obviously opening a local file, but as I said, in the real version it needs to come from the DB): e.g.: Open a PDF which is so I can auto-close the window: function openPdf(url) { windowprops = "left=10,top=10,width=1000,height=1100"; if (ChildWin) { return false; } ChildWin = window.open(url, "ChildWin", windowprops); ResetTimer(); if (TimeOut && RefreshRate) { setTimeout("CheckClose();",RefreshRate * 1000); } } I really need the streaming to be coming from a URL I am opening and as far as I can see that won't work as StreamResponse applies to Components only. Hmmm. ! p. Quoting Olle Hallin : Yes, there is. Let your handler method return a StreamResponse object. See http://tapestry.apache.org/tapestry5/guide/pagenav.html and http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/StreamResponse.html. Olle 2008/12/15 tapestryphoto Hi, possibly not Tapestry specific and I'm not knowledgable enough on this subject, so apologies. I would like to be able to display a PDF that I obtain from a database using Hibernate via Tapestry. Is there a way to stream the data? thanks, p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Olle Hallin Senior Java Developer and Architect olle.hal...@crisp.se www.crisp.se - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
[T5]: query regarding streaming data
Hi, possibly not Tapestry specific and I'm not knowledgable enough on this subject, so apologies. I would like to be able to display a PDF that I obtain from a database using Hibernate via Tapestry. Is there a way to stream the data? thanks, p. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: how to detect session timeout?
Thanks Peter. The problem was in the dispatcher code that disassembles the URL. The code that I grabbed from the wiki (as I recall) checks for / but doesn't account for . when attempting to obtain the page name. While I've had a security dispatcher working for some time that uses that code, this version was not working because when clicking on a link the path is of the form: ftpaccess.changedirectory/pub (when I needed the page called ftpaccess). All fixed now and works as expected. p. Quoting Peter Stavrinides <[EMAIL PROTECTED]>: I use a RequestFilter instead of a dispatcher to achieve same thing... but it should work just the same for you (before:PageRender is fine). In your dispatcher you need to check your state object for null and redirect to your login page. For example: if(applicationStateManager.get(SiteSessionAccess.class) == null){ response.sendRedirect(loginPage); return true; } Short-circuits the page load. -- If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail. - Original Message - From: "tapestryphoto" <[EMAIL PROTECTED]> To: users@tapestry.apache.org Sent: Wednesday, 3 December, 2008 1:42:53 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: T5: how to detect session timeout? Hi, I am trying to deal with session timeouts in T5. Rather than extend a base class I was hoping I might be able to use an Annotation. However, I find that when the user activates a link or presses a button on a timed-out session that the dispatcher is not being called early enough to detect anything and I end up with a null pointer exception. I have the following in my AppModule: configuration.add("TimeoutDetector", timeoutDetector, "before:PageRender"); Two questions: a) is it possible to detect Session timeouts in this way? b) As PageRender isn't early enough can I hook this in earlier? I'd also appreciate knowing what values can be placed in that parameter. Nowhere can I find this documented (apart from a reference to "before:" and "after:"). I've even looked in the T5 code but I'm afraid there is just too much of it to look through. Surely the specification of part of a page lifecycle would be better as something other than a String?! thanks, p. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: how to detect session timeout?
Hi, I am trying to deal with session timeouts in T5. Rather than extend a base class I was hoping I might be able to use an Annotation. However, I find that when the user activates a link or presses a button on a timed-out session that the dispatcher is not being called early enough to detect anything and I end up with a null pointer exception. I have the following in my AppModule: configuration.add("TimeoutDetector", timeoutDetector, "before:PageRender"); Two questions: a) is it possible to detect Session timeouts in this way? b) As PageRender isn't early enough can I hook this in earlier? I'd also appreciate knowing what values can be placed in that parameter. Nowhere can I find this documented (apart from a reference to "before:" and "after:"). I've even looked in the T5 code but I'm afraid there is just too much of it to look through. Surely the specification of part of a page lifecycle would be better as something other than a String?! thanks, p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5:Pages now broken under 17
Hi, I've just moved from 5.0.15 to 5.0.17. I now find I get this: Render queue error in BeginRender[Administration:pagelink_1]: Error persisting field SearchMetadata:allKeywords: Persistent fields may not be updated until after the page has finished loading. This may be due to a persistent field with a default value. The default value should be removed. I want to initialise various things and I'm afraid some of those things are persistant fields. My current code has these in the constructor for the class. Even if I change this to a method and use @PageLoaded it still doesn't like it. Where are persistant fields now supposed to be initialised? Why was this change made? thanks, p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tapestry 5, WAR files and deployment
Thank you Olle and everyone else who replied to my query. Indeed, I had to recreate the repository (plus I missed one or two dependencies). p. Quoting Olle Hallin <[EMAIL PROTECTED]>: The standard cure-most-dependency-problems medicin for Maven is to wipe your local repository and try again. Delete (or rename) $HOME/.m2/repository (Linux) or %USERPROFILE%\.m2\repository (Windows). Also: the standard way to package a any Maven project is mvn package. mvn war:war happens to work here, since it is bound to the package goal for a war project. HTH, Olle 2008/11/6 Fernando Padilla <[EMAIL PROTECTED]> This is probably because it can't download the files.. I would double check your networking, but because you're emailing us I'll assume it's working. Someone I know also had issue like this, and the cause for him was he installed it as root on his laptop, so when he tried to build it as his user he didn't have permissions to actually modify the repository. So it could not successfully fetch any dependencies. Though I don't recommend it, he runs all maven with sudo. Not sure what the best way to install it is, but I installed maven on my laptop simply by extracting it into a directory as my user, then adding the bin directory to my user's path.. tapestryphoto wrote: Quoting Olle Hallin <[EMAIL PROTECTED]>: Does it work from the command line? Olle I tried mvn war:war from the project directory. Bizarrely it gives even more problems. I find Maven very frustrating... [INFO] Failed to resolve artifact. Missing: -- 1) org.apache.maven:maven-archiver:jar:2.2 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.apache.maven -DartifactId=maven-arc hiver -Dversion=2.2 -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.apache.maven -DartifactId=maven-archi ver -Dversion=2.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryI d=[id] Path to dependency: 1) org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1 2) org.apache.maven:maven-archiver:jar:2.2 2) org.codehaus.plexus:plexus-utils:jar:1.4.7 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.codehaus.plexus -DartifactId=plexus -utils -Dversion=1.4.7 -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.codehaus.plexus -DartifactId=plexus-u tils -Dversion=1.4.7 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -Dreposito ryId=[id] Path to dependency: 1) org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1 2) org.codehaus.plexus:plexus-utils:jar:1.4.7 3) com.thoughtworks.xstream:xstream:jar:1.2.2 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=com.thoughtworks.xstream -DartifactId=x stream -Dversion=1.2.2 -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=com.thoughtworks.xstream -DartifactId=xst ream -Dversion=1.2.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -Dreposito ryId=[id] Path to dependency: 1) org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1 2) com.thoughtworks.xstream:xstream:jar:1.2.2 -- 3 required artifacts are missing. - 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] -- Olle Hallin Senior Java Developer and Architect [EMAIL PROTECTED] www.crisp.se - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tapestry 5, WAR files and deployment
Quoting Olle Hallin <[EMAIL PROTECTED]>: Does it work from the command line? Olle I tried mvn war:war from the project directory. Bizarrely it gives even more problems. I find Maven very frustrating... [INFO] Failed to resolve artifact. Missing: -- 1) org.apache.maven:maven-archiver:jar:2.2 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.apache.maven -DartifactId=maven-arc hiver -Dversion=2.2 -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.apache.maven -DartifactId=maven-archi ver -Dversion=2.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryI d=[id] Path to dependency: 1) org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1 2) org.apache.maven:maven-archiver:jar:2.2 2) org.codehaus.plexus:plexus-utils:jar:1.4.7 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.codehaus.plexus -DartifactId=plexus -utils -Dversion=1.4.7 -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=org.codehaus.plexus -DartifactId=plexus-u tils -Dversion=1.4.7 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -Dreposito ryId=[id] Path to dependency: 1) org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1 2) org.codehaus.plexus:plexus-utils:jar:1.4.7 3) com.thoughtworks.xstream:xstream:jar:1.2.2 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=com.thoughtworks.xstream -DartifactId=x stream -Dversion=1.2.2 -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=com.thoughtworks.xstream -DartifactId=xst ream -Dversion=1.2.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -Dreposito ryId=[id] Path to dependency: 1) org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1 2) com.thoughtworks.xstream:xstream:jar:1.2.2 -- 3 required artifacts are missing. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tapestry 5, WAR files and deployment
Thanks Olle, much appreciated! Although when I try Maven I get: Error message: Failed to resolve plugin for mojo binding: org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test Root error message: Unable to download the artifact from any repository p. Quoting Olle Hallin <[EMAIL PROTECTED]>: Hi, This is most easily done with mvn package. The resulting WAR is found in the target folder of your project. Drop it into Tomcat/Jetty, and you're done. If you insist on doing it from within Eclipse, then 1. install the m2eclipse plugin 2. enable Maven for your project 3. right-click pom.xml and invoke Run As -> Maven package Olle 2008/11/6 James Sherwood <[EMAIL PROTECTED]> Hello, I deploy to tomcat but war essentials should be the same. I think the only difference between tomcat and Jetty are Tomcats classloaders which maven takes care of apparently. Just create the WAR with eclipse and drop it in your deploy folder(tomcat is the webapps directory and you don't even have to create a context) but for Jetty you may have too. Just do a quick search on deploying war's to jetty. This is one example that might help you(I am not familiar with Jetty): http://markmail.org/message/csnnytlurso7b3ut --James -----Original Message- From: tapestryphoto [mailto:[EMAIL PROTECTED] Sent: November-06-08 10:19 AM To: users@tapestry.apache.org Subject: Tapestry 5, WAR files and deployment Hi, Having gone through the Tapestry tutorials, got to grips with it, developed a small application and have got it running well I'd like to actually deploy it. I notice there are no documents, examples or tutorials (as far as I can see) that address how to do this. Even the "Tapestry 5" book is pretty silent on the issue (apart from telling me what a WAR file is - and even I know that). Perhaps someone could whip up a Wiki entry? I'm using Eclipse. I'd like to: 1) create a WAR from my project 2) deploy it on a server that has Jetty running. Do I need something like the following build.xml: Is there anthing else I need to do for this Ant target? Or do I use Maven? And is that something like a command line call: mvn war:war or are there other things I need to do first? I then place the resulting WAR in the "webapps" directory under Jetty and start Jetty. Correct? p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Information from ESET Smart Security, version of virus signature database 3536 (20081019) __ The message was checked by ESET Smart Security. http://www.eset.com __ Information from ESET Smart Security, version of virus signature database 3536 (20081019) __ The message was checked by ESET Smart Security. http://www.eset.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Olle Hallin M.Sc. +46 70 6653071 [EMAIL PROTECTED] www.hit.se - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tapestry 5, WAR files and deployment
Hi, Having gone through the Tapestry tutorials, got to grips with it, developed a small application and have got it running well I'd like to actually deploy it. I notice there are no documents, examples or tutorials (as far as I can see) that address how to do this. Even the "Tapestry 5" book is pretty silent on the issue (apart from telling me what a WAR file is - and even I know that). Perhaps someone could whip up a Wiki entry? I'm using Eclipse. I'd like to: 1) create a WAR from my project 2) deploy it on a server that has Jetty running. Do I need something like the following build.xml: Is there anthing else I need to do for this Ant target? Or do I use Maven? And is that something like a command line call: mvn war:war or are there other things I need to do first? I then place the resulting WAR in the "webapps" directory under Jetty and start Jetty. Correct? p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: cannot use Grid's rowIndex in page class
By chance I used one for the first time this-morning. I have: t:rowIndex="rowIndex" t:empty="There are currently no search results" t:model="mymodel" t:row="listItem"> ... > ... and code: ... @SuppressWarnings("unused") @Property @Persist private int rowIndex; ... and it works just fine. Try it without explicit getters/setters (which is the only difference I can see between your code and mine) and see what happens. p. Quoting Geoff Callender <[EMAIL PROTECTED]>: Has anyone been able to use Grid's rowIndex parameter in their page class? I see that it is supposed to be available from 5.0.15 ( https://issues.apache.org/jira/browse/TAPESTRY-1310 ) but I just cannot make it work. From my template: and from my page class: private int _rowIndex; public int getRowIndex() { System.out.println(">>> getRowIndex(), _rowIndex = " + _rowIndex + ")"); return _rowIndex; } public void setRowIndex(int index) { System.out.println(">>> setRowIndex(" + index + ")"); _rowIndex = index; } but the getter and setter are never called - not during render and not during form submission. Any ideas? Thanks, Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: help required: Context and PageLink
Thanks Tobias! Quoting Tobias Wehrum <[EMAIL PROTECTED]>: Hi, the problem is not your pagelink, the problem is your stylesheet link. When it trys to load, it seems to search in "viewMetadata/style.css", thus being passed as an activation context which of course cannot be coerced to long. Anyway, in my opinion the best way to pass the stylesheet is the @IncludeStylesheet-Annotation. @IncludeStylesheet("context:/style.css") class ViewMetadata { [...] } An alternative and something you might need when including images, for example, is by using Assets: viewMetadata.java: @Inject @Path("context:/style.css") @Property Asset cssFile; viewMetadata.tml More on Assets: http://tapestry.apache.org/tapestry5/guide/assets.html - Tobias tapestryphoto schrieb: I have a PageLink thus: > and code thus: public void onActivate(long metadataId) { System.out.println("METADATA ID = "+metadataId); this.metadata = repository.getMetaDataById(metadataId); } Although every time I click on the link I get taken to the correct page and the passed value is printed out correctly, I also get the following exception: [ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Exception in method dportal.pages.ViewMetadata.onActivate(long) (at ViewMetadata.java:20), parameter #1: Coercion of style.css to type java.lang.Long (via String --> Long) failed: For input string: "style.css" org.apache.tapestry5.runtime.ComponentEventException: Exception in method dportal.pages.ViewMetadata.onActivate(long) (at ViewMetadata.java:20), parameter #1: Coercion of style.css to type java.lang.Long (via String --> Long) failed: For input string: "style.css" This occurs even when hard-coding the value thus: > So, what have I done wrong? p. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: help required: Context and PageLink
I have a PageLink thus: > and code thus: public void onActivate(long metadataId) { System.out.println("METADATA ID = "+metadataId); this.metadata = repository.getMetaDataById(metadataId); } Although every time I click on the link I get taken to the correct page and the passed value is printed out correctly, I also get the following exception: [ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: Exception in method dportal.pages.ViewMetadata.onActivate(long) (at ViewMetadata.java:20), parameter #1: Coercion of style.css to type java.lang.Long (via String --> Long) failed: For input string: "style.css" org.apache.tapestry5.runtime.ComponentEventException: Exception in method dportal.pages.ViewMetadata.onActivate(long) (at ViewMetadata.java:20), parameter #1: Coercion of style.css to type java.lang.Long (via String --> Long) failed: For input string: "style.css" This occurs even when hard-coding the value thus: > So, what have I done wrong? p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Grid bug - Grid is not collection type aware
Ok, after some experimentation I can see that I can do this by providing a BeanModel. p. Quoting tapestryphoto <[EMAIL PROTECTED]>: If the source for a grid is a collection which has a generic type of an abstract class and the list contains concrete classes which are not all of the same subclass then it throws: Render queue error in BeginRender[SearchByTag:grid_0.rows.gridcell]: ConcreteB cannot be cast to ConcreteA Is this a bug? It certainly seems that way to me; at the very least it seems a deficiency. Suggestions for a workaround? (my guess is to create another class which will hold all the values I want to display, then copy everything from my list of abstract-derived classes into a list of this new class - how incredibly ugly. Surely there must be a better way?) Template fragment: Code fragments: @Property @Persist private List conList; // this doesn't work: conList = new ArrayList(); conList.add(new ConcreteA()); conList.add(new ConcreteA()); conList.add(new ConcreteB()); // this does work: conList = new ArrayList(); conList.add(new ConcreteA()); conList.add(new ConcreteA()); conList.add(new ConcreteA()); public class ConcreteA extends AbstractClass { } public class ConcreteB extends AbstractClass { } public abstract class AbstractClass { private String a; private String b; public String getA() { return "I am A"; } public void setA(String a) { this.a = a; } public String getB() { return "I am B"; } public void setB(String b) { this.b = b; } } - 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] editing a looped list of objects' properties in a form
Quoting Andy Pahne <[EMAIL PROTECTED]>: tapestryphoto schrieb: I think you might find (as I did - see my 2nd original posting on this issue) that the objects being updated in the loop are different instances to the ones that are specified. It seems to be a serialization problem (but that's a guess on my part - I don't know what the Tapestry code does). I think a bug should be raised for this issue. I don't know if I understand enough about how it works or why the solution works that Jonathan posted. So I don't know if that's a bug or a feature. But the documentation could be enhanced. Maybe a JIRA for that? Yes, more information on volatile (and how it interacts with @Persist) would be nice. For the moment I have moved away from Loop and am using Grid... not that Grid is without its own set of problems :-) p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: Grid bug - Grid is not collection type aware
If the source for a grid is a collection which has a generic type of an abstract class and the list contains concrete classes which are not all of the same subclass then it throws: Render queue error in BeginRender[SearchByTag:grid_0.rows.gridcell]: ConcreteB cannot be cast to ConcreteA Is this a bug? It certainly seems that way to me; at the very least it seems a deficiency. Suggestions for a workaround? (my guess is to create another class which will hold all the values I want to display, then copy everything from my list of abstract-derived classes into a list of this new class - how incredibly ugly. Surely there must be a better way?) Template fragment: Code fragments: @Property @Persist private List conList; // this doesn't work: conList = new ArrayList(); conList.add(new ConcreteA()); conList.add(new ConcreteA()); conList.add(new ConcreteB()); // this does work: conList = new ArrayList(); conList.add(new ConcreteA()); conList.add(new ConcreteA()); conList.add(new ConcreteA()); public class ConcreteA extends AbstractClass { } public class ConcreteB extends AbstractClass { } public abstract class AbstractClass { private String a; private String b; public String getA() { return "I am A"; } public void setA(String a) { this.a = a; } public String getB() { return "I am B"; } public void setB(String b) { this.b = b; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] editing a looped list of objects' properties in a form
Quoting Andy Pahne <[EMAIL PROTECTED]>: That were our web designers. But it worked that way in many other form components. So I did not think about it any further. Anyway, I tried . There's no difference in the behaviour, regardless of which type of Submit is used. I think you might find (as I did - see my 2nd original posting on this issue) that the objects being updated in the loop are different instances to the ones that are specified. It seems to be a serialization problem (but that's a guess on my part - I don't know what the Tapestry code does). I think a bug should be raised for this issue. p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] editing a looped list of objects' properties in a form
My understanding is the "additional configuration" is in using an encoder. If you have simple serializable objects (like I do) then it should just encode them automagically in the form. If you have complex objects then you need to write an encoder so only, say, object ids are encoded in the form. p. Quoting Andy Pahne <[EMAIL PROTECTED]>: It should work somehow, at least the documentation says so: http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Loop.html (at the very end of the page). Quote "Tapestry form control element components (TextField, etc.) work inside loops. However, some additional configuration is needed to make this work efficiently. " Unfortunatly it does not say what "additional configuration" is needed to make that work. Andy tapestryphoto wrote: This looks similar to my problem (see both of my posts from a day or so ago). It appears Loops in a Form do not update the properties. Perhaps this is broken in Tapestry. I guess it must be a bug. Unfortunately I'm not knowledgeable enough about Tapestry to provide an answer and I await someone who is. p. - 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] editing a looped list of objects' properties in a form
This looks similar to my problem (see both of my posts from a day or so ago). It appears Loops in a Form do not update the properties. Perhaps this is broken in Tapestry. I guess it must be a bug. Unfortunately I'm not knowledgeable enough about Tapestry to provide an answer and I await someone who is. p. Quoting Andy Pahne <[EMAIL PROTECTED]>: I am trying to edit the properties of objects contained in a list by using a loop in a form component. But it does not work, because the objects in the list are not updated. The list of passengers: @Property @Persist private List passengers; This list is initialized like this: @BeforeRenderTemplate public void initialize() { int passengersTotal = getQuery().getPassengersTotal(); if(passengers == null) { passengers = new ArrayList(passengersTotal); for (int i = 0; i < passengersTotal; i++) { passengers.add(new Passenger()); } } } I try to buid a form in order to edit the passengers like this: ${message:firstName-label} Unfortunatly, after a successful submit, the firstName property is not set for any of the passengers contained in that list. I veryify that by the following logging statements: public void onSuccess() { int passengersTotal = getSearchOptions().getPassengersTotal(); for (int i = 0; i < passengersTotal; i++) { System.out.println("Passenger '"+i+"'" + ": " + passengers.get(i).getFirstName()); } } which always produces the output: Passenger '0': null Passenger '1': null I thought that this would be the way to go, but I must be wrong somehow. Could anybody tell me what's the correct pattern to use here? Thank you, 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]
T5: Query about BeanModel
Am I correct in thinking that the default BeanModel only recognises the standard property types (String, double, etc, etc)? I have a bean with several properties, one of which is one of my own types. When I attempt to use this bean in Grid I am unable to specify the property in the include list. If I specify that particular property an error occurs and claims that the property does not exist (and it does not appear in the list of available properties). p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: looping in form not updating values
I should add that replacing the Loop with a Grid causes it to work as expected. Also, I notice that when I use a Loop, the setValue() being called is on a different instance of Keyword than the one used by the getter. As new is only called once, I gather the object used by the setter must be being created by the serialization mechanism. Any further thoughts appreciated as this has me stumped. p. Quoting tapestryphoto <[EMAIL PROTECTED]>: Hi, Bit of a simple query. I'm not sure what I'm doing wrong as I've followed the example given in the T5 component reference (bar using an encoder - my values are strings so I don't see why I should need one). I'm trying to implement a dynamic form where a user can add extra keyword fields. Adding works fine. Unfortunately when the form is submitted on Search none of the keyword values are updated with the entered values. Here is the markup: Tag: Keyword: Here is the page class: public class SearchByTag { @SuppressWarnings("unused") @Property @Persist private GenericSelectModel tags; @SuppressWarnings("unused") @Property @Persist private Tag tag; @SuppressWarnings("unused") @Property @Persist private List searchResults; @SuppressWarnings("unused") @Property @Persist private Value listItem; @Property @Persist private List allKeywords; @Persist private Keyword keyword; @Inject private PropertyAccess propertyAccess; @Inject private MetadataRepository repository; public SearchByTag() { List list = repository.getAllTags(); allKeywords = new ArrayList(); tags = new GenericSelectModel(list,Tag.class,"name","id",propertyAccess); } public GenericSelectModel getBeans() { return tags; } void onSelectedFromAdd() { allKeywords.add(new Keyword()); } Object onSuccess() { for (Keyword x: allKeywords) { System.out.println("VALUE > "+x.getValue()); } return this; } public Keyword getKeyword() { return keyword; } public void setKeyword(Keyword keyword) { this.keyword = keyword; } } - 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]
T5: looping in form not updating values
Hi, Bit of a simple query. I'm not sure what I'm doing wrong as I've followed the example given in the T5 component reference (bar using an encoder - my values are strings so I don't see why I should need one). I'm trying to implement a dynamic form where a user can add extra keyword fields. Adding works fine. Unfortunately when the form is submitted on Search none of the keyword values are updated with the entered values. Here is the markup: Tag: t:encoder="tags" t:blankOption="NEVER"> Keyword: Here is the page class: public class SearchByTag { @SuppressWarnings("unused") @Property @Persist private GenericSelectModel tags; @SuppressWarnings("unused") @Property @Persist private Tag tag; @SuppressWarnings("unused") @Property @Persist private List searchResults; @SuppressWarnings("unused") @Property @Persist private Value listItem; @Property @Persist private List allKeywords; @Persist private Keyword keyword; @Inject private PropertyAccess propertyAccess; @Inject private MetadataRepository repository; public SearchByTag() { List list = repository.getAllTags(); allKeywords = new ArrayList(); tags = new GenericSelectModel(list,Tag.class,"name","id",propertyAccess); } public GenericSelectModel getBeans() { return tags; } void onSelectedFromAdd() { allKeywords.add(new Keyword()); } Object onSuccess() { for (Keyword x: allKeywords) { System.out.println("VALUE > "+x.getValue()); } return this; } public Keyword getKeyword() { return keyword; } public void setKeyword(Keyword keyword) { this.keyword = keyword; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]