[T5] URL encoding maze : post to encoded URL (even in 5.0.9) ?
Hello, I'm still stick with some encoding issue for URL using UTF-8. I'm stick with Tapestry 5.0.6. I applied the patch for TAPESTRY- bug ( https://issues.apache.org/jira/secure/attachment/12371922/context_encode_decode_fix_to_5.0.6.patch), what solves a lot of problem. But it's not over, and that part applies even to Tapestry 5.0.9 : It seems that post are posted the the encoded URL. The following post is also done to the encoded URL, but that part is decoded by the servlet API call to getServletPath(). So, if (as it's in my case) you use onActivate(String name) in a page using a post, the name given to onActivate for the post action will receive a non decoded String. If some validation are done based on that encoded value, as a check in DB, they fail. So, as I figure I'm not the only one to do this kind of things, and that I'm doing something bad. Please, would somebody show me my error ? -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Editing a collection
Michael Courcy wrote: You mean that using value=user.loginUser tapestry alway update the same thing. Thus if I change the method User { void setLoginUser(String loginUser){ this.loginUser = loginUser; System.out.println(loginUser); } It should at least output the value I input in my textField ... And that's right, it actually what's going on the input are correctly output But When I outout the user itself in the page public void setUser(User user) { this.user = user; System.out.println(user); } the old value is kept actually setUser is call before setLoginUser ... Ok thanks I've to work on that. If you want, I built a ListEditor to handle this kind of things. It's part of my project, http://interldap.org What you may looking for is here : http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-common/trunk/src/main/java/org/interldap/wui/t5lib/components/ListEditor.java?view=markuprev=672 And here there is an example of use case (it really lacks a lot of doc) : http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-common/trunk/src/main/resources/org/interldap/wui/t5lib/components/eschema/EditAttribute.tml?view=markuprev=568 That build a list of input fields, with a [delete] button next to them, and [add new value] button at the end of the list. Each button emits an events so that enclosing component can add or delete matching value from list. When you click on a button, updated values are set in the list at the right place. It may be use to construct simpler list editor. Hope it may help ! -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] URL encoding maze : post to encoded URL (even in 5.0.9) ?
Francois Armand wrote: So, if (as it's in my case) you use onActivate(String name) in a page using a post, the name given to onActivate for the post action will receive a non decoded String. If some validation are done based on that encoded value, as a check in DB, they fail. So, as I figure I'm not the only one to do this kind of things, and that I'm doing something bad. Please, would somebody show me my error ? OK, it seems that the guilty was the TapestryInternalUtils.encodeContext on line 155 of LinkFactoryImpl#addActivationContextToLink : as soon as I removed it, everything start working. I hope it does not break things elsewhere ^^ -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 Encoding issue (repost)
Martin Grotzke wrote: Hi, Hi Martin, I just want to pickup this topic in a new thread, to make sure it's noticed - thx to Uli's suggestion in the previous thread :) At first a short summary again: - T5 (the PageRenderDispatcher) tries to decode activation context arguments (in convertActivationContext). [...] Our encoding is UTF-8 btw. My question is: why does PageRenderDispatcher.convertActivationContext try to decode the already decoded string again? I asume there's *some* reason for this ;) Sorry to resurrect this old post, but I encounter the very same bug. I know it is corrected in recent version of T5 (after 5.0.8, I believe) but for now, I'm stuck with 5.0.6. So, to bypass it, I contribute to master dispatcher a PageRenderDispatcher without the double decoding, but now it seems to be worst : - it almost work but sometimes (I think it's when I call ComponentResources#createPageLink or similar methods), spaces are encoded with +, but the + are not decoded. So, returned link are not understood by Tapestry, but if a replace + by %20 or , everything works. - changing the order of utf8filter (with after:* or before:* in configuration) doesn't seem to do anything I believe I forgot to switch a configuration to UTF-8, somewhere. But I don't know where :/ So, Martin, have you find a way to have it to work ? Have you any idea ? It's a really important bug for us :/ Thanks, -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 Encoding issue (repost)
Martin Grotzke wrote: Hi Francois, we're currently living with a really ugly hack: we use a patched version of TapestryInternalUtils, with the methods urlEncode and urlDecode changed [1]. Ho. Well, I tested almost everything I thought to, and the last item is patch Tapestry 5.0.6. I really don't like that, but I have to have it work this evening... So... For us this is still an issue we want to investigate, I believe this is an issue in combination with mod_jk. But my memory is really bad, so I will have to start again investigating. I don't use mod_jk, and I don't really understand where it comes from. Are you sure this issue is solved in the latest version of T5? So that you can even have slashes in your activation parameters? Well, you are right : slashes are not supported. But spaces, +, accented letters are well encoded/decoded -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
addScript(), entities, CDATA...
Hello, I'm running (again) in problems with entities filtering. Since https://issues.apache.org/jira/browse/TAPESTRY-1818 is corrected, now I can add JavaScript with '' in CDATA block but only if I set the rendering type to text/xml (with @Meta(tapestry.response-content-type=text/xml) so that the parser understand them. Now, I would like to also be able to use comparators in the addScript() function of pageRenderSupport. But it seems that : - entities are filtered in addScript : if I write pageRenderSupport.addScript(alert('');); in Java, the pop-up displays gt; ; - moreover, if I set @Meta(tapestry.response-content-type=text/xml), scripts added by addScript() are no longer executed. So... Well, what am I doing wrong ? And how can I correct it ? At least, I need to be able to use , etc in addScript. Chris, I know that you have a hard time with all these questions, have you any advice ? In a perfect world, I really like to be able to define block in the template, with Javascript in them, and pass them to addScript... Or perhaps Tapestry may have a javascriptblock component, with it's content automagically added to Tapestry.onDOMLoaded... Thank in advance, -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] Grid : how to overload a cell whose name is know at runtime ?
Hello, I would like to overload a grid cell. It's easy if I know the name of the cell, say mycell : 8--- t:grid t:source=mysource ... t:parameter name=mycellCell here goes the template for mycell /t:parameter /t:grid 8--- My problem is that I want to overload only some cells, based on their name, but the name is only kown at runtime. I thought that I could do something like that : 8--- t:grid t:source=mysource ... t:parameter name=${theName}Cell here goes the template for ${theName} /t:parameter /t:grid 8--- But it doesn't work. Somebody know how to achieve that ? And for my culture, why it doesn't work ? (something to do with parameter binding and evaluation order, I suppose) Thanks in advance -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Example code of T5?
Yeeswara Nadapana (HCL Financial Services) wrote: Hi, Can I get any downloads of the example code on Tapestry 5? Please help me with some links For a basic tutorial, there is the official one : http://tapestry.apache.org/tapestry5/tutorial1/ After that, there in number of HowTos here : http://wiki.apache.org/tapestry/Tapestry5HowTos With for example, if you are lookink for a CRUD application, this one : http://wiki.apache.org/tapestry/Tapestry5How_to_make_a_basic_crud If you want some example of components, you can look here : http://code.google.com/p/gc-tapestry-components/ -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't get Tapestry5 to work with Spring
Howard Lewis Ship wrote: Between release 5.0.5 and 5.0.6 Tapestry switched from commons-logging to SLF4J. You want to be injecting an org.slf4j.Logger instead. Arf, too quick for me :) -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] overriding persistence strategy of all fields to conversation strategy
Kristian Marinkovic wrote: hi davor, Hi, Sorry I jump in the thread, you're right... flash will be an excpetion :)... the problem is that if you use components (libraries) of other teams or third party components that persist values in the session you still want to be able to use it in a conversation without changing the component. But in library, components just use the default persistence strategy. If a strategy is specified, it should be for a meaningful reason. Perhaps they have define there own strategy. So I think that you should just give the possibility to change the default strategy, not impose it. Moreover, libraries may evolve to use your strategy with their constrains - nobody better that the dev of a component know what may break with a modification. making it easy to use for developers is also a goal. That's a good goal :) (I'm a dev after all, and a lazy one ;) Just remember that there is no free lunch, and be careful if you attempt to interpret there will. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using t:select in Tapestry 5
Yeeswara Nadapana (HCL Financial Services) wrote: Hi, Hello Yeeswara, Can anyone please explain me the procedure to add a select box to my form? If I write as: select t:type=select t:id=selectId t:model=selectModel t:value=selectValue/ Corelib components are document here : http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html For the select component, you can read this : - value: The value to read or update. = it's the choice the user did. Tapestry will update the Java property of your page accessible by the setter setSelectValue with ths choice's value. - model: The model used to identify the option groups and options to be presented to the user. This can be generated automatically for Enum types. = it's the available choices for the select. This parameter accept a comma separated list of value, a collection retrieved from the Java part, or a full SelectModel implementation. I suggest you to read the documentation available on the site to understand how Java classes and template files are links, how components paramters, etc. You whould begin by the tutorial here : http://tapestry.apache.org/tapestry5/tutorial1/ And read all the topic of the user guide here : http://tapestry.apache.org/tapestry5/tapestry-core/ Hope it helps, -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: @OnEvent and onActivate
Angelo Chen wrote: Hi, Can we use @OnEvent to annotate a onActivate method, say: @OnEvent(???) void myActivate() { } I'm not sure I understand what you want to do. The @OnEvent tag signal a handler for an Event. The method annotated may have any name you want, but you SHOULD avoid Tapestry reserved name (I think it was said that an exception should be raised if a conventional method name is annotated). . Event handlers can be used in page or components, The onActivate method represent the method(s) called at the page activation. Page activation is a special phase before page rendering which deals with the context of the page (for example get parameters). It's an important phase because it is the last in the response process where you can send a redirect or a non HTML response (see the PDF tutorial for example). The activation phase is *always* done in a page, even if no onActivate method deals with it. So, - you can use @onEvent on any method you want but you SHOULD avoid reserved name ; - onActivate is not an event handler. What do you want to do ? -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: JumpStart 3.0.0 Preview ready for comments
Geoff Callender wrote: Yes, I've been thinking of doing that. Not sure what I'd do about the elements that update the DB, though. Concurrency isn't a problem for the system but it might be for the user experience - when user A goes from the edit screen to the display screen of an example they may see unexpected values thanks to user B, C and D editing the same objects in the same example. Hmmm... Just call the demo a collaborative edition platform, and you are done. Web 2.0 save us from all this transactive mess :) -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: JumpStart 3.0.0 Preview ready for comments
Michael Courcy wrote: Hi I was really interested on how we could handle the edition of an entire list in a single page with T5. Let's say a ListPerson in a situation where we want the user to be able to edit the name and surname of all in a single request. What could be the more elegant solution ? I have a listEditor that build a list of property editor with the possibility to add/remove/update properties. I built it to handle simple properties (String, Enum, date...), but it seems to work as long as you have an editor associated with the property type : I use it to handle a list of criterion, which are a complex object (well, complex...). In your case, you would have to define a personEditor (surely just a beanEditor). It should (at least :) need a lot more of polish, but it work rather nicely. For example, if you want to edit a list of string, say bleue, red and that the editor for String is text, the rendered template is : [blue] remove [red] remove add The [] are text input fields, are buttons. The component generate event on button selection so that the parent element can handle matching action (add or remove element, with perhaps other business logic). The project is open source, but the browse SVN is still broken (OW2 plateform... no comment). Thought, you can checkout the source at this address : -- svn://svn.forge.objectweb.org/svnroot/interldap/interldap-wui-common/trunk -- The component is in src/main/java/org.interldap.wui.t5lib.components/ListEditor.java. Example of use are available in src/main/java/org/interldap/wui/t5lib/components/eschema/EditClass and EditAttribute. If the god of spare time is with me, I will try to contribute to some component repository or another the code in January, cleaner and documented. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 : Failure writing parameter value of component because read only ???
Penyihir Kecil wrote: Failure writing parameter value of component admin/PlayerForm:positionselect: Expression position for class edu.its.dreamteam.web.pages.admin.PlayerForm is read-only. [...] could anyone could help me what had happened to my code ??? whats wrong with my code ? here's my code : [...] I just think that your PlayerForm.java misses a setter for the position property (and only saw a getter for it). This kind of error is quite explicit : read only : no setter ; write only : no getter. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
error image near fields and text browser : remove it ?
Hello, Near each fields in a form, there is an error image with css classes t-error-icon and t-invisible. The t-invisible class is removed if the field is in error, to signal what field is faulty. This behaviour is problematic with text browser. Well, you will say that nobody use them anymore, but in the case of blinded people, they use an equivalent that read pages for them, and don't care of the CSS. The problem is that for this kind of browser, all fields seems to be on fault since the first access to the form. So it would be great if there were a way to remove this image, and add it *only* when there is actually an error. And javascript validate can add the img node if needed. Anyone knows how to do that ? -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: error image near fields and text browser : remove it ?
Francois Armand wrote: Hello, [...] This behaviour is problematic with text browser. Well, you will say that nobody use them anymore, but in the case of blinded people, they use an equivalent that read pages for them, and don't care of the CSS. The problem is that for this kind of browser, all fields seems to be on fault since the first access to the form. Well, it seems that a lot of things are broken with text browser. It seems that a lot of form do not work, perhaps due to some persisted value. I think/hope it is due to the alpha status, and that it will evolve in a near future. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: error image near fields and text browser : remove it ?
Kristian Marinkovic wrote: Hi Francois, Hello, the images are generate by the DefaultValidationDecorator. You can provide your own (as i did :)) by implementing the ValidationDecorator interface or extending BaseValidationDecorator. Then you have to replace the DefaultValidationDecorator in the environment with your implementation... Thank you for your advice, I will do that :) -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] Re-inject or inherit services in children ?
Hello ! My project is a little more advanced, so I spent some time refactoring the code. Along this refactoring, I saw that I have a lot if component and class that inherit a base page (yes, that's why I have a base page ;). I inject on this page some quite common services (for example, an authorization service). So, what is the best pattern, in regard of Tapestry 5, for a page or component that extends my page base : inject (again) the services, or get it from the parent (what suppose that these services have matching getter in the base page). I believe injection is cheap, but a base page is here to provide common services, so I'm prone to choose the inherit pattern. What do you think about it ? -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: About Slf4j Error
Lococode wrote: Hi, Hello Lococode, [...] error: * java.lang.RuntimeException java.lang.ClassNotFoundException: caught an exception while obtaining a class file for org.example.myapp.pages.Start * java.lang.ClassNotFoundException caught an exception while obtaining a class file for org.example.myapp.pages.Start exception org.apache.tapestry.internal.services.TransformationException: Error obtaining injected value for field org.example.myapp.pages.Start.log: java.lang.ClassNotFoundException: org.slf4j.Logger I have the very same error. As soon as I attempt to inject org.slf4j.Logger, I get an exception : 8- exception org.apache.tapestry.internal.services.TransformationException: Error obtaining injected value for field fr.bpi.tapestry.components.ViewUser.logger: java.lang.ClassNotFoundException: org.slf4j.Logger 8- I have use slj4j 1.4.3 and log4J 1.2.14. Have you find a solution to your pb ? -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Re-inject or inherit services in children ?
Howard Lewis Ship wrote: [..] I kind of think that if you can't find a true purpose for the base class beyond a convienient place for the common injections, then perhaps you are on the wrong track. Well, now that you explain me that, I think it's my problem. I almost only use the base page/component as a container for common services/logic. But as you said, it should be better suited to create new services than a base page for that, and only use them where they are needed. I kind of like the list of injections in my components ... it's kind of like a cast of characters in a play. And I completely agree with that. In each component, I use a really visible comment to hilight the injected services : just with that, I can (almost) know what the component is going to do, or at least what may be its side effects. So, it's a really good reason to inject services every time they are really need. Ok, so I should build more unit services, make some facade for logically linked services... Well, just really use the power of Tapestry services ;) Thank you really much for the advices, and I believe I'm going to remove this needless base page :) -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nightly docs fixed - and some general notes
Hello Howard, Howard Lewis Ship wrote: My hatred of Maven is growing quickly. It seems to be a common anti-pattern for Maven... People have been asking a lot about when T5 will be finished. I'm doing some work on it right now, while I'm on vacation. And that is a great news ! I have new clients lined up, so I'll be working in T5 as I finish T5. I'm no longer with Feature50, which means that 100% of my time is now devoted to Tapestry. And that is an even greater new ! I'm happier than I've been in months ... and there's more and more interesting news coming soon about the future of Tapestry. Howard, I hope the best for T5. And I'm really happy to hear that. Thank you - to you and all the Tapestry team - for all the hard and good work :) It's really good to hear such news :) -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tapestry 5 book
Emmanuel Sowah wrote: I read somewhere on the net that there is a Tap 5 book in the works. Where can I get drafts of this work in progress and when would it be released? The book is available in pre-order here : http://www.packtpub.com/tapestry-5/book -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] CSV in Tapestry 5
Alejandro Tapia Lazcano wrote: Hello! Hello, I have a grid made with tapestry5 and I need to pass this data to a CSV (comma separated values). After searching I found this component but for T4. http://www.tapestrycomponents.org/Tassel/app?service=direct/1/Search/viewComponentsp=SmschnyderCSV+Export It is possible to migrate this T4 to T5? No. How?? I need the guide Migrating components T4 to T5 for dummies jajajaja There is no easy migration path, see http://tapestry.apache.org/tapestry5/ , Backwards Compatibility. So, you have a list of elements (say, a list of map) and you want to export there values to CSV ? Just create a simple T5 page that return onActivate() a StreamResponse : (note after writting the code : the code is not very clean (awful cpoy/paste), I wrote it straight in the mail, so it should contains some mistakes and mispellings and that sort of things :). But it's just an example, and event if I haven't tested it, I really think it should work. The main ideas are here, I think Obviously, it would be better to make a component that takes as parameter a list of beans, a bean model, etc. I let it to you as an exercise ;P ). 8 public class CsvExport { public static final String CSV_CONTENT_TYPE = text/plain; public static final String DEFAULT_ATTRIBUTE_SEPARATOR = ,; private static final String linebreak = System.getProperty(line.separator); //the list of element to export to CSV private ListMapString, String elements; //the list of value names to export : ex: name,age private ListString colomns; //the main response, that will export to csv your values public StreamResponse onActivate() { if(null == values || null == colomns || colomns.size() 1) { return new TextStreamResponse(CSV_CONTENT_TYPE, ); } csvLines = new StringBuilder(); //print the first line of the CSV for(String header : colomns) { csvLines.append(header).append(DEFAULT_ATTRIBUTE_SEPARATOR); } csvLines.deleteCharAt(csvLines.length()-1); csvLines.append(linebreak); //loop over lines and print values for(MapString,String values : elements) { for(String header : colomns) { csvLines.append(values.get(header)).append(DEFAULT_ATTRIBUTE_SEPARATOR); } csvLines.deleteCharAt(csvLines.length()-1); csvLines.append(linebreak); } //ok, so now we have the file to return, so we return it. return new StreamResponse() { public String getContentType() { return CSV_CONTENT_TYPE; } public InputStream getStream() throws IOException { return new ByteArrayInputStream(csvLines.toString().getBytes()); } public void prepareResponse(Response response) { response.setContentLength(csvLines.length()); response.setHeader(Content-disposition, attachment; filename=myCSVexortedFile.csv); response.setHeader(Pragma,no-cache); response.setHeader(Cache-Control,must-revalidate, post-check=0, pre-check=0, public); response.setIntHeader(Expires, 0); } }; } } 8- Hope it will help you. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Is Persist(conversation) planned? Please?
Geoff Callender wrote: Hi, Hello Geoff, [... common problem of web...] So, could T5 introduce Persist(conversation) or something similar, and take a whole class of problems away for good? Please, please? I completely agree with your remarks, and it's a kind of pity that T5 is such in advance in so many areas, and in the same time have to deals by hand with that. It was a time were Howard spoke of integrating Spring Webflow in T5, but I'm not sure it handle all the problem you raise, and I don't know if it's still in the TODO list. So I think that the best think to do is log a Jira entry for that, and make people vote for it :) -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Caching: dependency on session data [OT?]
Kaspar Fischer wrote: Dear All, Helllo, If so, my next question is slightly off-topic: How can I implement caching? Lots of data I display on my Tapestry pages is pulled from a DB and this might be expensive. I see two approaches: * Caching in front of T: use some page cache that caches the HTML output by T * Caching behind T: use a caching layer between T and my DB [...] Does anybody have any experiences with a mechansism like this? Are there any caching libraries out there that accomplish this? I haven't any experience in caching a webapp, but perhaps that you can have another solution that is : * cache the object pulled from the DB. For that, you can rely upon the caching system of your ORM, or use a caching library (for instance EhCache : http://ehcache.sourceforge.net). I use EhCache for caching expensive authorization evaluation, and it works well. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: BeanEditForm and collections
Kevin Menard wrote: Does anyone have any hints on getting BeanEditForm to play nicely with collections? For now, BeanEditor (or BeanEditForm) is not really aware of collection as a property. I think it's in the todo list (T5 still alpha, etc ;) So, for now I think that the only solution is to code the matching property editor model or bean model (dependanding of what you want) In my case, when I have a bean with both simple properties and collection properties, I decompose its form with several beaneditor : - one for all the simple properties ; - one for each property witch is a collection. For the second case, I generate a beanmodel for a fake bean in witch each entity of the collection is a property of the fake bean (in my case, I deal only with List, it would be easy to do the same for Map, harder to deal with unordered collection). So, I have a ListStringEditor that permits to edit, add and remove the strings in a list. The properties editor for these string are the standard one. Exemple : I have a bean named Eschema attributes that is composed with several simple properties and a list of possible values. According to the explained decomposition, the EschemaAttributeEditor template looks like : 8-- t:container class=attribute_details xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; t:beaneditor object=attributeDefinition model=model/ t:wui-commons.eschema.listeditor object=attributeDefinition.possibleValues elementClass=literal:org.interldap.ldap.objects.IByteString/ /t:container 8-- The generated html looks like : 8-- [[propertyX]] [[propertyY]] [[propertyZ]] [[possibleValue1]] [delete] [[possibleValue2]] [delete] [add] 8-- (delete and add are buttons, [[..]] are text fields or whatever the propertyeditor say it is). You can look at the Java code her : http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-common/trunk wui-common/src/main/java/org/interldap/wui/t5lib/components/eschema Hum. It seems that the browseCVS is again broken, so you should have to checkout the code : # svn checkout svn://svn.forge.objectweb.org/svnroot/interldap/interldap-wui-common/trunk wui-common and look at : The code that generates a BeanModel given a list : - wui-common/src/main/java/org/interldap/wui/t5lib/data/ListObjectBeanModelSource.java - wui-common/src/main/java/org/interldap/wui/t5lib/data/ListObjectPropertyConduit.java The use case example : * the BeanEditor for the list, with the add/delete buttons and logic : - wui-common/src/main/java/org/interldap/wui/t5lib/components/eschema/ListEditor.java - wui-common/src/main/resources/org/interldap/wui/t5lib/components/eschema/ListEditor.tml * the eschema attribute editor that uses the ListEditor : - wui-common/src/main/java/org/interldap/wui/t5lib/components/eschema/ListEditor.java - wui-common/src/main/resources/org/interldap/wui/t5lib/components/eschema/EditAttribute.tml And yes, I agree that it is over complicated for a simple need, but I couldn't wait for a tapestry 5 native implementation. Note : I gladly wait for any simplifications :) Hope it may help, -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] BeanEditForm validations
Kevin Menard wrote: This is an interesting approach, but way more overhead that I was hoping for. I guess I would have liked to see a way to do this via the PropertyConduit or something. So, I could do model.add(new_prop).addValidator(required); I guess I'll file a JIRA for that. Hello Kevin, Did you move on on this issue ? I think your idea is really the best way to go, and it seems rather simple to add to PropertyEditor. Or perhaps did you find a better solution ? -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ANN] Tapestry 5 book is available for pre-order
Kolesnikov, Alexander GNI wrote: It can be pre-ordered from the publisher's website: http://www.packtpub.com/tapestry5/book That's _really_a good new, congratulations ! So bad that there is no PDF version :/ -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: example for windows
GUERARD Elisabeth wrote: Dear all, I want to begin to use Tapestry, I look at example for quick start, unlucky by looking for example to download it's only unix version at the address: http://howardlewisship.com/downloads/quick-start/ File with tar.gz extenssion. Is there another location where I can find following quick start? Thanks in advance, Eli I believe that archive utilities like 7zip understand this archive type. 7zip : http://www.7-zip.org -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: example for windows
Kristian Marinkovic wrote: i'd recommend you to take a serious look at Tapestry 5. it's much simpler and more efficient to work with. There is also a good tutrial on how to start a new Tapestry 5 project. Kris is completly right, I whould have validate this point :/ So, the quickstart for Tapestry 5 is here : http://tapestry.apache.org/tapestry5/quickstart/ And the tutorial is here : http://tapestry.apache.org/tapestry5/tutorial1/ Hope it may help, -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] BeanEditForm validations
Kevin Menard wrote: Hi, Hello, Is there anyway to configure validation for a BeanEditForm other than with the Validate annotation? I'd like to have validation, but really can't apply the annotations because I'm working with classes coming out of a library. I see at least two other way, one simple and one other a little more complicate. The first one is to use the validate parameter in a property editor override in the BeanEditForm template. See Property Editor Overrides in http://tapestry.apache.org/tapestry5/tapestry-core/guide/beaneditform.html You might also add your custom property editors with their template (and so their fields with validate parameter). The other one is the programmatic way, but you should not need it for common use of BeanEditForm. If you want to customize globaly the validation proces, you may extend the PropertyEditor component and play with FieldValidator and fieldValidatorSource service. You also will have to extend the BeanEditor component template to use you new property editor, and the beanEditForm so that it uses the new BeanEditor. If you want, I have an example of such a thing here : http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-common/trunk/src/main/java/org/interldap/wui/t5lib/components/ldapentry/ A brief description : * MyPropertyEditor is just a copypast of T5 PropretyEditor, with some visibility change on methods, you may forget it ; * ** AttributeEditor ** is a special editor for the kind of attribute I have to deal with in my app. It extends MyPropertyEditor (read PropertyEditor) and It is the intersting component in which my personal validation process is done. Basically, I want to add a required validator if the attribute has a mandatory parameter set to true. * AttributeBeanEditor EntryBeanEditor. I think they are not to interesting for what you want to do, but if you look to their template, you will see that AttributeBeanEditor calls AttributeEditor and that EntryBeanEditor calls AttributeBeanEditor. Hope it will help ! -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] Javascript : integration of DWR ( Was: 3 new French Tapestry5 tutorials )
To begin : #Cyrille37# wrote: Hello, Bonjour, Thanks to Baptiste Meurant ! Merci à Baptiste Meurant ! Thanks for the time spent, and thank you Cyril for the info. As it seems taht javascript integration is a hot topic, I want to highlight that one of the tutorials shows how to integrate DWR with Tapestry 5. The author seems to find it quite easy :) Hope it may bring new ideas to you. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help out Matt Raible: Looking for Web Framework Stories
Howard Lewis Ship wrote: Matt Raible is looking for stories of how people chose a JVM Web Framework and how it worked out for them. I'd encourage all Tapestry users to drop in with a story or two. http://raibledesigns.com/rd/entry/choosing_a_jvm_web_framework1 I reply to this old post to signal that the presentation of Matt Raible is available, and there is some good reference to Tapestr on it : http://raibledesigns.com/rd/entry/choosing_a_jvm_web_framework2 Direct link to the presentation PDF : http://static.raibledesigns.com/repository/presentations/ChoosingAJVMWebFramework-CSS2007.pdf En,joy ! -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 BeanEditForm additional button
Janko Muzykant wrote: hi, i would like to add an additional button (something like 'cancel') to BeanEditForm. how may i do it in the simplest way? thanks, jm. If you want to customize the beanEditForm, I think that the simplest thing to do is to use the beanEditor and use it in you custom form, with what buttons you want. See : http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html#orgapachetapestrycorelibcomponentsbeaneditor and BeanEditForm code to understand how use it. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why Can't I get the 5.0.6?
Eko S.W. wrote: I change the 5.0.5 to 5.0.6-SNAPSHOT But why I can't get it? Is there any new place to store the 5.0.6-SNAPSHOT? The repository for Tapestry Snapshot is : 8 repository idtapestry-snapshot/id urlhttp://tapestry.formos.com/maven-snapshot-repository/url snapshots enabledtrue/enabled /snapshots /repository 8 It is also where the site that follows snapshot evolution is (http://tapestry.formos.com) -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: why Tapestry 5.0.6 hasn't released yet?
Penyihir Kecil wrote: i saw @ http://tapestry.formos.com/maven-snapshot-repository/org/apache/tapestry/tapestry-core/ tapestry 5.0.6-SNAPSHOT development has moved to tapestry 5.0.7-SNAPSHOT. then...why the 5.0.6 hasn't released yet ? The vote for the release of 5.0.6 is not finished (one day remaining, I think), and after that, if it is positive, there is the time taken for publication and synchro. So be patient, but you should not have too much to wait, see : http://tapestryjava.blogspot.com/2007/10/tapestry-506-soon.html -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A Sample Application In Tapestry 5.0.5 with Hibernate 3.2.2 ga Spring 2.0
Sadhana Reddy wrote: This is a sample Apllication of Tapestry 5.0.5 [] Wow ! I think this great mail should be put into the HowTo page : http://wiki.apache.org/tapestry/Tapestry5HowTos. Thank you for the contribution :) -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A Sample Application In Tapestry 5.0.5 with Hibernate 3.2.2 ga Spring 2.0
Francois Armand wrote: Wow ! I think this great mail should be put into the HowTo page : http://wiki.apache.org/tapestry/Tapestry5HowTos. Thank you for the contribution :) OK, I should check before writting : it *is* on HowTos : http://wiki.apache.org/tapestry/OnSubmit Sorry for the noise; -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [5.0.6-SNAPSHOT] Bug? isTraceEnabled missing when I switch to slf4j
Christian Koeberl wrote: followup. Strange thing is - looking at the actuall log4j.Logger - it has an isTraceEnabled, so I'm really unclear as to why this would happen. The problem is the log4j lib in the Jetty ext directory - replace it with the newer log4j (1.2.12 or higher) version. I just spent a moment in this very problem, but the solution was something else, so if it may help other... I use Jetty 6.1.5 with jetty launcher, and for that configuration you have to DL and drop slf4j-api-1.4.3.jar and slf4j-simple-1.4.3.jar to lib/jsp-2.1 directory. And to set my mind at rest, I also deleted previous version of slf4j from lib/jsp-2.0 directory. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tapestry IRC chan
Hello everybody, It's just a little mail to remind every body (and especially new users of this ml) that an IRC channel exists for Tapestry. The chan is : #tapestryonirc.freenode.net There is almost every time 4~8 people here, some of them more than beginner on tapestry 4 or tapestry 5. For example, I'm 'fanf' and I'm used to being present between 7h-16h UTC. So when you have simple question, or think that a chat will fit better your pb, don't hesitate to come. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Comparison
Christian Gorbach wrote: Here's a recent comparison of Wicket and Tap from Ken Tong: http://agileskills2.org/blog/2007/09/my_thoughts_on_the_differences.html cheers c)hristian (I'm sorry, I would have answer on your blog, but it seems that something does not work with typekey login, I get a error message : The site you're trying to comment on has not signed up for this feature. Please inform the site owner.) Well, I mostly agree with the major part of your post, except for the ease of use : a few month ago, I has to choose a new web framework and tested wicket (1.3, first betas) and Tapestry 5. And I found Tapestry 5 far simpler to understand and use than Wicket, with no possible comparison ! So, perhaps previous version of Tapestry used to be hard, but Tapestry 5 is just the simplest Java web framework that I ever used (note: this assertion really depends of my personal background, the fact that I never code any line of Swing but I know Spring/IoC for a long time, and that I only spend some time with Struts, Struts 2, Stripes, Wicket and Tapestry 5). Really, Tapestry 5 has a lot of default, the bigger one being that it's still alpha, but it *is* simple. Being productive with it is a matter of minutes... -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Comparison
Borut Bolčina wrote: Hello, has anyone done a fair comparison of T5, JSF (any incarnation), Wicket or/and any other Java web framework. I Well, realy broad question. You should find some ideas here : http://raibledesigns.com/rd/entry/choosing_a_jvm_web_framework1 and all around the web. Of course, the subject is highly trollistic. Can you please expose strengths and weaknesses of T5 and other players in enterprise environment. Just drop a plus and minus for one or two features. In my point of view, really bascaly, I would say : * Struts 2 / Spring MVC / Stripe : nice MVC, classic java framework. Far better than Struts, but *I* don't like the way they work. More component / event oriented : * JSF : after EJB 2, the new over-engineered Sun tech ... Well, Seam seems to be the best approach to JSF. The big plus : it's a JSR, so eventually, it shall be supported/known by a lots of people. * Wicket : the web is like Swing approach is interesting. Some friends of mine love it, but something with the statefull by default behaviour dislike me (I never did Swing development, perhaps it's a reason) * Tapestry 5 : really simple and nice, I like the IoC (but I was doing Spring/Guice development for almost 6 month before discovering T5), the ease of doing new component. The big minus are : it's still alpha (and so it lacks polish, AJAX, basic components, etc), it lacks a big community/visibility, the migration path between major version is quite frightening (but it should be better from now). Of course, it's my biased opinion. After all, I wouldn't use T5 if I dislike it. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] more tutorials or sample projects?
Robert A. Decker wrote: [...] It looks like those annotation classes exist in the latest version (the svn export) but not in version 5.0.5. What's the old way (version 5.0.5) way of doing: @OrderAfter(lastName) and @OrderBefore(citizen) There wasn't annotation to do this before 5.0.6 (svn), so if you are using 5.0.5, you have to set the order of properties thanks to the beanModel and methods like beanModel.get(propoertyName).order(10), see http://tapestry.apache.org/tapestry5/tapestry-core/guide/beaneditform.html to have more explanations. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: A Hopefully Simple Question About Action Link Scope
Charles Mason wrote: Hi All [..] Hi, [..] The method called by the action link uses the persistent field which stores the actual Match object which the component gets data from. However when ever I use the page and click the action link, its as though the action link is clicked on the last MatchInfo component, even when I click the action link on a different MatchInfo component. Well, I'm not sure that I understand what you do correctly, may you provide the actual code ? As far as I can tell, you persists a field that is used as value for the loop, and so it's always the last MacthInfo that is persists. You may want to have a look at http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html and look how Tapestry deals with context and onActivate/onPassivate methods. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Accessing fields of a form
Hello, I have a form in a page, that is injected as a component in the java code. To validate the form before submission, I want to do something like that : 8 void onValidateFromForm() { try { validate data consistancy } catch (Exception e) { form.recordError(fieldWitchCauseTheError, a text); } 8 But I don't understand how I can find fieldWitchCauseTheError, I don't see any method to access the list of field of the form (and I can't inject fields because they are generated at runtime, or enclosed in other components). anybody know how can I access the fields of a form ? Thanks, -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Two simple questions
Marcus Schmidke wrote: But (1) I still don't understand. Where do I have to put this method? Tapestry convention specify the directory layer for your webapp : tapestryRoot |- base |- components |- mixins |- pages `- services Services should contains a AppModule class, where App is the name you put in web.xml file to configure Tapestry filter. This AppModule is the configuration for the module that represents your tapestry webapp : http://tapestry.apache.org/tapestry5/tapestry-ioc/module.html and its that your declare youre services, as explain here : http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html It used to be a page with the full standard directory layer of a Tapestry 5 webapp (which should be created by the Maven artifact) in http://tapestry.apache.org/tapestry5/tapestry-core/guide/component-classes.html but I just can find it any more. As it is an important convention, it should be clearly written somewhere. Perhaps a page with all convention of Tapestry 5 would be great ? -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Service Module declaration
Kheldar666 wrote: Hi everybody, Hello, My problem is that I don't find a way to tell Tapestry IoC that there is a Module in package A and another in package B. I don't want to use @SubModule in AppModule because the packages a supposed to be plugins (so they can be there or not) and it seems the manifest file can only be used within a jar file (and I can't create a jar file each time I test my plug in :s ) I saw that in a (old) thread : http://mail-archives.apache.org/mod_mbox/tapestry-users/200704.mbox/[EMAIL PROTECTED] But I can't tell you anymore, since a didn't test it. Hope it will help -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Service Module declaration
Thiago H de Paula Figueiredo wrote: On Thu, 06 Sep 2007 10:03:04 -0300, Francois Armand [EMAIL PROTECTED] wrote: I saw that in a (old) thread : http://mail-archives.apache.org/mod_mbox/tapestry-users/200704.mbox/[EMAIL PROTECTED] But I can't tell you anymore, since a didn't test it. Just put a Tapestry-Module-Classes entry in some JAR in your application classpath and Tapestry-IoC will take care of the rest. ;) Yes, that is what the thread explains... -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Service Module declaration
Thiago H de Paula Figueiredo wrote: That thread talks about the manifest in a WAR file, and I was talking about the manifest in a JAR file. :) It makes all the difference. Well, no, the last message of the thread ( http://mail-archives.apache.org/mod_mbox/tapestry-users/200704.mbox/[EMAIL PROTECTED] ) give the solution to create a jar with just a manifest and drop it in the classpath. But we agree that it seems to be the solution :) And this is really convenient: I developed HiberTapestry (http://tapestry-mine.sourceforge.net/hibertapestry/) and, to use it, my application needs no configuration: having the HiberTapestry JAR in the classpath is all I need to do. Tapestry-IoC does the work of locating and loading it. My application doesn't have a compile dependency in HiberTapestry but it uses it. Just wonderful. :) Intersting project, I missed it :) -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help out Matt Raible: Looking for Web Framework Stories
Howard Lewis Ship wrote: Matt Raible is looking for stories of how people chose a JVM Web Framework and how it worked out for them. I'd encourage all Tapestry users to drop in with a story or two. http://raibledesigns.com/rd/entry/choosing_a_jvm_web_framework1 Done :) -- Francois Armand Etudes Développements J2EE LINAGORA SA - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Chinese localization
Angelo Chen wrote: Hi, I'm trying out Chinese localization, I have following: [...] Have you tried this http://wiki.apache.org/tapestry/Tapestry5Utf8Encoding ? -- Francois Armand Etudes Développements J2EE LINAGORA SA - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 questions: adding my own initializations; outputing pre-formatted HTML; tree component; javadoc
Erik Vullings wrote: 3. Related to Q2, are there any T5 tutorials on how to develop a tree component, similar to a grid component? Or does someone already have it? I have an example tree component here : http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-t5/trunk/src/main/java/org/interldap/wui/tapestry/components/Tree.java?view=markuprev=97 And an example of use : http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-t5/trunk/src/t5-test/resources/org/interldap/wui/tapestry/pages/TestTree.html?view=markuprev=139 Basically, the component take a DefaultMutableTreeNode as parameter and print it in a preorder traversal. You can specify a (unique) html element as a level separator. I think it would be a good idea to clean the code and extend it in a more generic way ;) Hope it may help (and sorry for the delay, I missed your post) -- Francois Armand Etudes Développements J2EE LINAGORA SA - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 questions: adding my own initializations; outputing pre-formatted HTML; tree component; javadoc
Erik Vullings wrote: In the end, to create the Tree component ( http://wiki.apache.org/tapestry/Tapestry5TreeComponent) ho :) I didn't make the link between this page and you :) I just opened a Jira issue to ask for the addition of a Tree element in the code lib, so that every users may use the same base in place of reinventing the wheel. Moreover, if the core developers are ok to add such a component, we may hope that it will be more generic, idiomatic of Tapestry 5, deeply tested, etc than ours. I post our two reference implementations as examples. -- Francois Armand Etudes Développements J2EE LINAGORA SA - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Recursion of components
Hello Todd, Todd Orr wrote: I'm also trying to perform this type of recursive structure. I don't agree that this makes anything simpler. Recursion is a powerful and concise tool for these situations. I will say that it is often abused, but this is a perfect use case. A recursive solution to this problem is far simpler and maybe more correct than this iterative approach. I read again my post and saw that I didn't express myself properly (put it on my low level in English). I should have write :The non-support of recursive structure seems to bring a lots of simplification with it _for Tapestry internal, replication and performance problematics_. It seems to be a design choice, and as I'm not a Tapestry developer, I can't explain exactly why it was done, even if replication/pool of pages seems to be around. I came from functional programming projects where this kind of structure is quite common, so personaly, I find that it's a real lake. First off, the proposed solution requires complicated logic. Fine, it's not rocket science, but the recursive alternative (if there was one in tap) is far easier to read and understand. From a tech-management point of view the simplicity of the code is a major factor in its long term maintainability as well as its bugginess. Secondly, the proposed solution requires adding raw HTML output to code. This may be a more esoteric and arguable point, but Tapestry excels in having a clear and easy to use separation between the view/presentation and the logic components of the application's construction. Again, with regards to maintainability, it is twice as hard to maintain code if the concerns are spread throughout conceptually separate pieces of code. If you look at the source code for for component, you will see that it is far from being trivial. It also deals with raw output, and different case are need if the loop is in a form or not... But the use of for component is quite simple. You could design a Tree component that handle this stuff and just use it elsewhere in a simple way. with a clear separation between template using this component and the component. It's what I did in a tree component : http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-t5/trunk/src/main/java/org/interldap/wui/tapestry/components/Tree.java?view=markuprev=97 Third, this approach makes it impossible for any node in the tree to contain any non-trivial nested components. I see that you can create links...wow. Kinda limiting if you ask me. This limits the usefulness and extendability of the code. If more complex functionality is required (lets say by a major client or some other critical business need) within this pseudo-recursive implementation it might force the developers to completely switch out frameworks to one more suitable for the job. This is a huge risk from a business perspective. Ok, so here, the problem is that the tree component is not well designed (or not as much generic as it should be). Perhaps a real tree component in standard lib would be good. But it has little to do with the lack of recursion structure, that is painful. A tree structure would be (at best) a bypass for this lack. -- Francois Armand Etudes Développements J2EE LINAGORA SA - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Edit List in BeanEditForm
Hello, I would like to know if there is a (rather simple) way to add support for list edition for bean used in BeanEditForm. I would like to be able to add/remove element from list, and edit them. For example, my UserBean has a phonenumber property, witch is a ListString. I would like that the bean edit form present something like : --- [phonenumber1] _remove_ [phonenumber2] _remove_ _Add_a_PhoneNumber_ --- Or at least the input field for each element of the list. I do not really understand how works conduit, and I can't find documentation on them... Any help would be appreciated. -- Francois Armand Etudes Développements J2EE LINAGORA SA - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Security of files in the classpath
Thiago H de Paula Figueiredo wrote: Would a black list intead of a white list better? I suppose there are less files to hide than files to allow access. Well, I think that one of the best principle in security is explicit authorization : you just do not want that a confidential file is accessible by error, because a user forgot to hide it. But I agree that the white list should authorize jokers to enable *.jpg kind of filter (and if you name your confidential file picture_of_my_secret_weapon.jpg, well, to bad for you ;) -- Francois Armand Etudes Développements J2EE LINAGORA SA - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 Component Info Passing
liFound: ${id}/li /t:loop /ul t:parameter name=else pNo id registered in env/p /t:parameter /t:if /div 8-- == Several details need to be investigate : why the first t:printregistered/ is empty (something to do with the render phase order), and if you want to only have declared id, perhaps use client in place of component id. But I think that it roughly mathc what you want to do. Hope it may help ! -- Francois Armand Etudes Développements J2EE LINAGORA SA - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Recursion of components
Dmitry Sidorenko wrote: Hi all. Hi, In my project I need to generate edit form for a class like this: class Section{ ListSection subSectionList; ListField fieldList; } [...] Probably I'm doing something wrong, maybe my task should be done in completely different manner.. Any ideas? Is there any way to develop visual editor for such a recursive classes? I don't know how T4 works, but if it's like in T5, their is no support of recursive template/class. So, for tree structure, you have to use a non-recursive algorithm (I think that in your example, you wish to use a non-recursive preorder traversal). It's not really natural, but the non-support of recursive structure seems to bring a lots of simplification with it. You can look at this How To entry : http://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponents I wish it would help. Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to add a List support for BeanEditor?
Dear list, It would be great if BeanEditor support collection and map properties, or at least List. Functionally, for this kink of properties, one wants to be able to add/remove elements from the collection and edit them. Programatically, it seems to be an hard problem... I would like to explore with you how to bring this support to bean editor, because I think that the need is real. For my personal example, I had to do that for a CRUD application on LDAP entries. LDAP entries are lists of attributes, and attributes are lists of values... To achieve my goal, I had to develop a complete specific component (base on the model of BeanEditor) which handle a specific entryBean. But the result seems to be quite specific and tricky (the code is available at http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-t5/trunk/src/main/java/org/interldap/wui/tapestry/components/ldapentry/EditForm.java?view=logrev=120 for the edit component, and http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-t5/trunk/src/main/java/org/interldap/wui/model/EntryBean.java?view=logrev=120 for the special bean, but this code is completely out of date in the _viewSVN_, the forge (ObjectWeb) is in migration and it seems to no go too smoothly... Thought, the svn is up to date.) Ok, so if you are interested, we may see what we want to do, and how we can help implement it. - Functionnaly, I wish to have that : I have a bean with a list of SomeType (say String) : ListString fruits; (for instance [apple, lemon]) I want that the beaneditor construct this interface ( where [...] is the editor matching String type) : 8--- [ apple ] _remove_this_fruit_ [ lemon ] _remove_this_fruit_ _Add_a_fruit_ 8--- so, the question are What are the major difficulties, and how can we implement that ? Perhaps it just a special editor, which handle list type, but I don't see how to coerce objects in the list, and how to get/set/add/delete them... any ideas would be appreciated :) Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] There is an example of T5 + Acegi + CAS
Hello, I just did a toy application to see how Acegi Security works with CAS, and since Tapestry 5 is so pleasant to use, I did the example with it. Perhaps it would interest some users, so the tuto is here : http://wiki.interldap.objectweb.org/xwiki/bin/view/Main/Tapestry5HowToAcegiCas And the application is available on svn with anonymous access : 8--- svn co svn://svn.forge.objectweb.org/svnroot/interldap/acegi-cas-client 8--- Enjoy ! Francois Armand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Set component parameters from page class
Martin Dietze wrote: Hi, I'd like to set some component paramameters (disabled for inputs) from within my page classes. As far as I've seen so far the usual way to do this would be to put a name=${prop:value} attribute into my template. Can this also be done by using a simple setter in my Java code? This would improv the templates' readability a lot! I'm not sure I have correctly understood your concern, so excuse me if I answer to something else ;) When you have a component with parameter, you have two way to specify it the actual parameter value : - in the template, with paramname=bindingtype:value ; - in the java code, thanks to @Component(parameters =... tag. You can find documentation here : http://tapestry.apache.org/tapestry5/tapestry-core/guide/component-classes.html http://tapestry.apache.org/tapestry5/tapestry-core/guide/parameters.html Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Set component parameters from page class
Martin Dietze wrote: Yes, this is how I found it in the documentation. However I'd like to be able to do something like: | @Component(id=myInput) | private TextField _myInput; [...] | _myInput.setDisabled(true); You can use parameter expansion in Java code : 8--- @Component(parameters=disabled=prop:isdisabled) private TextField textField; public boolean getIsdisabled() { return disabled; } @SetupRender void setup() { if(should de disabled) { disabled = true; } else { disabled = false; } } 8- Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Will it be a full stack framework?
Todd Orr wrote: [] More to the point, I believe that Howard and the Tapestry developers will be utilized as development resources most effectively if the focus remains on creating the #1 MVC framework. Thanks a million guys! Just to continue arguing in this way : I use Tapestry 5 to build an LDAP manager web application, and I really don't care to have a full stack framework for that, because this kind of framework not event know what LDAP is... As soon as you step aside from the most common use cases, these framework are useless. In fact, I choose Tapestry 5 because it does it job _very_ well, but it just do it (there was other pretenders, but certainly not SEAM, RIFE or *rails). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] missing some listener to bind component/page events ?
#Cyrille37# wrote: In another way to explain, I would like to make by hand the same work than a t:actionLink in a t:loop the code : t:loop source=1..10 value=guess t:actionlink t:id=guess context=guess${guess}/t:actionlink /t:loop create several links like : /do.guess/4 /do.guess/6 /do.guess/7 So, howto do the same by hand (without a loop) ??? You can use list in context. For example, if you have a ListstringgetGuessContexte() { ListString list = new ArrayListString(); list.add(plop); list.add(new Integer(guess).toString()); return list; } In your : t:actionlink t:id=guess context=guesscontext${guess}/t:actionlink You will have link : .../do./guess/plop/0, .../do.guess/plop/1 etc. See http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html#org.apache.tapestry.corelib.components.actionlink Well, if anybody as an idea about how to do this kind of think with submit button, I'm interested :) Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] How to retrieve the id of an event emitter in handler method ?
Francois Armand wrote: Hello, I would like to know how I can retrieve the ID of the component which triggered an even when I'm in an event handler method ? [] I'm still interested by an hint on this topic... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] How to retrieve the id of an event emitter in handler method ?
Ulrich Stärk wrote: Nick, there is no difference whether your event method gets triggered upon clicking a link or a button. Except that you can pass parameters like an index when using actionlink. And that's exactly what you want. Ok, but if the data are not transmitted to the server, we are not going anywhere. My use case was : I have a form with a list of text field, for each field a delete (link|button), and a submit button. I want that if an user modify some fields and then click to delete (without submitting the form), the matching value is deleted _and_ other modification are kept. To achieve that, the field values have to be transmitted to the server, what is not done with an action link. So, Nick Westgate point out the good solution (I think), I just need to be done ;) Just to be sure : there is no other solution than to use javascipt to do that ? I was thinking that as Tapestry handle the form action link, it would be possible to add a context to submit button, as example : :tform t: submit t:id=context context=value t: submit t:id=submit /t:form With submit from submit button mapped to action link myformcomponent.form and context button mapped to myformcomponent.form/value, and in Java code, context available as now for action link : onSelectedFromContext(String value) {...} But I have absolutely no idea on the feasibility of that. Between, thanks for the advice and your propositions ! Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] How to retrieve the id of an event emitter in handler method ?
Nick Westgate wrote: Ok, here is a solution. Took me 5 minutes to write, 20 mins to test. ;-) Oh. I should have attempt to do it :) thank you very much, works like a charm :) Yeah, this is exactly what I have implemented. Eventually a shared hidden input should probably be used, but I can't see (or perhaps grok) the form support for this yet. Also a context that is a list of objects was my plan, but the context passivation is all internal and relies on the TypeCoercer stuff which is a bit involved. This should do for a first cut. Well, I need at least to deals with ListString argument, even if it is as a (two) simple way, so a change your code as wrote at the end of the message. The string of the list are concatenated in the same way a for an action link (ex: value0/value1/value2) so that in the event handler, a split give me the different argument. Well, it's clearly not robust, it would be better to use TypeCoercer and some other remarks, but for now, it would be greatly better to use. Thanks again for your time ! And thanks to Tapestry developers for the ease of use of T5 ! The code : 8- @Parameter private String _context; == @Parameter private ListString _context; 8- 8- void beginRender(MarkupWriter writer) { // write a hidden input for the context String elementName = getElementName(); writer.element(input, type, hidden, name, elementName + X, value, _context); writer.end(); // now the submit writer.element(input, type, submit, name, elementName, id, getClientId()); } == void beginRender(MarkupWriter writer) { /* convert context to a string : context[0]/context[1]/context[2] ... */ StringBuilder contextStringBuilder = new StringBuilder(); if(null != _context) { int j; for(int i = 0; (j = _context.size()-i) 0 ;i++) { contextStringBuilder.append(_context.get(i)); if(j 1) { contextStringBuilder.append(/); } } } // write a hidden input for the context String elementName = getElementName(); writer.element(input, type, hidden, name, elementName + X, value, contextStringBuilder.toString()); writer.end(); // now the submit writer.element(input, type, submit, name, elementName, id, getClientId()); } 8- Diff it to Submit and you'll see it's only a few extra lines. Hope it helps. Cheers, Nick. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] missing some listener to bind component/page events ?
#Cyrille37# wrote: Thank you François, The problem is not on the component context, but on the component id. Oups ^^ I think a listener concept is missing ! Another example : (This code is invalid because of the duplicate component id) html t:actionlink t:id=want2beRich context=trueYES/t:actionlink t:actionlink t:id=want2beRich context=falseYES/t:actionlink /html java Object onActionFromWant2beRich( boolean yes ) { ... } /java Ok, now I better understand your concern. You would have a kind of group notion for action event ? Somethink like that : 8-- t:actionlink t:gid=want2beRich t:id=foo context=trueYES/t:actionlink t:actionlink t:gid=want2beRich t:id=bar context=falseYES/t:actionlink 8-- And the event handler onActionFromFoo match first link, onActionFromBar match second link, and onActionFromWant2beRich match both. I don't think this kink of feature exists for now, but you can take advantage of event bubbling to achieve your need : just create a trivial component Want2beRich : 8-- java: public class Want2beRich {} html: div xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; t:actionlink context=trueYES/t:actionlink t:actionlink context=falseNO/t:actionlink /div 8-- and use it on your parent component/page : t:want2berich/, with the corresponding event handler onActionFromWant2berich. Well, it seems that the risk is to have a batch of component with this solution... Nonetheless, I hope it will help you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Will it be a full stack framework?
Robert Sanders wrote: I certainly don't think that tapestry-core should ever be a full stack, but I hope that there is eventually something like the quick-start which allows new users to generate a quick and dirty CRUD application very easily (it would be nice it this were less typing than the standard maven command line as this is off-putting to most new comers, but copy-in-paste does work wonders), no one should expect such quick-starts to be full-strength applications, but it would provide a great way to get someone new (like myself) up-to-speed and productive. The power of annotations would seem to be to enable this via IoC without dumping any additional logic into the tapestry-core code base. Oh, ok :) My personal thought are that this kind of application will come to life in a near future... It already exists Trails (http://www.trailsframework.org) for Tapestry 4, and well... Tapestry 5 seems to be so pleasant and so powerful... Just need to be done by someone ;) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Component Cheatsheet
David Peterson wrote: I put together a simple cheatsheet for the Tapestry 5 component parameters and the rendering cycle. I've been finding it useful, so I thought I might as well stick it on the web in case you find it useful too... http://www.davidpeterson.co.uk/files/tapestry5/t5-component-cheatsheet.pdf Thank you very much ! It seems that I would have at least two tab currently opened closed since now :) Farncois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Will it be a full stack framework?
Kalle Korhonen wrote: Tapestry 4 isn't far behind in powerfulness and in some areas way ahead, but certainly with a higher learning curve. Well, I'm just a beginner with Tapestry 5, and don't even had a look to Tapestry 4, so my notice was just about the thrill I have to use T5 :) (I'm coming from a world of Struts and even worse home-made framework... just imagine that) Supporting Tap5 is a constant topic within Trails, but the reality is that it's a preview and will take some time to reach the maturity level of Tap4.x. That's clear, and your position seems to be quite sensible. In the meantime though, we are hard at work for upgrading to Tap4.1.2 in Trails. We'll evaluate Tap5 again when a final release comes closer. That sound great, thanks for your work and for you reply ! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 How reach Sub components informations
David Avenante wrote: Hi, I try to create a component with embedded sub component. How can I access in my root component to the informations about my sub components ? You can access sub component trough ComponentResources 8 @Inject private ComponentResources resources; resources.getEmbeddedComponent(embeddedId) 8 Take a look at http://tapestry.apache.org/tapestry5/tapestry-core/guide/inject.html and http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/org/apache/tapestry/ComponentResources.html for more details. Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Generic page classes with beaneditform
Howard Lewis Ship wrote: There's an existing bug for this. I'm not sure how fixable it's going to be; welcome to the implementation nitty gritty of generic types and type erasure. Just cause you don't see the typecasts doesn't mean the compiler has put them there. Here's a challenge: what if there was a createWidget() method on your class. How would you implement it, to create an instance of the correct class? You can't do a new T() (the compiler won't let you, since it doesn't know what T is). As you say, the wonderful type erasure feature implies that you have to have more information about your type. For instance, you need to pass a ClassT type to your create() method. Actually, it's not really an acceptable solution, but the sole workaround I know (if somebody as another idea, I would be glad to use it). After that, you can use reflection : 8- public class EditWidgetPageT extends Widget { T widget; T create(ClassT type) { widget = type..newInstance(); } } 8- A bunch of infos are available at www.angelikalanger.com FAQs, and more precisely about your concern : http://www.angelikalanger.com/GenericsFAQ/FAQSections/ProgrammingIdioms.html#How%20do%20I%20pass%20type%20information%20to%20a%20method? Hope it may help... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Generic page classes with beaneditform
Francois Armand wrote: Actually, it's not really an acceptable solution, but the sole workaround I know (if somebody as another idea, I would be glad to use it). Well, this sentence is not true. You may ask users to implement a factory interface for Class they intend to use as parameter type for the bean component source object. The interface should be like that : 8-- interface FactoryT { T create(); } 8-- And then you just call the create() implementation. The problem is that that solution is very error prone : the interface base implementation has to be overridden by each subclass or you will end with the same type problem. So, it seems to be a wore solution than the other one... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] How to retrieve the id of an event emitter in handler method ?
Hello, I would like to know how I can retrieve the ID of the component which triggered an even when I'm in an event handler method ? Well, perhaps that my problem is not this problem, so there is a little background to help you to decide... In my application, I have to create a component to manage an editable list of string. The available (functional) actions are add a string, remove a string, edit string. I need to present the edit form so that all action can be done in the same page : 8--- (note: string? are input text field) | string1 | _delete_ | string2 | _delete_ | string3 | _delete_ _add_a_value _submit_change_ _reset_ 8--- So, there's no real problem to do this : in the html template, I used a form component, with a loop component which goes through the list. I want that if an user edit some field and then want to add/delete a value, his modification are kept, so _add_a_value_ and _delete_ are submit button. The template looks like : 8--- t:loop t:source=range t:value=index p input t:type=TextField/ t:submit t:id=remove value=Remove/ /p /t:loop t:submit t:id=add value=Add/ ... 8--- In the Java code, I have two event handler : onSelectedFromAdd() and onSelectedFromRemove(), and they are called when matching button are submitted. But for the delete button, I don't know which one was really submitted. I would be happy if I can retrieve the id of the submitted remove: I can generate it so that I can retrieve the matching value to remove. An other option would be to pass a context to the submit event, but I don't think it's possible... So, if you have any idea to help me, they will be well-appreciated... Francois Armand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5 : wiki howto contribute custom propertyeditblock for beaneditform
Hello guys, I have implemented an example of a custom propertyEditBlock for the bean component, to see how it could work. As I think that I'm not the only one in that need, I contribute an how-to to explain what I understand : http://wiki.apache.org/tapestry/Tapestry5HowToCreateAPropertyEditBlock In fact, that block editor is quite simple (it's a kind of toy example for a component which have to work with beanPropertyEditor), but perhaps it may help other user to begin with BeanPropertyEditor implementation. Its goal is to generate a drop down list from a list of strings (it should be easy to generalize to type T, as explain in another wiki how to). The list of options is encapsulated in an object whose type is used in contributeDefaultDataTypeAnalyzer. String of the list are used as option for the select. The links to the complete code seem to be broken for know because the viewcvs of the Object Web forge hosting the code is not up to date with the last commits, but it should be resolve as soon as batch runs. Don't hesitate to ask me if you want some precisions or if you don't even understand a single word of what I wrote, my English is quite rough... Francois Armand http://interldap.org http://linagora.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5 class reloading
Le mercredi 30 mai 2007 à 07:28 +, Martin Grotzke a écrit : For me changed classes are not picked up automatically, when running mvn jetty6:run... If it's working for you, what's your setup, or did you do anything special to support class reloading? Is it connected with a context reload of your servlet container (what AFAICS should not be necessary)? Well... I encounter some strange behaviour with mvn jetty:run and class reloading. It works perfectly at my work, and jetty fire some exception about unimplemented class reloading functionality in fresh install of eclipse 3.2 at home. So, the way that seems to just work is to use jetty 5 + jetty launcher plugin, as show in the tutorial ( http://tapestry.apache.org/tapestry5/t5-tutorial.pdf ), and let mvn apart for that task. If some one has a procedure to have mvn jetty:run + jetty 6 (0 or 1) + class/template reloading work, or just can explain what factors make it work or not, I will be glad to know them. Hope it will help, Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] xforms component ?
Hello, I continue my investigation with Tapestry 5 and enjoy it. My targeted application will have to use a lot of XForms forms and I wonder if an Xforms support is envisaged in Tapestry 5, perhaps as a kind of BeanEditor component. Well, perhaps that an XForms integration with T5 is a whole project, and quite a huge task. Moreover, all that's XML is not too in the Tapestry 5 way... Nevertheless I would be very interested with any information on how XForms and Tapestry 5 could cohabited. Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Tree component and recursive component ?
Le jeudi 03 mai 2007 à 11:56 -0700, Howard Lewis Ship a écrit : I was just thinking about some of this on the way in. If you @Inject the ServiceResources into your Tree component, you can ask it to generate action links for you. Handy! Well, I succeeded in doing something... And Tapestry 5 is just amazing ! Now, I have a Tree component witch take a DefaultMutableTreeNode as parameter and walk trough it in pre-order order, adding element at each level swich, and write what I want for each node. For exemple, if myTree has this structure : 8- root |- node1 ||- node11 |`- node12 |- node2 `- node3 8- and it is passed to my component in a template such as this : 8- t:tree source=mytree currentnode=node levelelement=ul li t:actionlink context=node.toString() ${node.toString()} /t:actionlink /li /t:tree 8- The rendered html will be : 8- ul lia..root/ali ul lia..node1/ali ul lia..node11/ali lia..node12/ali /ul lia..node2/ali lia..node3/ali /ul /ul 8- I'm a total beginner to T5 but that took me not a full day to understand T5 base principles and code it... Wow. Really, Tapestry 5 is exiting. Thanks for it, and I can't wait for the final version :) Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] Tree component and recursive component ?
Hello everybody, I'm a beginner with Tapestry (and T5), and test it as a possible framework for a futur application. I have tested T5 for 3 days and for now, I'm really impressed by it. But I came to my first real problem (all others are related with the lack of documentation, which is quite normal for an alpha release). My application deals with LDAP directories, so I need to managed tree structures all the time. But I saw that recursive component are not allowed in T5, I think it is due to the Principal 1 -- Static Structure of T5. So, my question is : is there a way of implementing recursive component ? If not, is there an existing component implementing a non-recursive tree walk ? And if not, have you some advices about doing such a component in T5 (say I know an algorithm for non-recursive tree walk, what are the best practice in T5 ?) Thanks you for your work, it's already quite impressive, and I hope it will continue in this path. A last remark from a new tapestry(ies ?) user : it's a bit disturbing to have 3 or 4 version of tapestry cohabiting, compatible or perhaps not... It's a pain to find valid information, or just to find where to look. Ok, Tapestry already has a (great) history, but T5 is something really new, different and exiting. I think it would be great that T5 will be clearly presented as that, with its own user list, community, wiki, etc, and not as just a new version of an old framework (even if this old framework was a breakthrough one, because t5 is a new breakthrough, isn't it ?) But well, it's just my user point of view ;) Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Tree component and recursive component ?
Le jeudi 03 mai 2007 à 10:27 +0200, Francois Armand a écrit : Hello everybody, So, my question is : is there a way of implementing recursive component ? If not, is there an existing component implementing a non-recursive tree walk ? And if not, have you some advices about doing such a component in T5 (say I know an algorithm for non-recursive tree walk, what are the best practice in T5 ?) Ok, I found that : http://tapestry.apache.org/tapestry5/tapestry-core/guide/dom.html and I can render my tree with ul/li tags thanks to MarkupWriter. But now, I want to add actionlink around each node content (the string enclosed by li tags). How can I do that ? I think I can copy the code from ActionLink, but perhaps there is a better method (well... Now that I begin to play with MarkupWriter, I certainly have to use it for everything...). Any advice would be appreciated :) Francois - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]