Re: Problem wuth internacionalization
It depends on how your Module is named. If you name it PACKAGE.services.StartModule then it's Start.properties (Start_LOCALE.properties). The archetype creates an AppModule.java file, so the right name is App.properties. Beginning from 5.0.6 - I suspect - you further have to put your templates into the webapp root or into your classpath. Igoor schrieb: when i make files Start.properties and Start_de.properties and put them into WEB-INF, or when i make com.igor.bookStore.pages and put these files into this root my application doesen't work... But when I make files app.properties and app_de.properties into WEB-INF whit same content like Start.properties and Start_de.properties my application work. What i need to do in order to make my application work with Start.properties and Start_de.properties - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T4 tapestry.form.submitAsync delayed?
I've noticed from watching client side and server side logs that when tapestry.form.submitAsync is called, it seems to go into a form of stack, and is the request is only eventually made once a previous async submit has responded. I'm fairly sure of this because I had a js function setting a timestamp on a form field and submitting the form async, then logging the value of the timestamp on the server. The server was getting the same timestamp over and over again, however the value at the time of calling tapestry.form.submitAsync was different. My question is, is there any way of controlling this stack and cancelling previous yet un-requested submits? p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem wuth internacionalization
People thanks a lot :))) I solved a problem: dhning-2 wrote: Hi, What's your tapestry version? If is the latest version, you should not put the start.tml, start.properties in WEB-INF. They should be in parent level of WEB-INF(src/main/webapp/) or in /src/main/resources/com/igno/bookStore/pages/. And for app.properties, it should be always in WEB-INF. Thanks! DH 2008/5/13, Igoor [EMAIL PROTECTED]: when i make files Start.properties and Start_de.properties and put them into WEB-INF, or when i make com.igor.bookStore.pages and put these files into this root my application doesen't work... But when I make files app.properties and app_de.properties into WEB-INF whit same content like Start.properties and Start_de.properties my application work. What i need to do in order to make my application work with Start.properties and Start_de.properties -- View this message in context: http://www.nabble.com/Problem-wuth-internacionalization-tp17190006p17190006.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Problem-wuth-internacionalization-tp17190006p17204484.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: Calling method with parameter in prop
This should be done with care though IMO. To me, one big advantage of T5 over JSP's with EL or OGNL is that you are forced to keep the logic out of the templates for the most part. Simple comparisons and single parameter accessors seem okay, but I've always been surprised when seeing people on the list want full OGNL functionality. Maybe I've had too many issues with overcomplicated JSP's that have subsequently been broken by designers over the years to want to the temptation any more... lol. -Original Message- From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] Sent: 12 May 2008 21:59 To: Tapestry users Subject: Re: T5: Calling method with parameter in prop Mor expression language would be great; the pain is when you pull values out of a Map or Collection and lose their type, at which point you also lose annotations and components such as BeanEditor and Grid no longer operate as expected. But I agree that having a few boolean operators in the expression language would be great: eq, lt, gt, gteq, lteq, etc. On Mon, May 12, 2008 at 2:26 AM, Andreas Pardeike [EMAIL PROTECTED] wrote: Hi, Don't know what you folks do, but I have created a bunch of custom bindings for different cases. The only thing I actually miss is the ability to COMBINE them. I.e., I have added a binding equals:foo=bar where foo and bar can be other binding objects or literals. I use it successfully for switch/case situations like in t:if test=equals:foo='abc'/t:if t:if test=equals:foo='def'/t:if .. t:if test=equals:foo='xyz'/t:if without the need to write a lot of getters. Now, I also have map:foo.bar where foo is suppose to be a HashMap and it will call foo.get(bar). As a result, all I want is the ability to have a way to specify foo and bar with the same binding prefix as in the beginning. For example, if I have a object that has a getter that returns a hashmap, I would love to write -- map:(prop:obj.foo).bar -- which would call obj.getFoo().get('bar') If I could get this working (I don't care about the syntax), I would be able to fulfill all my need by writing (and maybe contributing) a few custom bindings. On 9 maj 2008, at 18.31, Sven Homburg wrote: we will see what can we do 2008/5/9 Howard Lewis Ship [EMAIL PROTECTED]: Nope; I just want to let you create Insanely Great things, using T5 as the base. On Fri, May 9, 2008 at 9:10 AM, Sven Homburg [EMAIL PROTECTED] wrote: howard, you make us jobless ;-) 2008/5/9 Howard Lewis Ship [EMAIL PROTECTED]: In 5.1 I want to extend the Tapestry property expression language quite a bit further to address this (invoking methods), as well as map and array ceation ... basically, all the cool OGNL stuff people miss. On Fri, May 9, 2008 at 7:52 AM, kranga [EMAIL PROTECTED] wrote: In looking at converting from T3 to T5, I've to deal with constructs such as: class=ognl:menuClassName('home') where getMenuClassName uses the parameter to compare with the page's id passed in to determine if this is the currentPage or not. So the template has multiple links with constructs such as: class=ognl:menuClassName('about') class=ognl:menuClassName('contact') etc. How do I do this in T5 given that prop bindings to methods cannot accept arguments? I'm sure there is a workaround, I just can't seem to find one. Howard M. Lewis Ship Sven Homburg Howard M. Lewis Ship Sven Homburg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Access to ServletContext
public static void contributeSchedulerFactory(@InjectService(ApplicationGlobals)ApplicationGlobals applicationGlobals, MappedConfigurationString, String configuration) { String configPath = applicationGlobals.getServletContext().getRealPath(/WEB-INF/conf); configuration.add(quartz.properties, configPath + /quartz.properties); } 2008/5/13 Peter Stavrinides [EMAIL PROTECTED]: Hi everyone, How can I get access to the ServletContext, (Not Context), is it possible through T5 IoC? Thanks Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- with regards Sven Homburg http://tapestry5-components.googlecode.com
T5 + DWR integration
How easy is it to integrate T5 with DWR? Are there examples of how to do this? How do I need to configure the dwr.xml file? Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Access to ServletContext
Thanks Sven !! - Original Message - From: Sven Homburg [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 12:43:40 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: Access to ServletContext public static void contributeSchedulerFactory(@InjectService(ApplicationGlobals)ApplicationGlobals applicationGlobals, MappedConfigurationString, String configuration) { String configPath = applicationGlobals.getServletContext().getRealPath(/WEB-INF/conf); configuration.add(quartz.properties, configPath + /quartz.properties); } 2008/5/13 Peter Stavrinides [EMAIL PROTECTED]: Hi everyone, How can I get access to the ServletContext, (Not Context), is it possible through T5 IoC? Thanks Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- with regards Sven Homburg http://tapestry5-components.googlecode.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What happened to Tapestry 5 Layout component blog article
This blog seems to have vanished: http://courcy-en.blogspot.com/2008/01/tapestry-5-create-layout-component.html As linked to from the wiki. Anyone know what's happened or have an archive of this? I found it very useful. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T4 tapestry.form.submitAsync delayed?
Take a look at http://svn.apache.org/repos/asf/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry-4.1.5/core.js tapestry.bind uses dojo.io.queueBind(parms) which should explain what you're seeing so, it seems that you just need to replace queueBind with your custom version On Tue, May 13, 2008 at 10:14 AM, Paul Stanton [EMAIL PROTECTED] wrote: I've noticed from watching client side and server side logs that when tapestry.form.submitAsync is called, it seems to go into a form of stack, and is the request is only eventually made once a previous async submit has responded. I'm fairly sure of this because I had a js function setting a timestamp on a form field and submitting the form async, then logging the value of the timestamp on the server. The server was getting the same timestamp over and over again, however the value at the time of calling tapestry.form.submitAsync was different. My question is, is there any way of controlling this stack and cancelling previous yet un-requested submits? p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem in defining dojo.registerModulePath
Try enabling friendly urls for assets contribution configuration-id=tapestry.url.ServiceEncoders asset-encoder id=asset path=/assets/ /contribution On Tue, May 13, 2008 at 8:23 AM, abhilash [EMAIL PROTECTED] wrote: Hi all, I am using Tapestry4.1.5 I have a custom widget.When i try to access my custom widget the javascript errors i am getting are as follows. GET http://localhost:8080/dentaprise/asset.svc?path=%2Fdojo-0.4.3-custom-4.1.5%2F../mywidgets/widget/__package__.js404 (23ms)asset.svc (line 766) GET http://localhost:8080/dentaprise/asset.svc?path=%2Fdojo-0.4.3-custom-4.1.5%2F../mywidgets/__package__.js404 (14ms)asset.svc (line 766) GET http://localhost:8080/dentaprise/asset.svc?path=%2Fdojo-0.4.3-custom-4.1.5%2F__package__.js404 (14ms)asset.svc (line 766) symbol 'mywidgets.widget' is not defined after loading '__package__.js' what i understood from these errors is dojo is failing to locate my mywidgets module.I tried giving paths using dojo.registerModulePath but its throwing same exceptions. any ideas? Thanks in advance. -- View this message in context: http://www.nabble.com/problem-in-defining-dojo.registerModulePath-tp17201314p17201314.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 Blank option for select component
Hi Toby, the correct attribute is t:blankLabel, not t:blankValue. And I recommend you use a message from a message catalog, except a literal String. Regards nillehammer - original Nachricht Betreff: T5 Blank option for select component Gesendet: Mo, 12. Mai 2008 Von: Toby Hobson[EMAIL PROTECTED] I am trying to display list of enums in my select component and this works well, but i would like to add a blank option and validate that the field has been selected by a user (i.e. not the blank option). Reading through the docs is seems T5 should support this but I can't seem to get it to display the blank option. Have I missed something Here is my tml: select t:type=select t:blankOption=always t:blankValue=please select ... t:validate=required t:value=user.sex name=select id=select class=textbox_edit option/option /select Toby --- original Nachricht Ende - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ANN] equanda 0.9 released
adasal wrote: Joachim what are your thoughts on OWL export of the object model? Where would that be used? The main use for me is for documentation purposes. It is very practical to take the owl model, import that into protégé and use the Jambalaya plugin to create a graphical representation of the entities and the links between them. While I had hoped this would also be possible by experting the model in UML (using the xmi format), it seems this does not allow storing a graphical representation (at least not in the tools I looked at). I have to admit I am interested in something else, but have made no progress, that of the possible use of Tapestry with OWL. Henry Story has the story (excuse the pun). https://sommer.dev.java.net/sommer.html It seems to me that if you have implemented the export of the object model into OWL that is a step away from consuming OWL within Tapestry perhaps by creating a pipeline? To a large extent, you could also do the reverse mapping, converting owl into a equanda domain model and this can then be used to build the persistence layer and user interface. The difference being that owl is more generic in (data) modelling capabilities but the domain model has specific features to add annotations about constraints and hints for the user interface. Might this have some benefit? Henry Story discuses ActiveRDF extension to Ruby where using RDF seems as natural as importing a package. I think it would have benefits. Display data according to inferred type and so on. What do you think? In the equanda context, you have to keep in mind that it uses code generation, and thus a compilation step is necessary to move from model (be it owl or equanda's own representation) to a running program. At first guess this seems to be a constraint. Apart from that, I think I need a better understanding of what you want to achieve to give proper feedback. Kind regards, Joachim -- Joachim Van der Auwera PROGS bvba, progs.be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 + DWR integration
Hi That's an interesting topic. Actually we had discussed it once with Igor, and it seems that it shouldn't be too hard. The question is which objects from the server-side you want to access from DWR? If you will answer this question then you can just start a DWR servlet in your web application and try to get the objects of interest. Renat 2008/5/13 Leon Derks [EMAIL PROTECTED]: How easy is it to integrate T5 with DWR? Are there examples of how to do this? How do I need to configure the dwr.xml file? Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Best regards, Renat Zubairov
What ist the advantage of ActionLink compared to EventLink
Hi all, using an ActionLink one has to assign an id. By this id the event hander is determined. So far so easy. But having assigned an id, a particular ActionLink can only be used once per template. With EventLink one can assign an event attribute and can put several links into a template pointing to the same event handler. I myself have replaced every ActionLink with an EventLink. I am wondering what ActionLink might be good for. Where is it needed to achieve something you cannot do with EventLink? Please could someone with a deeper knowledge of Tapestry explain that to me. Thanks in advance and kind regards, nillehammer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Questions about Textarea and submit button
I make the component called button which is different compare with submit component. The questions I have now is. how can I get the value from textarea without a submit button. t:textArea t:value=task t:id=editplace / -- I put the value = task And in the page class, i put public void setTask(String task) { this.task = task; System.out.println(This is setting tasks: + task); //tasks.add(this.task); } public String getTask() { this.task = more event here; System.out.println(This is the getting task: +this.task); return this.task; } But somehow, there are not working, because I use my custom button component. Any suggesstions I can get the values from textarea , or make setter and getter working?? Thanks a lot -- View this message in context: http://www.nabble.com/Questions-about-Textarea-and-submit-button-tp17206414p17206414.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can struts 1 and tapestry 5 play together nicely?
We are about to add a new section to an existing struts1 application and I was hoping that I could implement the new section using tapestry 5 with a view to migrating some of the existing pages to tapestry 5 in the future. The existing application has a couple of servlets for generating images (graphs etc) and references jsp's, stylesheets and images etc from a war. So... a couple of questions: 1. Is this going to be possible? 2. Will I need to tell tapestry to ignore the existing servlets? (*.do, etc.) 3. Any issues with linking from struts pages to tapestry pages? 4. Any other issues you can think of with doing this? Thanks, Lance.
T5 : Is it possible to put a zone inside another zone ?
Hi, I have a template wich look like this one : ... t:grid source=clients row=client t:parameter name=nameCell t:actionlink t:id=clientLink context=client.id zone=clientZone${client.name}/t:actionlink /t:parameter /t:grid t:zone t:id=clientZone/ t:block t:id=clientBlock t:grid source=selectedClient.mailingsList row=mailing t:parameter name=titleCell t:actionlink t:id=mailingLink context=mailing.id zone=mailingZone${mailing.title}/t:actionlink /t:parameter /t:grid t:zone t:id=mailingZone/ /t:block t:block t:id=mailingBlock t:beandisplay object=selectedMailing/ /t:block ... and the associated code : public class Clients { @Inject@Service(mailingServices) private IMailingServices mailingServices; @Inject private Block clientBlock; @Inject private Block mailingBlock; @Property private Client client; @Property private Mailing mailing; @Property @Persist private Client selectedClient; @Property @Persist private Mailing selectedMailing; @OnEvent(component=clientLink, value=action) private Block actionFromClientLink(Long id) { selectedClient = mailingServices.loadClient(id); return clientBlock; } @OnEvent(component=mailingLink, value=action) private Block actionFromMailingLink(Long id) { selectedMailing = mailingServices.loadMailing(id); return mailingBlock; } } and i get the exception : [ERROR] RequestExceptionHandler Processing of request failed with uncaught exception: A component event handler method returned the value [EMAIL PROTECTED] Return type org.apache.tapestry.internal.structure.BlockImpl can not be handled. Configured return types are java.lang.Class, java.lang.String, java.net.URL, org.apache.tapestry.Link, org.apache.tapestry.StreamResponse, org.apache.tapestry.runtime.Component. org.apache.tapestry.runtime.ComponentEventException: A component event handler method returned the value [EMAIL PROTECTED] Return type org.apache.tapestry.internal.structure.BlockImpl can not be handled. Configured return types are java.lang.Class, java.lang.String, java.net.URL, org.apache.tapestry.Link, org.apache.tapestry.StreamResponse, org.apache.tapestry.runtime.Component. [at classpath:com/cariboonetworks/mailings/pages/Clients.tml, line 32, column 79] at org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1041) at org.apache.tapestry.internal.services.ComponentEventRequestHandlerImpl.handle(ComponentEventRequestHandlerImpl.java:67) at org.apache.tapestry.internal.services.ImmediateActionRenderResponseFilter.handle(ImmediateActionRenderResponseFilter.java:42) at $ComponentEventRequestHandler_119e2541c7f.handle($ComponentEventRequestHandler_119e2541c7f.java) at org.apache.tapestry.internal.services.AjaxFilter.handle(AjaxFilter.java:42) at $ComponentEventRequestHandler_119e2541c7f.handle($ComponentEventRequestHandler_119e2541c7f.java) at org.apache.tapestry.services.TapestryModule$37.handle(TapestryModule.java:1988) at $ComponentEventRequestHandler_119e2541c7f.handle($ComponentEventRequestHandler_119e2541c7f.java) at $ComponentEventRequestHandler_119e2541bea.handle($ComponentEventRequestHandler_119e2541bea.java) at org.apache.tapestry.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:135) at $Dispatcher_119e2541bed.dispatch($Dispatcher_119e2541bed.java) at $Dispatcher_119e2541bdf.dispatch($Dispatcher_119e2541bdf.java) at org.apache.tapestry.services.TapestryModule$12.service(TapestryModule.java:939) at org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:42) at $RequestHandler_119e2541be0.service($RequestHandler_119e2541be0.java) at org.apache.tapestry.services.TapestryModule$2.service(TapestryModule.java:588) at $RequestHandler_119e2541be0.service($RequestHandler_119e2541be0.java) at org.apache.tapestry.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:25) at $RequestHandler_119e2541be0.service($RequestHandler_119e2541be0.java) at org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79) at $RequestHandler_119e2541be0.service($RequestHandler_119e2541be0.java) at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93) at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84) at org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:75) at org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106) at $RequestHandler_119e2541be0.service($RequestHandler_119e2541be0.java) at $RequestHandler_119e2541bd8.service($RequestHandler_119e2541bd8.java) at
Mixin render phases
Hi guys, I'm trying to show/hide an html element based on Robert's recent suggestion (Re: how do we secure our views) but I've hit a minor problem. The mixin's @BeforeRender method is being called but then tapestry complains that the component (textArea) is unbalanced. I'm using the component and mixin in a custom component, not a page. Here is the code The mixin: public class Visible { @Parameter(required=true) private boolean visible; @BeginRender boolean render() { return visible; } } The custom component: @Component(id=reason, parameters={value=violation.message, visible=true}) @Mixins(visible) private TextArea reason; The custom component's tml t:form t:textArea t:id=reason / input type=submit / /t:form When the component renders I get the following exception: Render queue error in CleanupRender[TestViolations:violations.reason]:Component TestViolations:violations.reason has rendered unbalancedelements; either it has started an element with MarkupWriter.element()and not followed up with MarkupWriter.end(), or it has invokedMarkupWriter.end() without first invoking MarkupWriter.element(). TestViolations is the page which includes the custom component, Violations is the custom component Does anyone have any ideas? Thanks Toby
RE: Mixin render phases
hi toby, i think i had the same issue some time ago i was also trying to create a mixin for enabled/disabled handling by short circuiting the render phases. but the render phases (or at least the short circuiting) do not work as i was expecting :). maybe you can take a look at the problem description (it think there are a lot of details in the comments) of the jira at https://issues.apache.org/jira/browse/TAPESTRY-1805 and comment on it. g, kirs Toby Hobson [EMAIL PROTECTED] 13.05.2008 15:24 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema Mixin render phases Hi guys, I'm trying to show/hide an html element based on Robert's recent suggestion (Re: how do we secure our views) but I've hit a minor problem. The mixin's @BeforeRender method is being called but then tapestry complains that the component (textArea) is unbalanced. I'm using the component and mixin in a custom component, not a page. Here is the code The mixin: public class Visible { @Parameter(required=true) private boolean visible; @BeginRender boolean render() { return visible; } } The custom component: @Component(id=reason, parameters={value=violation.message, visible=true}) @Mixins(visible) private TextArea reason; The custom component's tml t:form t:textArea t:id=reason / input type=submit / /t:form When the component renders I get the following exception: Render queue error in CleanupRender[TestViolations:violations.reason]:Component TestViolations:violations.reason has rendered unbalancedelements; either it has started an element with MarkupWriter.element()and not followed up with MarkupWriter.end(), or it has invokedMarkupWriter.end() without first invoking MarkupWriter.element(). TestViolations is the page which includes the custom component, Violations is the custom component Does anyone have any ideas? Thanks Toby
T5: ASO in HttpServletRequestFilter
Version: 5.0.11 It appears that if you inject an application state manager into an HttpServletRequestFilter and try to access an ASO, you get a null pointer exception since the Tapestry Request object has still not been set up. This means that if you do need to access an ASO, you are forced to use the session directly (and hence the session from within your pages too). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: ASO in HttpServletRequestFilter
Obvious: Because you can't access the HttpServletRequest from within the RequestFilter to access methods such as getRequestUri() (needed by 3rd party library being called in the filter). If I didn't have access to the ASO manager, then I could write up the filter as a traditional Servlet filter. Why bother with the Tapestry filter chain in the first place? Or do I need to configure my servletRequestFilter to be after some other filter? If so, where do I find the list of these after before definitions? - Original Message - From: Robert Zeigler [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, May 13, 2008 10:43 AM Subject: Re: T5: ASO in HttpServletRequestFilter Why not use a RequestFilter, instead? You can access the ApplicationStateManager from withing a RequestFilter. Robert On May 13, 2008, at 5/139:41 AM , kranga wrote: Version: 5.0.11 It appears that if you inject an application state manager into an HttpServletRequestFilter and try to access an ASO, you get a null pointer exception since the Tapestry Request object has still not been set up. This means that if you do need to access an ASO, you are forced to use the session directly (and hence the session from within your pages too). - 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]
Re: T5: ASO in HttpServletRequestFilter
the RequestGlobals service can return the HttpServletRequest and HttpServletResponse objects (getters) ... therefore you could implement RequestFilter as well :) g, kris kranga [EMAIL PROTECTED] 13.05.2008 16:51 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: T5: ASO in HttpServletRequestFilter Obvious: Because you can't access the HttpServletRequest from within the RequestFilter to access methods such as getRequestUri() (needed by 3rd party library being called in the filter). If I didn't have access to the ASO manager, then I could write up the filter as a traditional Servlet filter. Why bother with the Tapestry filter chain in the first place? Or do I need to configure my servletRequestFilter to be after some other filter? If so, where do I find the list of these after before definitions? - Original Message - From: Robert Zeigler [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, May 13, 2008 10:43 AM Subject: Re: T5: ASO in HttpServletRequestFilter Why not use a RequestFilter, instead? You can access the ApplicationStateManager from withing a RequestFilter. Robert On May 13, 2008, at 5/139:41 AM , kranga wrote: Version: 5.0.11 It appears that if you inject an application state manager into an HttpServletRequestFilter and try to access an ASO, you get a null pointer exception since the Tapestry Request object has still not been set up. This means that if you do need to access an ASO, you are forced to use the session directly (and hence the session from within your pages too). - 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]
Re: update select based on first select
Leon, I can't tell from that code where/how you've used the OnEvent mixin. I see the @OnEvent annotation, but that's unrelated (as you probably realize). This exact use case was discussed recently - see: http://markmail.org/search/?q=ajax-based+data+retrieval+list%3Aorg.apache.tapestry.users#query:ajax-based%20data%20retrieval%20list%3Aorg.apache.tapestry.users+page:1+mid:5srufbsi5jsrdmu2+state:results chris Leon Derks wrote: I want to update a select, based on a value from another select. I have tried the OnEvent mixin from the t5components, but only the first selected value is printed to the screen. When I select another value after that, it always prints the first selected value. How can I do this with Tapestry 5 at the moment? Here is a part of the java page code: @OnEvent(component = productSelect, value = change) Object onProductSelectChanged(String value) { System.out.println(Value: + value); return null; } Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- http://thegodcode.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can struts 1 and tapestry 5 play together nicely?
I'm actually done this (albeit using Spring MVC but similar issues apply). In general it's pretty easy - the new activation context makes it much easier to point to tapestry pages from a non-tapestry base (or indeed a bookmark). For example you can now call http://www.domain.com/app/showProduct/1 which will call the show product page and pass in a parameter of 1. One thing you can't easily do is link from non-tapestry code to tapestry event handlers on a page (particularly if you have nested components). For example you may have a page called ListUsers with an addUser() method on it. It's a bit tricky to link to the event handler as you could in an action oriented framework - you can't simply call ListUsers?addUser as you could in with a struts Dispatch Action. However there are ways to work around this and in practice it's not been a problem for me. One thing to watch is the non-tapestry urls you may use in your pages(e.g. a reference to the servlet which generates the images). You needto ensure that these urls are absolute and include the context root.Otherwise you'll get type coercion errors. This is pretty simple toachieve by Injecting the Tapestry request into your page or component. As for telling tapestry to ignore the servlets and actions - this shouldn't be a problem because the tapestry filter will simply ignore requests that it doesn't understand - I have a servlet which generates the dynamic images and tapestry happily ignores and requests made to it. Anyway, like I said I've done this recently and it's been pretty painless - I'd be happy to share my experiences with you Toby - Original Message From: Lance Java [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 12:47:32 PM Subject: Can struts 1 and tapestry 5 play together nicely? We are about to add a new section to an existing struts1 application and I was hoping that I could implement the new section using tapestry 5 with a view to migrating some of the existing pages to tapestry 5 in the future. The existing application has a couple of servlets for generating images (graphs etc) and references jsp's, stylesheets and images etc from a war. So... a couple of questions: 1. Is this going to be possible? 2. Will I need to tell tapestry to ignore the existing servlets? (*.do, etc.) 3. Any issues with linking from struts pages to tapestry pages? 4. Any other issues you can think of with doing this? Thanks, Lance.
Re: T5: ASO in HttpServletRequestFilter
Why not use a RequestFilter, instead? You can access the ApplicationStateManager from withing a RequestFilter. Robert On May 13, 2008, at 5/139:41 AM , kranga wrote: Version: 5.0.11 It appears that if you inject an application state manager into an HttpServletRequestFilter and try to access an ASO, you get a null pointer exception since the Tapestry Request object has still not been set up. This means that if you do need to access an ASO, you are forced to use the session directly (and hence the session from within your pages too). - 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 + DWR integration
I don't have that topic. Is it easy to integrate DWR with tapestry, without Spring? Leon Renat Zubairov wrote: Hi That's an interesting topic. Actually we had discussed it once with Igor, and it seems that it shouldn't be too hard. The question is which objects from the server-side you want to access from DWR? If you will answer this question then you can just start a DWR servlet in your web application and try to get the objects of interest. Renat 2008/5/13 Leon Derks [EMAIL PROTECTED]: How easy is it to integrate T5 with DWR? Are there examples of how to do this? How do I need to configure the dwr.xml file? Leon - 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]
update select based on first select
I want to update a select, based on a value from another select. I have tried the OnEvent mixin from the t5components, but only the first selected value is printed to the screen. When I select another value after that, it always prints the first selected value. How can I do this with Tapestry 5 at the moment? Here is a part of the java page code: @OnEvent(component = productSelect, value = change) Object onProductSelectChanged(String value) { System.out.println(Value: + value); return null; } Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: How do we secure our views?
mixins are the best fit for the job, but there are some pitfalls you have to be aware of when used with certain components (see https://issues.apache.org/jira/browse/TAPESTRY-1805) but there are other alternatives: 1) use a delegate and choose which representation of a page fragment is to be rendered 2) use Blocks as the BeanEditor does... . i wrote a component that uses a contribution of Blocks and a contribution of DisplayRules to determine how the properties of a bean are displayed (if at all). My DisplayRules return an enum with ENABLED, DISABLED or HIDDEN states that in turn are used to find a contributed block that matches the state and other criteria (other cirteria are page, beanType, propertyType and propertyName). This allows me to display the property of a bean as a select component or as a simple span if it cannot be edited anymore or hide it based on hierarchical rules. g, kris Robert Zeigler [EMAIL PROTECTED] Gesendet von: robert zeigler [EMAIL PROTECTED] 12.05.2008 16:07 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: T5: How do we secure our views? Basically any of the render-phase states can return false to short- circuit subsequent states (see: http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html for the full state diagram). So if you're looking for this sort of granularity for securing your view, one approach would be to write a mixin (see: http://tapestry.apache.org/tapestry5/tapestry-core/guide/mixins.html ) . So you might have something simple like: package com.example.app.mixins; //imports ... public class Secured { @parameter private boolean shouldRender; @BeginRender public boolean shouldRender() { return shouldRender; } } And then you would use it like: .tml: a href=# t:id=adminLinkAdmin/a .java @Component( ..., parameters={shouldRender=prop:conditionToEval,...}) private PageLink adminLink; Something along those lines. There are other possible variations, but this is going to most closely match up with your JSF experience. Robert On May 12, 2008, at 5/127:25 AM , Partogi, Joshua wrote: Dear all, Let me get this straight to the point. In JSF for each component there are a 'rendered' property which tells JSF whether to display the current component or not. But there isn't any property like this in T5. I do this usually to authorize user whether he/she are able to view the component. How do we secure our view in T5? Has anyone done this before? thanks in advance IMPORTANT NOTICE: The information in this email (and any attachments) is confidential. If you are not the intended recipient, you must not use or disseminate the information. If you have received this email in error, please immediately notify me by Reply command and permanently delete the original and any copies or printouts thereof. Although this email and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by American International Group, Inc. or its subsidiaries or affiliates either jointly or severally, for any loss or damage arising in any way from its use. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mixin render phases
So if I've read the JIRA correctly does this mean that simply implementing @BeginRender and @AfterRender in my mixin is not enough - I would actually have the modify the component (in this case textarea)? to check for short-circuiting? Toby - Original Message From: Kristian Marinkovic [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 3:03:49 PM Subject: RE: Mixin render phases hi toby, i think i had the same issue some time ago i was also trying to create a mixin for enabled/disabled handling by short circuiting the render phases. but the render phases (or at least the short circuiting) do not work as i was expecting :). maybe you can take a look at the problem description (it think there are a lot of details in the comments) of the jira at https://issues.apache.org/jira/browse/TAPESTRY-1805 and comment on it. g, kirs Toby Hobson [EMAIL PROTECTED] 13.05.2008 15:24 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema Mixin render phases Hi guys, I'm trying to show/hide an html element based on Robert's recent suggestion (Re: how do we secure our views) but I've hit a minor problem. The mixin's @BeforeRender method is being called but then tapestry complains that the component (textArea) is unbalanced. I'm using the component and mixin in a custom component, not a page. Here is the code The mixin: public class Visible { @Parameter(required=true) private boolean visible; @BeginRender boolean render() { return visible; } } The custom component: @Component(id=reason, parameters={value=violation.message, visible=true}) @Mixins(visible) private TextArea reason; The custom component's tml t:form t:textArea t:id=reason / input type=submit / /t:form When the component renders I get the following exception: Render queue error in CleanupRender[TestViolations:violations.reason]:Component TestViolations:violations.reason has rendered unbalancedelements; either it has started an element with MarkupWriter.element()and not followed up with MarkupWriter.end(), or it has invokedMarkupWriter.end() without first invoking MarkupWriter.element(). TestViolations is the page which includes the custom component, Violations is the custom component Does anyone have any ideas? Thanks Toby
Re: update select based on first select
your page class: @Property private ValueEnum _selectedItem; @Component(parameters = {model=testModel, value=selectedItem, event=change, onCompleteCallback=onSelectCompleteFunction}) @Mixins(value = t5components/OnEvent) private Select _selectField; public SelectModel getTestModel() { return new EnumSelectModel(ValueEnum.class, _messages); } @OnEvent(component = select, value = change) public void onChange(String value) { System.err.println(value) } your page template select t:id=selectField size=1 option value=1Value 1/option /select 2008/5/13 Leon Derks [EMAIL PROTECTED]: Hi Chris, Thanks for your answer, this is the other part: t:select t:id=productSelect value=productCategory blankLabel=${message:text-all} t:mixins=t5components/OnEvent event=change / The System.out.println(Value: + value) in my java code always prints the first selected value. After that always the first value is printed, no matter what value I select. What am I doing wrong? Leon Chris Lewis wrote: Leon, I can't tell from that code where/how you've used the OnEvent mixin. I see the @OnEvent annotation, but that's unrelated (as you probably realize). This exact use case was discussed recently - see: http://markmail.org/search/?q=ajax-based+data+retrieval+list%3Aorg.apache.tapestry.users#query:ajax-based%20data%20retrieval%20list%3Aorg.apache.tapestry.users+page:1+mid:5srufbsi5jsrdmu2+state:results chris Leon Derks wrote: I want to update a select, based on a value from another select. I have tried the OnEvent mixin from the t5components, but only the first selected value is printed to the screen. When I select another value after that, it always prints the first selected value. How can I do this with Tapestry 5 at the moment? Here is a part of the java page code: @OnEvent(component = productSelect, value = change) Object onProductSelectChanged(String value) { System.out.println(Value: + value); return null; } Leon - 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] -- with regards Sven Homburg http://tapestry5-components.googlecode.com
Re: Mixin render phases
Something else i've noticed ... if i modify my mixin to always return true during the @BeginRender phase I still get the exception! - Original Message From: Toby Hobson [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 4:52:33 PM Subject: Re: Mixin render phases So if I've read the JIRA correctly does this mean that simply implementing @BeginRender and @AfterRender in my mixin is not enough - I would actually have the modify the component (in this case textarea)? to check for short-circuiting? Toby - Original Message From: Kristian Marinkovic [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 3:03:49 PM Subject: RE: Mixin render phases hi toby, i think i had the same issue some time ago i was also trying to create a mixin for enabled/disabled handling by short circuiting the render phases. but the render phases (or at least the short circuiting) do not work as i was expecting :). maybe you can take a look at the problem description (it think there are a lot of details in the comments) of the jira at https://issues.apache.org/jira/browse/TAPESTRY-1805 and comment on it. g, kirs Toby Hobson [EMAIL PROTECTED] 13.05.2008 15:24 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema Mixin render phases Hi guys, I'm trying to show/hide an html element based on Robert's recent suggestion (Re: how do we secure our views) but I've hit a minor problem. The mixin's @BeforeRender method is being called but then tapestry complains that the component (textArea) is unbalanced. I'm using the component and mixin in a custom component, not a page. Here is the code The mixin: public class Visible { @Parameter(required=true) private boolean visible; @BeginRender boolean render() { return visible; } } The custom component: @Component(id=reason, parameters={value=violation.message, visible=true}) @Mixins(visible) private TextArea reason; The custom component's tml t:form t:textArea t:id=reason / input type=submit / /t:form When the component renders I get the following exception: Render queue error in CleanupRender[TestViolations:violations.reason]:Component TestViolations:violations.reason has rendered unbalancedelements; either it has started an element with MarkupWriter.element()and not followed up with MarkupWriter.end(), or it has invokedMarkupWriter.end() without first invoking MarkupWriter.element(). TestViolations is the page which includes the custom component, Violations is the custom component Does anyone have any ideas? Thanks Toby
Re: update select based on first select
sorry, one typo @OnEvent(component = *selectField*, value = change) public void onChange(String value) { System.err.println(value) } 2008/5/13 Sven Homburg [EMAIL PROTECTED]: your page class: @Property private ValueEnum _selectedItem; @Component(parameters = {model=testModel, value=selectedItem, event=change, onCompleteCallback=onSelectCompleteFunction}) @Mixins(value = t5components/OnEvent) private Select _selectField; public SelectModel getTestModel() { return new EnumSelectModel(ValueEnum.class, _messages); } @OnEvent(component = select, value = change) public void onChange(String value) { System.err.println(value) } your page template select t:id=selectField size=1 option value=1Value 1/option /select 2008/5/13 Leon Derks [EMAIL PROTECTED]: Hi Chris, Thanks for your answer, this is the other part: t:select t:id=productSelect value=productCategory blankLabel=${message:text-all} t:mixins=t5components/OnEvent event=change / The System.out.println(Value: + value) in my java code always prints the first selected value. After that always the first value is printed, no matter what value I select. What am I doing wrong? Leon Chris Lewis wrote: Leon, I can't tell from that code where/how you've used the OnEvent mixin. I see the @OnEvent annotation, but that's unrelated (as you probably realize). This exact use case was discussed recently - see: http://markmail.org/search/?q=ajax-based+data+retrieval+list%3Aorg.apache.tapestry.users#query:ajax-based%20data%20retrieval%20list%3Aorg.apache.tapestry.users+page:1+mid:5srufbsi5jsrdmu2+state:results chris Leon Derks wrote: I want to update a select, based on a value from another select. I have tried the OnEvent mixin from the t5components, but only the first selected value is printed to the screen. When I select another value after that, it always prints the first selected value. How can I do this with Tapestry 5 at the moment? Here is a part of the java page code: @OnEvent(component = productSelect, value = change) Object onProductSelectChanged(String value) { System.out.println(Value: + value); return null; } Leon - 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] -- with regards Sven Homburg http://tapestry5-components.googlecode.com -- with regards Sven Homburg http://tapestry5-components.googlecode.com
Re: Mixin render phases
Hi Toby, Try switching to @SetupRender. For /most/ things, doing: @SetupRender public boolean setup() { return false; } Is going to work. But check out the jira referenced by Kristian. Robert On May 13, 2008, at 5/1310:55 AM , Toby Hobson wrote: Something else i've noticed ... if i modify my mixin to always return true during the @BeginRender phase I still get the exception! - Original Message From: Toby Hobson [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 4:52:33 PM Subject: Re: Mixin render phases So if I've read the JIRA correctly does this mean that simply implementing @BeginRender and @AfterRender in my mixin is not enough - I would actually have the modify the component (in this case textarea)? to check for short-circuiting? Toby - Original Message From: Kristian Marinkovic [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 3:03:49 PM Subject: RE: Mixin render phases hi toby, i think i had the same issue some time ago i was also trying to create a mixin for enabled/disabled handling by short circuiting the render phases. but the render phases (or at least the short circuiting) do not work as i was expecting :). maybe you can take a look at the problem description (it think there are a lot of details in the comments) of the jira at https://issues.apache.org/jira/browse/TAPESTRY-1805 and comment on it. g, kirs Toby Hobson [EMAIL PROTECTED] 13.05.2008 15:24 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema Mixin render phases Hi guys, I'm trying to show/hide an html element based on Robert's recent suggestion (Re: how do we secure our views) but I've hit a minor problem. The mixin's @BeforeRender method is being called but then tapestry complains that the component (textArea) is unbalanced. I'm using the component and mixin in a custom component, not a page. Here is the code The mixin: public class Visible { @Parameter(required=true) private boolean visible; @BeginRender boolean render() { return visible; } } The custom component: @Component(id=reason, parameters={value=violation.message, visible=true}) @Mixins(visible) private TextArea reason; The custom component's tml t:form t:textArea t:id=reason / input type=submit / /t:form When the component renders I get the following exception: Render queue error in CleanupRender[TestViolations:violations.reason]:Component TestViolations:violations.reason has rendered unbalancedelements; either it has started an element with MarkupWriter.element()and not followed up with MarkupWriter.end(), or it has invokedMarkupWriter.end() without first invoking MarkupWriter.element(). TestViolations is the page which includes the custom component, Violations is the custom component Does anyone have any ideas? Thanks Toby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Calling method with parameter in prop
On Tue, May 13, 2008 at 2:21 AM, Blower, Andy [EMAIL PROTECTED] wrote: This should be done with care though IMO. To me, one big advantage of T5 over JSP's with EL or OGNL is that you are forced to keep the logic out of the templates for the most part. Simple comparisons and single parameter accessors seem okay, but I've always been surprised when seeing people on the list want full OGNL functionality. Maybe I've had too many issues with overcomplicated JSP's that have subsequently been broken by designers over the years to want to the temptation any more... lol. Yeah, I'd agree with that. Getting code out of the templates is a good thing. Let the framework allow for OGNL type extensions to be built as add-ons. Turning them into first class core features will encourage people to use them... -Original Message- From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] Sent: 12 May 2008 21:59 To: Tapestry users Subject: Re: T5: Calling method with parameter in prop Mor expression language would be great; the pain is when you pull values out of a Map or Collection and lose their type, at which point you also lose annotations and components such as BeanEditor and Grid no longer operate as expected. But I agree that having a few boolean operators in the expression language would be great: eq, lt, gt, gteq, lteq, etc. On Mon, May 12, 2008 at 2:26 AM, Andreas Pardeike [EMAIL PROTECTED] wrote: Hi, Don't know what you folks do, but I have created a bunch of custom bindings for different cases. The only thing I actually miss is the ability to COMBINE them. I.e., I have added a binding equals:foo=bar where foo and bar can be other binding objects or literals. I use it successfully for switch/case situations like in t:if test=equals:foo='abc'/t:if t:if test=equals:foo='def'/t:if .. t:if test=equals:foo='xyz'/t:if without the need to write a lot of getters. Now, I also have map:foo.bar where foo is suppose to be a HashMap and it will call foo.get(bar). As a result, all I want is the ability to have a way to specify foo and bar with the same binding prefix as in the beginning. For example, if I have a object that has a getter that returns a hashmap, I would love to write -- map:(prop:obj.foo).bar -- which would call obj.getFoo().get('bar') If I could get this working (I don't care about the syntax), I would be able to fulfill all my need by writing (and maybe contributing) a few custom bindings. On 9 maj 2008, at 18.31, Sven Homburg wrote: we will see what can we do 2008/5/9 Howard Lewis Ship [EMAIL PROTECTED]: Nope; I just want to let you create Insanely Great things, using T5 as the base. On Fri, May 9, 2008 at 9:10 AM, Sven Homburg [EMAIL PROTECTED] wrote: howard, you make us jobless ;-) 2008/5/9 Howard Lewis Ship [EMAIL PROTECTED]: In 5.1 I want to extend the Tapestry property expression language quite a bit further to address this (invoking methods), as well as map and array ceation ... basically, all the cool OGNL stuff people miss. On Fri, May 9, 2008 at 7:52 AM, kranga [EMAIL PROTECTED] wrote: In looking at converting from T3 to T5, I've to deal with constructs such as: class=ognl:menuClassName('home') where getMenuClassName uses the parameter to compare with the page's id passed in to determine if this is the currentPage or not. So the template has multiple links with constructs such as: class=ognl:menuClassName('about') class=ognl:menuClassName('contact') etc. How do I do this in T5 given that prop bindings to methods cannot accept arguments? I'm sure there is a workaround, I just can't seem to find one. Howard M. Lewis Ship Sven Homburg Howard M. Lewis Ship Sven Homburg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mixin render phases
That appears to be the result of (from: http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html) : If a method returns a true or false value, this will short circuit processing. Other methods within the phase that would ordinarily be invoked will not be invoked. Most render phase methods should return void, to avoid unintentionally short circuiting other methods for the same phase. Robert On May 13, 2008, at 5/1310:55 AM , Toby Hobson wrote: Something else i've noticed ... if i modify my mixin to always return true during the @BeginRender phase I still get the exception! - Original Message From: Toby Hobson [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 4:52:33 PM Subject: Re: Mixin render phases So if I've read the JIRA correctly does this mean that simply implementing @BeginRender and @AfterRender in my mixin is not enough - I would actually have the modify the component (in this case textarea)? to check for short-circuiting? Toby - Original Message From: Kristian Marinkovic [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 3:03:49 PM Subject: RE: Mixin render phases hi toby, i think i had the same issue some time ago i was also trying to create a mixin for enabled/disabled handling by short circuiting the render phases. but the render phases (or at least the short circuiting) do not work as i was expecting :). maybe you can take a look at the problem description (it think there are a lot of details in the comments) of the jira at https://issues.apache.org/jira/browse/TAPESTRY-1805 and comment on it. g, kirs Toby Hobson [EMAIL PROTECTED] 13.05.2008 15:24 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema Mixin render phases Hi guys, I'm trying to show/hide an html element based on Robert's recent suggestion (Re: how do we secure our views) but I've hit a minor problem. The mixin's @BeforeRender method is being called but then tapestry complains that the component (textArea) is unbalanced. I'm using the component and mixin in a custom component, not a page. Here is the code The mixin: public class Visible { @Parameter(required=true) private boolean visible; @BeginRender boolean render() { return visible; } } The custom component: @Component(id=reason, parameters={value=violation.message, visible=true}) @Mixins(visible) private TextArea reason; The custom component's tml t:form t:textArea t:id=reason / input type=submit / /t:form When the component renders I get the following exception: Render queue error in CleanupRender[TestViolations:violations.reason]:Component TestViolations:violations.reason has rendered unbalancedelements; either it has started an element with MarkupWriter.element()and not followed up with MarkupWriter.end(), or it has invokedMarkupWriter.end() without first invoking MarkupWriter.element(). TestViolations is the page which includes the custom component, Violations is the custom component Does anyone have any ideas? Thanks Toby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Questions about Textarea and submit button
I make the component called button which is different compare with submit component. The questions I have now is. how can I get the value from textarea without a submit button. You haven't shown us what your button does. Are you submitting the form that the textarea is in? Josh On Tue, May 13, 2008 at 4:37 AM, amebaliu [EMAIL PROTECTED] wrote: I make the component called button which is different compare with submit component. The questions I have now is. how can I get the value from textarea without a submit button. t:textArea t:value=task t:id=editplace / -- I put the value = task And in the page class, i put public void setTask(String task) { this.task = task; System.out.println(This is setting tasks: + task); //tasks.add(this.task); } public String getTask() { this.task = more event here; System.out.println(This is the getting task: +this.task); return this.task; } But somehow, there are not working, because I use my custom button component. Any suggesstions I can get the values from textarea , or make setter and getter working?? Thanks a lot -- View this message in context: http://www.nabble.com/Questions-about-Textarea-and-submit-button-tp17206414p17206414.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mixin render phases
OK that makes sense ... I thought that returning true meant carry on as normal Thanks guys Toby - Original Message From: Robert Zeigler [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 5:59:51 PM Subject: Re: Mixin render phases That appears to be the result of (from: http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html) : If a method returns a true or false value, this will short circuit processing. Other methods within the phase that would ordinarily be invoked will not be invoked. Most render phase methods should return void, to avoid unintentionally short circuiting other methods for the same phase. Robert On May 13, 2008, at 5/1310:55 AM , Toby Hobson wrote: Something else i've noticed ... if i modify my mixin to always return true during the @BeginRender phase I still get the exception! - Original Message From: Toby Hobson [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 4:52:33 PM Subject: Re: Mixin render phases So if I've read the JIRA correctly does this mean that simply implementing @BeginRender and @AfterRender in my mixin is not enough - I would actually have the modify the component (in this case textarea)? to check for short-circuiting? Toby - Original Message From: Kristian Marinkovic [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 3:03:49 PM Subject: RE: Mixin render phases hi toby, i think i had the same issue some time ago i was also trying to create a mixin for enabled/disabled handling by short circuiting the render phases. but the render phases (or at least the short circuiting) do not work as i was expecting :). maybe you can take a look at the problem description (it think there are a lot of details in the comments) of the jira at https://issues.apache.org/jira/browse/TAPESTRY-1805 and comment on it. g, kirs Toby Hobson [EMAIL PROTECTED] 13.05.2008 15:24 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema Mixin render phases Hi guys, I'm trying to show/hide an html element based on Robert's recent suggestion (Re: how do we secure our views) but I've hit a minor problem. The mixin's @BeforeRender method is being called but then tapestry complains that the component (textArea) is unbalanced. I'm using the component and mixin in a custom component, not a page. Here is the code The mixin: public class Visible { @Parameter(required=true) private boolean visible; @BeginRender boolean render() { return visible; } } The custom component: @Component(id=reason, parameters={value=violation.message, visible=true}) @Mixins(visible) private TextArea reason; The custom component's tml t:form t:textArea t:id=reason / input type=submit / /t:form When the component renders I get the following exception: Render queue error in CleanupRender[TestViolations:violations.reason]:Component TestViolations:violations.reason has rendered unbalancedelements; either it has started an element with MarkupWriter.element()and not followed up with MarkupWriter.end(), or it has invokedMarkupWriter.end() without first invoking MarkupWriter.element(). TestViolations is the page which includes the custom component, Violations is the custom component Does anyone have any ideas? Thanks Toby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What ist the advantage of ActionLink compared to EventLink
EventLink occured to me later than ActionLink, that's all. Perhaps if I had thought of EventLink first, there wouldn't be ActionLink. EventLink URL's need to explicitly identify the event name in the URL, i.e., /page:myevent. ActionLink's need to identify the component instead: /page.mycomponent. Which is better? I'm not sure. On Tue, May 13, 2008 at 4:11 AM, nille hammer [EMAIL PROTECTED] wrote: Hi all, using an ActionLink one has to assign an id. By this id the event hander is determined. So far so easy. But having assigned an id, a particular ActionLink can only be used once per template. With EventLink one can assign an event attribute and can put several links into a template pointing to the same event handler. I myself have replaced every ActionLink with an EventLink. I am wondering what ActionLink might be good for. Where is it needed to achieve something you cannot do with EventLink? Please could someone with a deeper knowledge of Tapestry explain that to me. Thanks in advance and kind regards, nillehammer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Pallete component behavior
hi there, if i click on the select/deselect button of the palette component a page submit is initiated. is this the wanted behavior ? -- with regards Sven Homburg http://tapestry5-components.googlecode.com
Re: Pallete component behavior
No, and that's odd behavior. I've tested Palette on FF Mac and FF Win and IE Win, so something else is going on. Any chance you have some client-side script attaching to those buttons? On Tue, May 13, 2008 at 10:28 AM, Sven Homburg [EMAIL PROTECTED] wrote: hi there, if i click on the select/deselect button of the palette component a page submit is initiated. is this the wanted behavior ? -- with regards Sven Homburg http://tapestry5-components.googlecode.com -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Calling method with parameter in prop
I'm not sure I like the idea of a framework FORCING me to do something, IMHO poorly structured code should be prevented by coding standards and peer reviews, not a rigid framework. Just moving the logic from a JSP/Template to a Java class doesn't necessarily mean it's cleaner. Sometimes it is actually clearer to put some logic in the template. In my experience T4 and 5 have proved to be very flexible, more so than JSF etc. so I'm surprised that there isn't some primitive form of EL in the TML. Anyway, like I said, just one user's opinion! Toby - Original Message From: Josh Canfield [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 5:55:26 PM Subject: Re: T5: Calling method with parameter in prop On Tue, May 13, 2008 at 2:21 AM, Blower, Andy [EMAIL PROTECTED] wrote: This should be done with care though IMO. To me, one big advantage of T5 over JSP's with EL or OGNL is that you are forced to keep the logic out of the templates for the most part. Simple comparisons and single parameter accessors seem okay, but I've always been surprised when seeing people on the list want full OGNL functionality. Maybe I've had too many issues with overcomplicated JSP's that have subsequently been broken by designers over the years to want to the temptation any more... lol. Yeah, I'd agree with that. Getting code out of the templates is a good thing. Let the framework allow for OGNL type extensions to be built as add-ons. Turning them into first class core features will encourage people to use them... -Original Message- From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] Sent: 12 May 2008 21:59 To: Tapestry users Subject: Re: T5: Calling method with parameter in prop Mor expression language would be great; the pain is when you pull values out of a Map or Collection and lose their type, at which point you also lose annotations and components such as BeanEditor and Grid no longer operate as expected. But I agree that having a few boolean operators in the expression language would be great: eq, lt, gt, gteq, lteq, etc. On Mon, May 12, 2008 at 2:26 AM, Andreas Pardeike [EMAIL PROTECTED] wrote: Hi, Don't know what you folks do, but I have created a bunch of custom bindings for different cases. The only thing I actually miss is the ability to COMBINE them. I.e., I have added a binding equals:foo=bar where foo and bar can be other binding objects or literals. I use it successfully for switch/case situations like in t:if test=equals:foo='abc'/t:if t:if test=equals:foo='def'/t:if .. t:if test=equals:foo='xyz'/t:if without the need to write a lot of getters. Now, I also have map:foo.bar where foo is suppose to be a HashMap and it will call foo.get(bar). As a result, all I want is the ability to have a way to specify foo and bar with the same binding prefix as in the beginning. For example, if I have a object that has a getter that returns a hashmap, I would love to write -- map:(prop:obj.foo).bar -- which would call obj.getFoo().get('bar') If I could get this working (I don't care about the syntax), I would be able to fulfill all my need by writing (and maybe contributing) a few custom bindings. On 9 maj 2008, at 18.31, Sven Homburg wrote: we will see what can we do 2008/5/9 Howard Lewis Ship [EMAIL PROTECTED]: Nope; I just want to let you create Insanely Great things, using T5 as the base. On Fri, May 9, 2008 at 9:10 AM, Sven Homburg [EMAIL PROTECTED] wrote: howard, you make us jobless ;-) 2008/5/9 Howard Lewis Ship [EMAIL PROTECTED]: In 5.1 I want to extend the Tapestry property expression language quite a bit further to address this (invoking methods), as well as map and array ceation ... basically, all the cool OGNL stuff people miss. On Fri, May 9, 2008 at 7:52 AM, kranga [EMAIL PROTECTED] wrote: In looking at converting from T3 to T5, I've to deal with constructs such as: class=ognl:menuClassName('home') where getMenuClassName uses the parameter to compare with the page's id passed in to determine if this is the currentPage or not. So the template has multiple links with constructs such as: class=ognl:menuClassName('about') class=ognl:menuClassName('contact') etc. How do I do this in T5 given that prop bindings to methods cannot accept
Re: Pallete component behavior
I've seen the behavior as well, in FF3 beta 5, Not sure if it's a FF3 bug, or a javascript bug, but given that Palette works in Safari 2, 3, IE 5.5, 6, 7, FF2 (win and mac), and opera, my initial reaction when I experienced the bug was to think: Well, I /am/ using a beta browser... Robert On May 13, 2008, at 5/1312:33 PM , Howard Lewis Ship wrote: No, and that's odd behavior. I've tested Palette on FF Mac and FF Win and IE Win, so something else is going on. Any chance you have some client-side script attaching to those buttons? On Tue, May 13, 2008 at 10:28 AM, Sven Homburg [EMAIL PROTECTED] wrote: hi there, if i click on the select/deselect button of the palette component a page submit is initiated. is this the wanted behavior ? -- with regards Sven Homburg http://tapestry5-components.googlecode.com -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Changing a components property at runtime
This may sound like a simple question but I can't work out how to change a property programatically. Basically I'd like to disable a component from an event handler. I know I can pass params in via TML or using annotations but I can't find any setX() methods on the components Thanks Toby
Re: Changing a components property at runtime
Toby, Components are just POJOs - as far as your application code they have no common type; no common interface for such actions. There is a common interface but it is fitted onto component classes at runtime. If you need to set properties/call methods, you must provide such interfaces. chris Toby Hobson wrote: This may sound like a simple question but I can't work out how to change a property programatically. Basically I'd like to disable a component from an event handler. I know I can pass params in via TML or using annotations but I can't find any setX() methods on the components Thanks Toby -- http://thegodcode.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing a components property at runtime
Thanks Chris, Does this mean that there is no easy way to disable a textfield at runtime for instance? Would a mixin work for this? Toby - Original Message From: Chris Lewis [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 7:10:16 PM Subject: Re: Changing a components property at runtime Toby, Components are just POJOs - as far as your application code they have no common type; no common interface for such actions. There is a common interface but it is fitted onto component classes at runtime. If you need to set properties/call methods, you must provide such interfaces. chris Toby Hobson wrote: This may sound like a simple question but I can't work out how to change a property programatically. Basically I'd like to disable a component from an event handler. I know I can pass params in via TML or using annotations but I can't find any setX() methods on the components Thanks Toby -- http://thegodcode.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing a components property at runtime
I seems like you'd want to use the 'disabled' parameter as Robert mentioned, which many components have. Perhaps your dynamic behavior could be solved by storing a flag in a page property and then using something like: input t:type=textfield disabled=disabled value=username/ Where disabled would be a boolean page property. Toby Hobson wrote: Thanks Chris, Does this mean that there is no easy way to disable a textfield at runtime for instance? Would a mixin work for this? Toby - Original Message From: Chris Lewis [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 7:10:16 PM Subject: Re: Changing a components property at runtime Toby, Components are just POJOs - as far as your application code they have no common type; no common interface for such actions. There is a common interface but it is fitted onto component classes at runtime. If you need to set properties/call methods, you must provide such interfaces. chris Toby Hobson wrote: This may sound like a simple question but I can't work out how to change a property programatically. Basically I'd like to disable a component from an event handler. I know I can pass params in via TML or using annotations but I can't find any setX() methods on the components Thanks Toby -- http://thegodcode.net
Re: Changing a components property at runtime
Chris correctly pointed out that classes are POJOs, but I'm guessing he thought you were referring to your own components. But I think you're thinking about framework-provided components, where you don't have the easy ability to get/set properties. First, for many of these properties, there used to be getters/setters, until the @Property annotation came along. So if you find a good use- case where 3rd party code has a valid need to get or set the property, file a jira for that property + component, and you should see the property added back in. But if the property in question is also a component parameter (like disabled is for most (all?) of the framework form-field components), then the approach outlined in my previous e-mail (binding the disabled parameter to a property of your page or containing component) is the way to go. Cheers, Robert On May 13, 2008, at 5/131:21 PM , Toby Hobson wrote: Thanks Chris, Does this mean that there is no easy way to disable a textfield at runtime for instance? Would a mixin work for this? Toby - Original Message From: Chris Lewis [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 7:10:16 PM Subject: Re: Changing a components property at runtime Toby, Components are just POJOs - as far as your application code they have no common type; no common interface for such actions. There is a common interface but it is fitted onto component classes at runtime. If you need to set properties/call methods, you must provide such interfaces. chris Toby Hobson wrote: This may sound like a simple question but I can't work out how to change a property programatically. Basically I'd like to disable a component from an event handler. I know I can pass params in via TML or using annotations but I can't find any setX() methods on the components Thanks Toby -- http://thegodcode.net - 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: Changing a components property at runtime
Is disabled a parameter for the component? If so, then why not make the dynamic disabled a property of the parent component or page, and bind the component parameter to the parent property? For example: the component: @Parameter boolean disabled; ... The page or component that contains the component: @Component(parameters={disabled=disabled,...} private SomeComponent comp; @Property @Persist private boolean disabled; public onActionFromSomewhere() { return disabled=false; } On May 13, 2008, at 5/1312:58 PM , Toby Hobson wrote: This may sound like a simple question but I can't work out how to change a property programatically. Basically I'd like to disable a component from an event handler. I know I can pass params in via TML or using annotations but I can't find any setX() methods on the components Thanks Toby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing a components property at runtime
Yep, that makes sense - i was thinking that the parameter specified in the annotation was a literal, but it's a prop so that will work nicely Thanks guys - Original Message From: Robert Zeigler [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 7:16:53 PM Subject: Re: Changing a components property at runtime Is disabled a parameter for the component? If so, then why not make the dynamic disabled a property of the parent component or page, and bind the component parameter to the parent property? For example: the component: @Parameter boolean disabled; ... The page or component that contains the component: @Component(parameters={disabled=disabled,...} private SomeComponent comp; @Property @Persist private boolean disabled; public onActionFromSomewhere() { return disabled=false; } On May 13, 2008, at 5/1312:58 PM , Toby Hobson wrote: This may sound like a simple question but I can't work out how to change a property programatically. Basically I'd like to disable a component from an event handler. I know I can pass params in via TML or using annotations but I can't find any setX() methods on the components Thanks Toby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing a components property at runtime
I just realized I repeated Rob, so listen to him :-) Chris Lewis wrote: I seems like you'd want to use the 'disabled' parameter as Robert mentioned, which many components have. Perhaps your dynamic behavior could be solved by storing a flag in a page property and then using something like: input t:type=textfield disabled=disabled value=username/ Where disabled would be a boolean page property. Toby Hobson wrote: Thanks Chris, Does this mean that there is no easy way to disable a textfield at runtime for instance? Would a mixin work for this? Toby - Original Message From: Chris Lewis [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 7:10:16 PM Subject: Re: Changing a components property at runtime Toby, Components are just POJOs - as far as your application code they have no common type; no common interface for such actions. There is a common interface but it is fitted onto component classes at runtime. If you need to set properties/call methods, you must provide such interfaces. chris Toby Hobson wrote: This may sound like a simple question but I can't work out how to change a property programatically. Basically I'd like to disable a component from an event handler. I know I can pass params in via TML or using annotations but I can't find any setX() methods on the components Thanks Toby -- http://thegodcode.net
Re: Pallete component behavior
sorry for my less detailed question. i tested it now with IE6/FF2 too, only the FF3beta5 has this behaivor 2008/5/13 Robert Zeigler [EMAIL PROTECTED]: I've seen the behavior as well, in FF3 beta 5, Not sure if it's a FF3 bug, or a javascript bug, but given that Palette works in Safari 2, 3, IE 5.5, 6, 7, FF2 (win and mac), and opera, my initial reaction when I experienced the bug was to think: Well, I /am/ using a beta browser... Robert On May 13, 2008, at 5/1312:33 PM , Howard Lewis Ship wrote: No, and that's odd behavior. I've tested Palette on FF Mac and FF Win and IE Win, so something else is going on. Any chance you have some client-side script attaching to those buttons? On Tue, May 13, 2008 at 10:28 AM, Sven Homburg [EMAIL PROTECTED] wrote: hi there, if i click on the select/deselect button of the palette component a page submit is initiated. is this the wanted behavior ? -- with regards Sven Homburg http://tapestry5-components.googlecode.com -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- with regards Sven Homburg http://tapestry5-components.googlecode.com
Regexp within a custom component
Hello again :) I've just added some validation to my custom component and I'm having trouble with the regexp validator. As per the forms tutorial on the T5 site I've placed a @Validate annotation on my getEmail() accessor: @Validate(required,regexp) public String getEmail() { return email; } I've created a message catalogue in the same package as the component and added some validation stuff: email-regexp=(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)* email-regexp-message=that appears to be an invalid email format, please check it But Tapestry is complaining that the regexp validator requires a validation constraint - it's as if it dosen't understand the entry in the catalogue. The component can see the catalogue becuase i'm also using the message: prefix elsewhere in this component, it's just the regexp stuff it's struggling with. Any ideas? Thanks Toby
Re: Regexp within a custom component
Fixed it! It was because I defined the textfield as emailText, but the property as email. so my message catalogue now looks like emailText-regexp=(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)* emailText-regexp-message=that appears to be an invalid email format, please check it On a minor point I think this is a little confusing - validators are applied to the underlying properties but look for messages associated with the component. I'd actually prefer it if I could associate validators with the actual component e.g. @Component(id=emailText, parameters={value=email}) @Validate(...) private TextField emailText; Toby - Original Message From: Toby Hobson [EMAIL PROTECTED] To: users@tapestry.apache.org Sent: Tuesday, 13 May, 2008 8:37:57 PM Subject: Regexp within a custom component Hello again :) I've just added some validation to my custom component and I'm having trouble with the regexp validator. As per the forms tutorial on the T5 site I've placed a @Validate annotation on my getEmail() accessor: @Validate(required,regexp) public String getEmail() { return email; } I've created a message catalogue in the same package as the component and added some validation stuff: email-regexp=(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)* email-regexp-message=that appears to be an invalid email format, please check it But Tapestry is complaining that the regexp validator requires a validation constraint - it's as if it dosen't understand the entry in the catalogue. The component can see the catalogue becuase i'm also using the message: prefix elsewhere in this component, it's just the regexp stuff it's struggling with. Any ideas? Thanks Toby
Client side validation messages not re-displayed
I've just noticed something: If I have two validators and validation fails twice, I only see one error message. E.g. @Validator(required, regexp); public String getEmail() { return email; } message catalogue: email-required=please enter your email email-regexp=(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)* email-regexp-message=that appears to be an invalid email format, please check it In FF I submit the empty form and get the message telling me to enter my email. So I enter toby and hit submit. Now the text field is redisplayed in red but there is no error message - i never see the message about the invalid format. Has anyone else encountered this? Have I just screwed up my code or could this be a bug? Toby
Re: T5: Calling method with parameter in prop
Hey Toby, I'm not sure I like the idea of a framework FORCING me to do something I agree with the sentiment, but in this case isn't it misplaced? I suppose you are forced to consider which binding implementation to use, but that feels more like flexibility. Tapestry should make integrating and implementing new bindings really easy. Plugging a module into your project with those bindings should be easy too. We have OGNL, EL, juel, jexl, and others... is there a need for tapestry to implement this again? In my experience T4 and 5 have proved to be very flexible, more so than JSF etc. so I'm surprised that there isn't some primitive form of EL in the TML. There is, it's just VERY primitive. :) I don't think building the kitchen sink into the framework makes it more flexible. Being able to add it on later, if you need it is flexible, and also what we have now (the OGNL binding referred to earlier in this thread) Anyway, like I said, just one user's opinion! Yep, it's good to discuss stuff. Hopefully it'll be useful for someone down the road... Josh On Tue, May 13, 2008 at 10:33 AM, Toby Hobson [EMAIL PROTECTED] wrote: I'm not sure I like the idea of a framework FORCING me to do something, IMHO poorly structured code should be prevented by coding standards and peer reviews, not a rigid framework. Just moving the logic from a JSP/Template to a Java class doesn't necessarily mean it's cleaner. Sometimes it is actually clearer to put some logic in the template. In my experience T4 and 5 have proved to be very flexible, more so than JSF etc. so I'm surprised that there isn't some primitive form of EL in the TML. Anyway, like I said, just one user's opinion! Toby -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Questions about Textarea and submit button
Sorry, i forgot to describe the functions of the button. The button is for doing the ajax, like retrieve the results from a arraylist in page class, and display them when i click it. but not for submitting the form, they are a normal button and a normal textarea. joshcanfield wrote: I make the component called button which is different compare with submit component. The questions I have now is. how can I get the value from textarea without a submit button. You haven't shown us what your button does. Are you submitting the form that the textarea is in? Josh On Tue, May 13, 2008 at 4:37 AM, amebaliu [EMAIL PROTECTED] wrote: I make the component called button which is different compare with submit component. The questions I have now is. how can I get the value from textarea without a submit button. t:textArea t:value=task t:id=editplace / -- I put the value = task And in the page class, i put public void setTask(String task) { this.task = task; System.out.println(This is setting tasks: + task); //tasks.add(this.task); } public String getTask() { this.task = more event here; System.out.println(This is the getting task: +this.task); return this.task; } But somehow, there are not working, because I use my custom button component. Any suggesstions I can get the values from textarea , or make setter and getter working?? Thanks a lot -- View this message in context: http://www.nabble.com/Questions-about-Textarea-and-submit-button-tp17206414p17206414.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Questions-about-Textarea-and-submit-button-tp17206414p17219076.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 + DWR integration
I tried it out and it worked quite easy. Spring is not a dependency of DWR as far as I know, so... ;) Leon Derks schrieb: I don't have that topic. Is it easy to integrate DWR with tapestry, without Spring? Leon Renat Zubairov wrote: Hi That's an interesting topic. Actually we had discussed it once with Igor, and it seems that it shouldn't be too hard. The question is which objects from the server-side you want to access from DWR? If you will answer this question then you can just start a DWR servlet in your web application and try to get the objects of interest. Renat 2008/5/13 Leon Derks [EMAIL PROTECTED]: How easy is it to integrate T5 with DWR? Are there examples of how to do this? How do I need to configure the dwr.xml file? Leon - 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]
Questions about T5 html markup generated
Hi, I've noticed some quirks about the html generated by T5, and I was wondering how I could go about changes these things. I would appreciate it if someone could point out how to fix these things. 1) When using t:body/, an additional attribute xmlns= http://www.w3.org/1999/xhtml; is added to the parent of the t:body/. For example: div id=foo t:body/ /div generates the following html: div id=foo xmlns=http://www.w3.org/1999/xhtml; ... /div I would like to prevent the xmlns from being appended to the parent element. 2) When using br/ , an addition attribute clear=none is added. So: br/ becomes br clear=none 3) Probably the most annoying one, when using a, shape=rect is appended. So: a href= becomes a href= shape=rect When I attempt to enable xhtml output as outlined in this wiki posting: http://wiki.apache.org/tapestry/Tapestry5HowToXhtml the rendered page has a bunch of glitches due to these extra parameters (especially the shape=rect). Any way to fix these issues? Thanks, Joe
Re: Questions about Textarea and submit button
Sorry, i forgot to describe the functions of the button. No worries, if you want a good answer though, you'll have to ask your question with more details. The button is for doing the ajax, like retrieve the results from a arraylist in page class, and display them when i click it. but not for submitting the form, they are a normal button and a normal textarea. Generally you post the form to get the contents of the textarea from the browser to the server. If you don't want the full page to reload you can bind a zone to the form. This causes the form to be submitted via ajax and puts the results into the zone. If you have more complicated requirements then you'll have to spell them out a little more specifically. Josh On Tue, May 13, 2008 at 2:45 PM, amebaliu [EMAIL PROTECTED] wrote: Sorry, i forgot to describe the functions of the button. The button is for doing the ajax, like retrieve the results from a arraylist in page class, and display them when i click it. but not for submitting the form, they are a normal button and a normal textarea. joshcanfield wrote: I make the component called button which is different compare with submit component. The questions I have now is. how can I get the value from textarea without a submit button. You haven't shown us what your button does. Are you submitting the form that the textarea is in? Josh On Tue, May 13, 2008 at 4:37 AM, amebaliu [EMAIL PROTECTED] wrote: I make the component called button which is different compare with submit component. The questions I have now is. how can I get the value from textarea without a submit button. t:textArea t:value=task t:id=editplace / -- I put the value = task And in the page class, i put public void setTask(String task) { this.task = task; System.out.println(This is setting tasks: + task); //tasks.add(this.task); } public String getTask() { this.task = more event here; System.out.println(This is the getting task: +this.task); return this.task; } But somehow, there are not working, because I use my custom button component. Any suggesstions I can get the values from textarea , or make setter and getter working?? Thanks a lot -- View this message in context: http://www.nabble.com/Questions-about-Textarea-and-submit-button-tp17206414p17206414.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Questions-about-Textarea-and-submit-button-tp17206414p17219076.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Questions about Textarea and submit button
Hi josh, Thanks for the help, I will try the zone 2nite.. thanks a lot :working::working: joshcanfield wrote: Sorry, i forgot to describe the functions of the button. No worries, if you want a good answer though, you'll have to ask your question with more details. The button is for doing the ajax, like retrieve the results from a arraylist in page class, and display them when i click it. but not for submitting the form, they are a normal button and a normal textarea. Generally you post the form to get the contents of the textarea from the browser to the server. If you don't want the full page to reload you can bind a zone to the form. This causes the form to be submitted via ajax and puts the results into the zone. If you have more complicated requirements then you'll have to spell them out a little more specifically. Josh On Tue, May 13, 2008 at 2:45 PM, amebaliu [EMAIL PROTECTED] wrote: Sorry, i forgot to describe the functions of the button. The button is for doing the ajax, like retrieve the results from a arraylist in page class, and display them when i click it. but not for submitting the form, they are a normal button and a normal textarea. joshcanfield wrote: I make the component called button which is different compare with submit component. The questions I have now is. how can I get the value from textarea without a submit button. You haven't shown us what your button does. Are you submitting the form that the textarea is in? Josh On Tue, May 13, 2008 at 4:37 AM, amebaliu [EMAIL PROTECTED] wrote: I make the component called button which is different compare with submit component. The questions I have now is. how can I get the value from textarea without a submit button. t:textArea t:value=task t:id=editplace / -- I put the value = task And in the page class, i put public void setTask(String task) { this.task = task; System.out.println(This is setting tasks: + task); //tasks.add(this.task); } public String getTask() { this.task = more event here; System.out.println(This is the getting task: +this.task); return this.task; } But somehow, there are not working, because I use my custom button component. Any suggesstions I can get the values from textarea , or make setter and getter working?? Thanks a lot -- View this message in context: http://www.nabble.com/Questions-about-Textarea-and-submit-button-tp17206414p17206414.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Questions-about-Textarea-and-submit-button-tp17206414p17219076.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- TheDailyTube.com. Sign up and get the best new videos on the internet delivered fresh to your inbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Questions-about-Textarea-and-submit-button-tp17206414p17220249.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DatePicker component to be displayed always , not only when clicked on datepicker icon.
Hi all, Is there any way to display the date picker widget always (not only when clicked on icon). please help me. I tried giving toggle = false. no use. Thnks in advance, Sumanth.D www.indygo.in