extending Select component
Hi I'm trying to extend Tapestry's Select component. My idea is to create EnumSelect class (class EnumSelect extends Select) that takes an Enum class as a parameter, and based on this creates SelectModel and ValueEncoder. Everything works fine, but each EnumSelect in a tml-file results in 2 rendered selects in output - at first Tapestry invokes render methods of EnumSelect and then Select. What should I do to get only 1 select in rendered output? Is it even possible to extend existing AbstarctField implementation? I do not see such an example in tapestry-core library. Regards Keio Kraaner - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: IllegalAccessError in IoC
Thanks very much for the explanation Howard!! Cheers, Peter - Original Message - From: Howard Lewis Ship hls...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Thursday, 14 April, 2011 19:21:03 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: IllegalAccessError in IoC On Thu, Apr 14, 2011 at 2:55 AM, p.stavrini...@albourne.com wrote: Hi Howard et al, We are using Tapestry 5 IoC in all our applications (both standalone and web), and have a very sizeable IoC code base. We have tried a couple of times now to upgrade it from 5.1 and 5.2.4, but it seems backwards compatibility is broken... The problem we are stuck on now is whenever a non-public method is called from within a service we are getting the dreaded IllegalAccessError. I have not dug very deep into Tapestrys internals to figure out why this is happening yet, but I am certain that in Tapestry 5.1 this is not the case. When Tapestry loads a service it creates a new class loader for it. The service class and its inner classes and base classes are loaded by that class loader, but it causes problems accessing non-public members of other classes in the same package: it's not really the same class or the same package, it just shares the package name and class name. A very, very leaky abstraction (one of the reasons I didn't attempt live service reloading earlier it because its impossible to do it right without much more intrusive technology, such as an agent). When you bind() a service, you can now explicitly disable live service reloading for that one service, see ServiceBindingOptions. You might suggest to simply change the scope of these methods and classes but we can't easily re-factor our library modules because of the sheer scale, and even if it were an option, and we did consider it for a time, these errors produce runtime exceptions, which makes it is very difficult to find every occurrence in the code, so for us to change the scope for our entire IoC codebase is not a practical solution. This seems like a big change from 5.1, and is a real blocker for us, I would greatly appreciate any assistance. Thanks, Peter - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: extending Select component
There is no need to extend the Select component for your use case. Just create an instance of EnumSelectModel [1] and pass it to the Select component. [1] http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/util/EnumSelectModel.html 2011/4/15 Keio Kraaner k.kraa...@gmail.com Hi I'm trying to extend Tapestry's Select component. My idea is to create EnumSelect class (class EnumSelect extends Select) that takes an Enum class as a parameter, and based on this creates SelectModel and ValueEncoder. Everything works fine, but each EnumSelect in a tml-file results in 2 rendered selects in output - at first Tapestry invokes render methods of EnumSelect and then Select. What should I do to get only 1 select in rendered output? Is it even possible to extend existing AbstarctField implementation? I do not see such an example in tapestry-core library. Regards Keio Kraaner - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Best regards, Igor Drobiazko http://tapestry5.de
Re: extending Select component
Thanks for the suggestion, Igor. I made up this use case just to keep it very simple. My real question is still the following: is it possible to extend Select (or any other tapestry-core component that extends AbstractField)? - Original Message - From: Igor Drobiazko igor.drobia...@gmail.com There is no need to extend the Select component for your use case. Just create an instance of EnumSelectModel [1] and pass it to the Select component. [1] http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/util/EnumSelectModel.html 2011/4/15 Keio Kraaner k.kraa...@gmail.com Hi I'm trying to extend Tapestry's Select component. My idea is to create EnumSelect class (class EnumSelect extends Select) that takes an Enum class as a parameter, and based on this creates SelectModel and ValueEncoder. Everything works fine, but each EnumSelect in a tml-file results in 2 rendered selects in output - at first Tapestry invokes render methods of EnumSelect and then Select. What should I do to get only 1 select in rendered output? Is it even possible to extend existing AbstarctField implementation? I do not see such an example in tapestry-core library. Regards Keio Kraaner - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Best regards, Igor Drobiazko http://tapestry5.de - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: extending Select component
Of course. Tapestry components are valid Java classes; you can extend any existing component. On Fri, Apr 15, 2011 at 11:43 AM, Keio Kraaner k.kraa...@gmail.com wrote: Thanks for the suggestion, Igor. I made up this use case just to keep it very simple. My real question is still the following: is it possible to extend Select (or any other tapestry-core component that extends AbstractField)? - Original Message - From: Igor Drobiazko igor.drobia...@gmail.com There is no need to extend the Select component for your use case. Just create an instance of EnumSelectModel [1] and pass it to the Select component. [1] http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/util/EnumSelectModel.html 2011/4/15 Keio Kraaner k.kraa...@gmail.com Hi I'm trying to extend Tapestry's Select component. My idea is to create EnumSelect class (class EnumSelect extends Select) that takes an Enum class as a parameter, and based on this creates SelectModel and ValueEncoder. Everything works fine, but each EnumSelect in a tml-file results in 2 rendered selects in output - at first Tapestry invokes render methods of EnumSelect and then Select. What should I do to get only 1 select in rendered output? Is it even possible to extend existing AbstarctField implementation? I do not see such an example in tapestry-core library. Regards Keio Kraaner - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Best regards, Igor Drobiazko http://tapestry5.de - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Best regards, Igor Drobiazko http://tapestry5.de
Re: Absolute Paths in Tapestry 5.2.5
Hi Christian, tank you for this great Tip! I overridden the getContextPath() method and it gets called but after i return / i get a timeout at the browser. Your tip sounds good and i have to investigate further. Thanks a lot! Jochen -- View this message in context: http://tapestry.1045711.n5.nabble.com/Absolute-Paths-in-Tapestry-5-2-5-tp4300824p4305176.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Displaying a progress message while processing a zone update
Hi, I'm just getting started with Tapestry5, and very impressed so far. I have a zone on my page containing a grid component that takes about 20 seconds to calculate the contents of. I don't want the loading of the page to hang while this occurs, so I initially have the contents of the zone hidden by an if component associated with a boolean property for the visibility, and have the get method for the grid contents conditionally returning null when the property is set to false. To calculate the contents and display the zone I have an actionlink that changes the boolean property and returns the zone body. The toggling works fine, but what I would like to do is display a message on the page as soon as the actionlink is clicked saying that the load is in progress (at the moment there is no visible change for 20s), and then this message should go away when the zone appears. Is there a way to do this? Also, I would appreciate any insights into whether there is a better way to do this... From the tml: t:actionlink t:id=toggleDomains zone=domainsZoneDomains/t:actionlink t:zone t:id=domainsZone t:if test=domainsVisible t:grid source=domains rowsPerPage=15/ /t:if /t:zone From the page class: @Persist @Property private boolean domainsVisible; @InjectComponent private Zone domainsZone; Zone onActionFromToggleDomains() { domainsVisible = domainsVisible ? false : true; return domainsZone; } public ListDomain getDomains() { if(domainsVisible) { return retrieveDomainList(); } else { return null; } } Thanks for all the interesting discussion and tips. David
Re: extending Select component
And what about the weird behaviour which results when rendering a child of a Tapestry component? Of course. Tapestry components are valid Java classes; you can extend any existing component. On Fri, Apr 15, 2011 at 11:43 AM, Keio Kraaner k.kraa...@gmail.com wrote: Thanks for the suggestion, Igor. I made up this use case just to keep it very simple. My real question is still the following: is it possible to extend Select (or any other tapestry-core component that extends AbstractField)? - Original Message - From: Igor Drobiazko igor.drobia...@gmail.com There is no need to extend the Select component for your use case. Just create an instance of EnumSelectModel [1] and pass it to the Select component. [1] http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/util/EnumSelectModel.html 2011/4/15 Keio Kraaner k.kraa...@gmail.com Hi I'm trying to extend Tapestry's Select component. My idea is to create EnumSelect class (class EnumSelect extends Select) that takes an Enum class as a parameter, and based on this creates SelectModel and ValueEncoder. Everything works fine, but each EnumSelect in a tml-file results in 2 rendered selects in output - at first Tapestry invokes render methods of EnumSelect and then Select. What should I do to get only 1 select in rendered output? Is it even possible to extend existing AbstarctField implementation? I do not see such an example in tapestry-core library. Regards Keio Kraaner - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Best regards, Igor Drobiazko http://tapestry5.de - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Best regards, Igor Drobiazko http://tapestry5.de - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Displaying a progress message while processing a zone update
A javascripty approach would be to popup the progress indicator onclick and hide it when the ZONE_UPDATED event is fired on the zone. Or you can look up that periodic zone refresh example, and have the zone load over and over, with it saying Still Loading until the actual results arrive. Not sure how you'd stop the periodic part when you don't need it though. -- View this message in context: http://tapestry-users.832.n2.nabble.com/Displaying-a-progress-message-while-processing-a-zone-update-tp6275777p6275833.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Displaying a progress message while processing a zone update
Use ProgressiveDisplay component? http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/ProgressiveDisplay.html see example http://lombok.demon.co.uk/tapestry5Demo/test/core/progressivedisplaydemosource or from tapestry test case http://tapestry-test.appspot.com/progressivedemo with the related src at http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ProgressiveDemo.java?view=markup François 2011/4/15 David Woods dwood...@gmail.com: Hi, I'm just getting started with Tapestry5, and very impressed so far. I have a zone on my page containing a grid component that takes about 20 seconds to calculate the contents of. I don't want the loading of the page to hang while this occurs, so I initially have the contents of the zone hidden by an if component associated with a boolean property for the visibility, and have the get method for the grid contents conditionally returning null when the property is set to false. To calculate the contents and display the zone I have an actionlink that changes the boolean property and returns the zone body. The toggling works fine, but what I would like to do is display a message on the page as soon as the actionlink is clicked saying that the load is in progress (at the moment there is no visible change for 20s), and then this message should go away when the zone appears. Is there a way to do this? Also, I would appreciate any insights into whether there is a better way to do this... From the tml: t:actionlink t:id=toggleDomains zone=domainsZoneDomains/t:actionlink t:zone t:id=domainsZone t:if test=domainsVisible t:grid source=domains rowsPerPage=15/ /t:if /t:zone From the page class: @Persist @Property private boolean domainsVisible; @InjectComponent private Zone domainsZone; Zone onActionFromToggleDomains() { domainsVisible = domainsVisible ? false : true; return domainsZone; } public ListDomain getDomains() { if(domainsVisible) { return retrieveDomainList(); } else { return null; } } Thanks for all the interesting discussion and tips. David - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Displaying a progress message while processing a zone update
Thanks guys. I am trying to avoid javascript and to do this with tapestry components, so the ProgressiveDisplay method that François suggested seems perfect. A bit of fiddling and it's working perfectly. For the record, and for future searchers, here is the code that I used: From the tml: t:actionlink t:id=toggleDomains zone=domainsZoneDomains/t:actionlink t:zone t:id=domainsZone t:if test=domainsVisible t:progressivedisplay t:id=domainLoadingIndicator update=show/ t:block t:id=domainsBlock t:grid source=domains rowsPerPage=15/ /t:block /t:if /t:zone From the page class: @Persist @Property private boolean domainsVisible; @SetupRender void initialize() { domainsVisible = false; } @InjectComponent private Zone domainsZone; @Inject private Block domainsBlock; Zone onActionFromToggleDomains(){ domainsVisible = domainsVisible ? false : true; return domainsZone; } Block onProgressiveDisplayFromDomainLoadingIndicator(){ return domainsBlock; } public ListDomain getDomains() { if(domainsVisible){ return retrieveDomainList(); } else { return null; } } David On Friday, 15 April 2011 at 8:31 PM, François Facon wrote: Use ProgressiveDisplay component? http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/ProgressiveDisplay.html see example http://lombok.demon.co.uk/tapestry5Demo/test/core/progressivedisplaydemosource or from tapestry test case http://tapestry-test.appspot.com/progressivedemo with the related src at http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ProgressiveDemo.java?view=markup François 2011/4/15 David Woods dwood...@gmail.com: Hi, I'm just getting started with Tapestry5, and very impressed so far. I have a zone on my page containing a grid component that takes about 20 seconds to calculate the contents of. I don't want the loading of the page to hang while this occurs, so I initially have the contents of the zone hidden by an if component associated with a boolean property for the visibility, and have the get method for the grid contents conditionally returning null when the property is set to false. To calculate the contents and display the zone I have an actionlink that changes the boolean property and returns the zone body. The toggling works fine, but what I would like to do is display a message on the page as soon as the actionlink is clicked saying that the load is in progress (at the moment there is no visible change for 20s), and then this message should go away when the zone appears. Is there a way to do this? Also, I would appreciate any insights into whether there is a better way to do this... From the tml: t:actionlink t:id=toggleDomains zone=domainsZoneDomains/t:actionlink t:zone t:id=domainsZone t:if test=domainsVisible t:grid source=domains rowsPerPage=15/ /t:if /t:zone From the page class: @Persist @Property private boolean domainsVisible; @InjectComponent private Zone domainsZone; Zone onActionFromToggleDomains() { domainsVisible = domainsVisible ? false : true; return domainsZone; } public ListDomain getDomains() { if(domainsVisible) { return retrieveDomainList(); } else { return null; } } Thanks for all the interesting discussion and tips. David - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: extending Select component
On Fri, 15 Apr 2011 07:18:14 -0300, Keio Kraaner k.kraa...@gmail.com wrote: And what about the weird behaviour which results when rendering a child of a Tapestry component? Which weird behaviour? Any way, Tapestry-provided components are not meant to be subclassed. It is recommended to create mixins when possible. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Absolute Paths in Tapestry 5.2.5
The path seems to be working now but the problem with the ajax resists in my generated site i have a autocompleter and in the sourcecode of the site i found this Tapestry.onDOMLoaded(function() { Tapestry.init({ autocompleter : [ [ nameInput, nameInput:menu, /myApp/game/account/givegift.playerinput.nameinput:autocomplete, --- x { minChars : 3, indicator : nameInput:loader, paramName : t:input } ] ] }); I think the autocompleter does not work because of the relative path here Thanks for all replies! Jochen -- View this message in context: http://tapestry.1045711.n5.nabble.com/Absolute-Paths-in-Tapestry-5-2-5-tp4300824p4305448.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: extending Select component
The weird behaviour is the following: eash subclass declaration in a tml-file results in 2 rendered fields in output - at first Tapestry renders subclass instance, which is correct, but after this it also renders the parent instance too, which is not needed. - Original Message - From: Thiago H. de Paula Figueiredo thiag...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Friday, April 15, 2011 2:54 PM Subject: Re: extending Select component On Fri, 15 Apr 2011 07:18:14 -0300, Keio Kraaner k.kraa...@gmail.com wrote: And what about the weird behaviour which results when rendering a child of a Tapestry component? Which weird behaviour? Any way, Tapestry-provided components are not meant to be subclassed. It is recommended to create mixins when possible. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: extending Select component
On Fri, 15 Apr 2011 10:38:10 -0300, Keio Kraaner k.kraa...@gmail.com wrote: The weird behaviour is the following: eash subclass declaration in a tml-file results in 2 rendered fields in output - at first Tapestry renders subclass instance, which is correct, but after this it also renders the parent instance too, which is not needed. Please post your component code and template. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Form for multiple entities
Hi, I have a table to entities that I get from my database, the number of entities can increase and decrease as these entities can be added or deleted. I want to be able to edit the entities in the table. The first column of every row has a check box to indicate whether that row should be updated when the submit button below the form is pressed. I understand how to create a form for a javabean or a form with a fixed number of input elements but how do I handle variable numbers of beans/input element. Many thanks. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Form-for-multiple-entities-tp4305672p4305672.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.2.5 Select component's multiple property
Hey Josh, Thanks for your reply. But when I use MultipleSelect, I got this error - An unexpected application exception has occurred. org.apache.tapestry5.ioc.internal.OperationException Unable to resolve 'MultipleSelect' to a component class name. availableValues Component types: ActionLink AddRowLink AjaxFormLoop Any BeanDisplay BeanEditForm BeanEditor Checkbox ChromeFrame DateField Delegate Error Errors EventLink ExceptionDisplay Form FormFragment FormInjector Grid GridCell GridColumns GridPager GridRows Hidden If Label Layout LinkSubmit Loop Output OutputRaw PageLink Palette PasswordField ProgressiveDisplay PropertyDisplay PropertyEditor Radio RadioGroup RemoveRowLink RenderObject Select Submit SubmitNotifier TextArea TextField TextOutput Trigger Unless Zone ... How do I install/get MultipleSelect component? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-2-5-Select-component-s-multiple-property-tp4304338p4305716.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
MailMessagePreparer - embedding images (howardlewisship.tapx)
Hi, We're using MailMessagePreparer to add a RenderedStream to javax.mail.Message. It works great, our page is being appended to the Message no problem. However there are images in the page, and I need to get these embedded in the message. At the moment this is what we're doing (semi-pseudo code for brevity): TemplateRenderer renderer = templateAPI.createRenderer(SummaryEmailTemplate, en, default); RenderedStream renderedStream = renderer.render(); Message message = new MimeMessage(session); message.setFrom(); // ... add recipients etc ... MailMessagePreparer.prepareMessage(message, renderedStream); Transport.send(message); To add images I need to construct a multi-part message, where I add content to each MimeBodyPart (html to one part, images to the other). The prepareMessage() method only takes a Message as arg, not a MimeBodyPart, so I am not sure how to go about constructing my message using prepareMessage() to add the html part, distinct from the images part. Any advice on how to construct a multi-part message with images? Thanks Richard. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.2.5 Select component's multiple property
http://www.chenillekit.org/mvnrepo.html It's a third party component so you need to download it. On Apr 15, 2011 7:41 AM, TG tapestry...@hotmail.com wrote: Hey Josh, Thanks for your reply. But when I use MultipleSelect, I got this error - An unexpected application exception has occurred. org.apache.tapestry5.ioc.internal.OperationException Unable to resolve 'MultipleSelect' to a component class name. availableValues Component types: ActionLink AddRowLink AjaxFormLoop Any BeanDisplay BeanEditForm BeanEditor Checkbox ChromeFrame DateField Delegate Error Errors EventLink ExceptionDisplay Form FormFragment FormInjector Grid GridCell GridColumns GridPager GridRows Hidden If Label Layout LinkSubmit Loop Output OutputRaw PageLink Palette PasswordField ProgressiveDisplay PropertyDisplay PropertyEditor Radio RadioGroup RemoveRowLink RenderObject Select Submit SubmitNotifier TextArea TextField TextOutput Trigger Unless Zone ... How do I install/get MultipleSelect component? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-2-5-Select-component-s-multiple-property-tp4304338p4305716.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Absolute Paths in Tapestry 5.2.5
Just tried that - AJAX works for me as well. Here's what I did: 1. Create app with archetype 2. Add form with input t:type=TextField t:id=text type=text t:mixins=autocomplete / 3. In AppModule create a handler class class AppModule { ... private static class ChangeContextPathnHttpServletRequestWrapper extends HttpServletRequestWrapper { private final String contextPath; public ChangeContextPathnHttpServletRequestWrapper(HttpServletRequest request, String contextPath) { super(request); this.contextPath = contextPath; } @Override public String getContextPath() { return contextPath; } } } 4. in AppModule contribute my handler: class AppModule { ... public void contributeHttpServletRequestHandler(OrderedConfigurationHttpServletRequestFilter configuration) { configuration.add(ManipulateContextPath, new HttpServletRequestFilter() { public boolean service(HttpServletRequest request, HttpServletResponse response, HttpServletRequestHandler handler) throws IOException { return handler.service(new ChangeContextPathnHttpServletRequestWrapper(request, ), response); } }); } } 5. Run app with context path (e.g. /demo) Request http://localhost:8080/demo/ == AJAX paths are rewritten: Tapestry.init({ activate : [ text ], autocompleter : [ { elementId : text, config : { indicator : text:loader, paramName : t:input }, menuId : text:menu, url : /index.text:autocomplete } ] }); -- Chris - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: extending Select component
Any way, Tapestry-provided components are not meant to be subclassed. It is recommended to create mixins when possible. Or use composition (not inheritance) - that's usually a good advice in OOP. -- Chris - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Form for multiple entities
I understand how to create a form for a javabean or a form with a fixed number of input elements but how do I handle variable numbers of beans/input element. Just surround the part of your form with a Loop component. Something like: t:form t:loop source=myBeanList value=currentBean t:textfield value=currentBean.myProperty / /t:loop t:submit / /t:form If you want to add rows via AJAX use AJAXFormLoop component. -- Chris - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.2.5 Select component's multiple property
You want ChenilleKit 1.3.2, 1.1.0 is for older version of Tapestry. On 04/15/2011 12:26 PM, TG wrote: I do not use maven2. But I downloaded chenillekit-tapestry-1.1.0.jar manually, installed, run again and I got a new error during bootup - Caused by: java.lang.ClassNotFoundException: org.apache.tapestry5.internal.services.RequestPathOptimizer Seems like RequestPathOptimizer is not part of Tapestry 5.2.5 anymore? What version of Tapestry do you use? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-2-5-Select-component-s-multiple-property-tp4304338p4305974.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.2.5 Select component's multiple property
Ok that helps. Installed 1.3.2 but how do I use it in the .tml file? What is the namespace I need to import? I asked as I still have the same not found error i.e. Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException: Unable to resolve 'MultipleSelect' to a component class name. [at classpath:tapp/.../...(truncated for simplicity).../pages/UserSave.tml, line 18] at org.apache.tapestry5.internal.pageload.PageLoaderImpl.startComponent(PageLoaderImpl.java:743) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.component(PageLoaderImpl.java:627) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.processTemplateToken(PageLoaderImpl.java:426) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.consumeToEndElementAndPopBodyElement(PageLoaderImpl.java:611) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.parameter(PageLoaderImpl.java:559) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.processTemplateToken(PageLoaderImpl.java:443) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.component(PageLoaderImpl.java:648) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.processTemplateToken(PageLoaderImpl.java:426) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.element(PageLoaderImpl.java:687) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.processTemplateToken(PageLoaderImpl.java:421) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.component(PageLoaderImpl.java:648) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.processTemplateToken(PageLoaderImpl.java:426) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.programAssembler(PageLoaderImpl.java:264) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.access$900(PageLoaderImpl.java:65) at org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:236) at org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:220) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65) ... 84 more Caused by: org.apache.tapestry5.ioc.util.UnknownValueException: Unable to resolve 'MultipleSelect' to a component class name. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-2-5-Select-component-s-multiple-property-tp4304338p4306041.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.2.5 Select component's multiple property
I believe you would do t:ck.MultipleSelect ... / It's just like any custom component you might make that has a package beyond *.components, you write out the extra packages in front of the component class name to qualify it. I checked my code and I guess I also do it a different way: input t:type=MultipleSelect t:id=mselect value=pageList model=pageListModel encoder=pageListModel/ @Property @Persist private GenericMultipleSelectModelMenuLink pageListModel; @Component private MultipleSelect mselect; @Property @Persist private ListMenuLink pageList; On 04/15/2011 12:52 PM, TG wrote: Ok that helps. Installed 1.3.2 but how do I use it in the .tml file? What is the namespace I need to import? I asked as I still have the same not found error i.e. Caused by: org.apache.tapestry5.ioc.internal.util.TapestryException: Unable to resolve 'MultipleSelect' to a component class name. [at classpath:tapp/.../...(truncated for simplicity).../pages/UserSave.tml, line 18] at org.apache.tapestry5.internal.pageload.PageLoaderImpl.startComponent(PageLoaderImpl.java:743) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.component(PageLoaderImpl.java:627) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.processTemplateToken(PageLoaderImpl.java:426) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.consumeToEndElementAndPopBodyElement(PageLoaderImpl.java:611) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.parameter(PageLoaderImpl.java:559) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.processTemplateToken(PageLoaderImpl.java:443) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.component(PageLoaderImpl.java:648) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.processTemplateToken(PageLoaderImpl.java:426) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.element(PageLoaderImpl.java:687) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.processTemplateToken(PageLoaderImpl.java:421) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.component(PageLoaderImpl.java:648) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.processTemplateToken(PageLoaderImpl.java:426) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.programAssembler(PageLoaderImpl.java:264) at org.apache.tapestry5.internal.pageload.PageLoaderImpl.access$900(PageLoaderImpl.java:65) at org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:236) at org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:220) at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65) ... 84 more Caused by: org.apache.tapestry5.ioc.util.UnknownValueException: Unable to resolve 'MultipleSelect' to a component class name. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-2-5-Select-component-s-multiple-property-tp4304338p4306041.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: MailMessagePreparer - embedding images (howardlewisship.tapx)
On Fri, Apr 15, 2011 at 8:36 AM, Richard Hill r...@su3analytics.com wrote: Ok got it sorted. The solution is very simple, in your template you just do: img src=${asset:image.jpg} It's funny ... the client I wrote this code for didn't actually want the multi-part message portion; I wrote it thinking they did, THEN they clarified their system, which relies on a content delivery network. Glad it was of use! and MailMessagePreparer automatically constructs a multi-part message. V useful! On Fri, 2011-04-15 at 15:48 +0100, Richard Hill wrote: Hi, We're using MailMessagePreparer to add a RenderedStream to javax.mail.Message. It works great, our page is being appended to the Message no problem. However there are images in the page, and I need to get these embedded in the message. At the moment this is what we're doing (semi-pseudo code for brevity): TemplateRenderer renderer = templateAPI.createRenderer(SummaryEmailTemplate, en, default); RenderedStream renderedStream = renderer.render(); Message message = new MimeMessage(session); message.setFrom(); // ... add recipients etc ... MailMessagePreparer.prepareMessage(message, renderedStream); Transport.send(message); To add images I need to construct a multi-part message, where I add content to each MimeBodyPart (html to one part, images to the other). The prepareMessage() method only takes a Message as arg, not a MimeBodyPart, so I am not sure how to go about constructing my message using prepareMessage() to add the html part, distinct from the images part. Any advice on how to construct a multi-part message with images? Thanks Richard. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.2.5 Select component's multiple property
You are talking to a person who is new to tapestry :) So I need exact example. So my question is what should the namespace be like following? html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; ??? I code like this and it does not work - t:parameter name=userRole label t:type=Label for=userRole/ input t:type=ck.MultipleSelect t:id=userRole t:value=user.userRoles t:multiple=true/ * select more than once for multiple roles /t:parameter Thanks for all Tapestry's guru's reply so far. I am impressed with the support I got from this forum. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-2-5-Select-component-s-multiple-property-tp4304338p4306266.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.2.5 Select component's multiple property
Hi you can specify a third party component either like t:libraryPrefix.somecomponent / or suitableTagName t:type='libraryPrefix/someComponent'/ suitableTagName will be select for select component, input for input components etc As MultipleSelect is a select component, you might right it like select t:type='ck/MultipleSelect' ... / or t:ck.MultipleSelect .../ regards Taha On Fri, Apr 15, 2011 at 11:49 PM, TG tapestry...@hotmail.com wrote: You are talking to a person who is new to tapestry :) So I need exact example. So my question is what should the namespace be like following? html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; ??? I code like this and it does not work - t:parameter name=userRole label t:type=Label for=userRole/ input t:type=ck.MultipleSelect t:id=userRole t:value=user.userRoles t:multiple=true/ * select more than once for multiple roles /t:parameter Thanks for all Tapestry's guru's reply so far. I am impressed with the support I got from this forum. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-2-5-Select-component-s-multiple-property-tp4304338p4306266.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.2.5 Select component's multiple property
I change . to / in t:type i.e. t:parameter name=userRole label t:type=Label for=userRole/ input t:type=ck/MultipleSelect t:id=userRole t:value=user.userRoles t:model=userRolesModel t:multiple=true/ * select more than once for multiple roles /t:parameter and I got another error - Caused by: org.apache.tapestry5.ioc.util.UnknownValueException: Could not find a coercion from type org.apache.tapestry5.internal.services.TypeCoercedValueEncoderFactory$1 to type org.chenillekit.tapestry.core.encoders.MultipleValueEncoder. I have to add the model, otherwise I will encounter the following error - Parameter(s) 'model' are required for org.chenillekit.tapestry.core.components.MultipleSelect, but have not been bound. Any idea? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-2-5-Select-component-s-multiple-property-tp4304338p4306851.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.2.5 Select component's multiple property
Add parameter t:encoder='encoder' t:model='encoder' and in you class file this method @Inject private PropertyAccess propertyAccess; public GenericMultipleSelectModel getEncoder(){ return new GenericMultipleSelectModel(selectables, YourObject.class, labelPropertyName, valuePropertyName, propertyAccess); } regards Taha On Sat, Apr 16, 2011 at 7:11 AM, TG tapestry...@hotmail.com wrote: I change . to / in t:type i.e. t:parameter name=userRole label t:type=Label for=userRole/ input t:type=ck/MultipleSelect t:id=userRole t:value=user.userRoles t:model=userRolesModel t:multiple=true/ * select more than once for multiple roles /t:parameter and I got another error - Caused by: org.apache.tapestry5.ioc.util.UnknownValueException: Could not find a coercion from type org.apache.tapestry5.internal.services.TypeCoercedValueEncoderFactory$1 to type org.chenillekit.tapestry.core.encoders.MultipleValueEncoder. I have to add the model, otherwise I will encounter the following error - Parameter(s) 'model' are required for org.chenillekit.tapestry.core.components.MultipleSelect, but have not been bound. Any idea? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-2-5-Select-component-s-multiple-property-tp4304338p4306851.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.2.5 Select component's multiple property
I changed as suggested but can't move beyond compilation errors - GenericMultipleSelectModel is not in 1.3.2 anymore and what exactly are selectables, YourObject.class, labelPropertyName, valuePropertyName? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-2-5-Select-component-s-multiple-property-tp4304338p4306859.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.2.5 Select component's multiple property
In 1.3.2 you will need to implement the interface public interface MultipleValueEncoderV { String toClient(V value); ListV toValue(String[] clientValue); } for the encoder regards Taha On Sat, Apr 16, 2011 at 7:29 AM, TG tapestry...@hotmail.com wrote: I changed as suggested but can't move beyond compilation errors - GenericMultipleSelectModel is not in 1.3.2 anymore and what exactly are selectables, YourObject.class, labelPropertyName, valuePropertyName? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-5-2-5-Select-component-s-multiple-property-tp4304338p4306859.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org