Re: How to overridide DoubleTranslator as DoubleTranslator is not localized
I voted and really hope that it will be corrected. I repeat my question here once more if Howard misses it in the Jira: Is there a good reason not to let developers to override the default translators? - 99 Ulrich Stärk wrote: I'm having the same issue, see here: http://markmail.org/message/jtzc7doxqcbn7ac7 I'm working with a patched version of Tapestry, using a patch I provided here: https://issues.apache.org/jira/browse/TAPESTRY-2457 Another workaround could be to provide all of your fields that shouldn't use the default translators with your own one. You'll have to instantiate these custom translators on every page where you need them with the user's current locale. This is cumbersome but right now the only way I see. If you want to use the BeanEditForm with your own translators you'll have to overwrite the editors for the respective properties. See the Property Editor Overrides section here: http://tapestry.apache.org/tapestry5/tapestry-core/guide/beaneditform.html Maybe Howard will include my patch or fix this in some other way if enough people vote for the issue so you might consider voting for it. Uli 9902468 schrieb: Hi! How can one override the default double translator in Tapestry 5? I want to replace the default altogether, but have found only instructions how to contribute new ones. Why the add method in configurations doesn't replace the existing ones? Now it gives warning and doesn't override the default ones. And why the default double translator doesn't use numberformat and Tapestry's locale to output the number correctly? (And parse for that matter?) This is a flaw in otherwise nicely localized application, any thoughts? - 99 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/How-to-overridide-DoubleTranslator-as-DoubleTranslator-is-not-localized-tp18133977p18148964.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] About core components subclassing and methods with package visibility
Thiago H. de Paula Figueiredo wrote: [...] Question to Howard: instead of having package visibility, could the core components have methods with protected visibility? And could their fields hava protected getters, so component subclasses can access superclass' parameter values? Or the current situation is the best one? I faced exactly the same problem when I was playing with a personnal beaneditor : at the end, the only solution I found was to copypaste the beanEditor class, change visibility to protected and add one or two protected getters Thiago : perhaps a bug report for that would be better than a simple message in the list (so we can 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: About the value of the parameters
1. @Component(parameters = {onClick=confirmMessage}) public String getConfirmMessage() { return messsage.get(key-name); } Just refer that, I haven't tried for it yet. 2. Or you can define your own binding prefix. Thanks! DH - Original Message - From: 滕训华 [EMAIL PROTECTED] To: 'Tapestry users' users@tapestry.apache.org Sent: Friday, June 27, 2008 2:52 PM Subject: About the value of the parameters Hi,everyone @Component(parameters = {onClick=literal:return confirm(\do you want to delete this record?\);}) The string “do you want to delete this record?” that I want to read it from the properties file,how to do it? I am using the t5
[T5] Ajax request and expired session
hi, i'm curious how you handle situation when ajax request is being sent but page fragment cannot be rendererd because it depends on session which has expired in a meantime. here is typical request flow in my application: * users clicks actionLink linked with some zone * acegi detects no credentials in session (session has expired) * acegi redirects to login page * but hey! this is still XHR. rendered page returns to client * ...and nothing changes. we got entire login page in response but it is useless as it will be not displayed. i have no idea how to solve that problem. could you suggest something? thanks, jm. -- View this message in context: http://www.nabble.com/-T5--Ajax-request-and-expired-session-tp18150477p18150477.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Javascript at the bottom of page
Hi This has been an issue for a while now - we're using prototype etc. to manipulate elements in some of our pages but can't access it due to it being loaded at the end of the page. I have read on these forums before that javascript should be loaded at the end of the page to increase load speeds, however this should only be done when javascript isn't used for changing the layout of the page - could tapestry please change this behaviour as it's creating a major headache for us (and I'm sure a lot of others). Thanks -- View this message in context: http://www.nabble.com/Javascript-at-the-bottom-of-page-tp18152871p18152871.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Javascript at the bottom of page
I'm having a similar issue, with the @IncludeStylesheetLibrary. This annotation inserts the script tag at the end of the page, but i need to put it at the beginning... There's any solution or at least a workaround for this? On Fri, Jun 27, 2008 at 8:10 AM, lebenski [EMAIL PROTECTED] wrote: Hi This has been an issue for a while now - we're using prototype etc. to manipulate elements in some of our pages but can't access it due to it being loaded at the end of the page. I have read on these forums before that javascript should be loaded at the end of the page to increase load speeds, however this should only be done when javascript isn't used for changing the layout of the page - could tapestry please change this behaviour as it's creating a major headache for us (and I'm sure a lot of others). Thanks -- View this message in context: http://www.nabble.com/Javascript-at-the-bottom-of-page-tp18152871p18152871.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Atenciosamente, Marcelo Lotif Programador Java e Tapestry FIEC - Federação das Indústrias do Estado do Ceará (85) 3477-5910 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] Instantiate Interfaces
Hello, When i use Tapestry, almost my Bean are Interfaces (ex : UserImpl implements User ). That causes me a problem sometimes, specially when using BeanEditForm (ex : with @Parameter private User _user ). When I submit the form after editing a User, I have this error : Exception instantiating instance of org.libermundi.User (for component 'Index:beaneditform.editor'): Class org.libermundi.User does not contain a public constructor needed to autobuild. This is normal ! User is a interface... So, how do I tell Tapestry how to instantiate such objects ? I tried with Alias... doesn't work at all. The only way I could make this work is when the User is an ApplicationStateObject because I contribute to the ApplicationStateManager. Any idea ? Am I wrong when trying to make everything an Interface ? Thanks for your answers. Regards, Martin -- View this message in context: http://www.nabble.com/-T5--Instantiate-%22Interfaces%22-tp18153603p18153603.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Javascript at the bottom of page
hi, there was a conversation recently on this mailinglist. please take a look at http://tapestry-user.markmail.org/search/?q=#query:+page:11+mid:whqzqhu6pjvyjhca+state:results g, kris Marcelo Lotif [EMAIL PROTECTED] 27.06.2008 13:30 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: Javascript at the bottom of page I'm having a similar issue, with the @IncludeStylesheetLibrary. This annotation inserts the script tag at the end of the page, but i need to put it at the beginning... There's any solution or at least a workaround for this? On Fri, Jun 27, 2008 at 8:10 AM, lebenski [EMAIL PROTECTED] wrote: Hi This has been an issue for a while now - we're using prototype etc. to manipulate elements in some of our pages but can't access it due to it being loaded at the end of the page. I have read on these forums before that javascript should be loaded at the end of the page to increase load speeds, however this should only be done when javascript isn't used for changing the layout of the page - could tapestry please change this behaviour as it's creating a major headache for us (and I'm sure a lot of others). Thanks -- View this message in context: http://www.nabble.com/Javascript-at-the-bottom-of-page-tp18152871p18152871.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Atenciosamente, Marcelo Lotif Programador Java e Tapestry FIEC - Federação das Indústrias do Estado do Ceará (85) 3477-5910 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Instantiate Interfaces
a possible solution is: add to your application module class public static void bind(ServiceBinder binder) { binder.bind(User.class, UserImpl.class); } 2008/6/27 Kheldar666 [EMAIL PROTECTED]: Hello, When i use Tapestry, almost my Bean are Interfaces (ex : UserImpl implements User ). That causes me a problem sometimes, specially when using BeanEditForm (ex : with @Parameter private User _user ). When I submit the form after editing a User, I have this error : Exception instantiating instance of org.libermundi.User (for component 'Index:beaneditform.editor'): Class org.libermundi.User does not contain a public constructor needed to autobuild. This is normal ! User is a interface... So, how do I tell Tapestry how to instantiate such objects ? I tried with Alias... doesn't work at all. The only way I could make this work is when the User is an ApplicationStateObject because I contribute to the ApplicationStateManager. Any idea ? Am I wrong when trying to make everything an Interface ? Thanks for your answers. Regards, Martin -- View this message in context: http://www.nabble.com/-T5--Instantiate-%22Interfaces%22-tp18153603p18153603.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- with regards Sven Homburg http://tapestry5-components.googlecode.com http://chenillekit.googlecode.com
Re: [T5] Instantiate Interfaces
There currently isn't a *global* mechanism to map an interface to a class so that BeanEditForm can instantiate it for you. Instead, you can add an event handler to your page for the prepare event. This method is responsible for preparing the page for either rendering a form, or submitting a form. You can add code to instantiate the UserImpl object there. Sven's option looks wrong; that's how you define a service, which is orthogonal to your problem. On Fri, Jun 27, 2008 at 4:58 AM, Kheldar666 [EMAIL PROTECTED] wrote: Hello, When i use Tapestry, almost my Bean are Interfaces (ex : UserImpl implements User ). That causes me a problem sometimes, specially when using BeanEditForm (ex : with @Parameter private User _user ). When I submit the form after editing a User, I have this error : Exception instantiating instance of org.libermundi.User (for component 'Index:beaneditform.editor'): Class org.libermundi.User does not contain a public constructor needed to autobuild. This is normal ! User is a interface... So, how do I tell Tapestry how to instantiate such objects ? I tried with Alias... doesn't work at all. The only way I could make this work is when the User is an ApplicationStateObject because I contribute to the ApplicationStateManager. Any idea ? Am I wrong when trying to make everything an Interface ? Thanks for your answers. Regards, Martin -- View this message in context: http://www.nabble.com/-T5--Instantiate-%22Interfaces%22-tp18153603p18153603.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Hibernate and services
Dependends on the version of Tapestry. Earlier versions included an automatic commit. On Thu, Jun 26, 2008 at 7:44 PM, Angelo Chen [EMAIL PROTECTED] wrote: Hi, As what I understand now that transaction has to be committed to persist the objects, following is a diapatcher, there is no commit, but the new PageLog got persisted too, any idea? thanks, Angelo public class LoggingDispatcher implements Dispatcher { private final HibernateSessionManager sessionManager; public LoggingDispatcher(ApplicationStateManager asm, RequestGlobals requests, HibernateSessionManager sessionManager, IPLookup ipLookup) { this.sessionManager = sessionManager; } public boolean dispatch(Request request, Response response) throws IOException { PageLog log = new PageLog(); sessionManager.getSession().save(log); return false; } -- View this message in context: http://www.nabble.com/T5%3A-Hibernate-and-services-tp18147187p18147187.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Hibernate and services
Hi, This is version 5.0.13, and I turned off the auto commit, property name=hibernate.connection.autocommitfalse/property Howard Lewis Ship wrote: Dependends on the version of Tapestry. Earlier versions included an automatic commit. On Thu, Jun 26, 2008 at 7:44 PM, Angelo Chen [EMAIL PROTECTED] wrote: Hi, As what I understand now that transaction has to be committed to persist the objects, following is a diapatcher, there is no commit, but the new PageLog got persisted too, any idea? thanks, Angelo public class LoggingDispatcher implements Dispatcher { private final HibernateSessionManager sessionManager; public LoggingDispatcher(ApplicationStateManager asm, RequestGlobals requests, HibernateSessionManager sessionManager, IPLookup ipLookup) { this.sessionManager = sessionManager; } public boolean dispatch(Request request, Response response) throws IOException { PageLog log = new PageLog(); sessionManager.getSession().save(log); return false; } -- View this message in context: http://www.nabble.com/T5%3A-Hibernate-and-services-tp18147187p18147187.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/T5%3A-Hibernate-and-services-tp18147187p18155441.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] About core components subclassing and methods with package visibility
Em Fri, 27 Jun 2008 04:21:47 -0300, Francois Armand [EMAIL PROTECTED] escreveu: I faced exactly the same problem when I was playing with a personnal beaneditor : at the end, the only solution I found was to copypaste the beanEditor class, change visibility to protected and add one or two protected getters Thiago : perhaps a bug report for that would be better than a simple message in the list (so we can vote for it ;) I just wanted to check if more people in this list had the same issue before posting a JIRA. There it is: https://issues.apache.org/jira/browse/TAPESTRY-2487. Please vote! :) Thiago - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] Application state objects names
Hello all, I declared an ASO like that @ApplicationState private SomeIntfA a ; It works very well, and I can find this object across all my pages. But then I declared another one : @ApplicationState private SomeIntfB b ; Following the way Java deals with templates, T5 considers that those two ASO are the same. It's not a big deal, I can extends SomeIntfT with SomeIntfA and SomeIntfB, and work things out like that, but I dont find that very elegant, plus it wont scale nicely as T takes more values. So, would it be possible, or would it make sense, to have some kind of name attribute to the @ApplicationState, allowing one to discriminates ASO, something like that : @ApplicationState(name=SomeIntfA) private SomeIntfA a ; and @ApplicationState(name=SomeIntfB) private SomeIntfB b ; Bytheway, that would allow one to have different ASOs with the same type. Thank you for your answers / thoughts / advice, José - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Instantiate Interfaces
Yes, I know how to instantiate an Object in a onSetupRender phase for instance. But in the case of the BeanEditForm, the problem occurs when submitting. Maybe the BeanEditForm, on Submit, tries to create a new User before copying all datas from the Form to the user's properties ? So I think I don't really have a place to instantiate anything on my own (or I humbly recognized that I really don't know how to do that... ). I tried to use the @Persist on the property but it doesn't help :(. The thing is that the exact same code with a @ApplicationState instead of the @Persist works perfectly (if User is declared in the ApplicationStateManager), but this is not clean in terms of memory usage... Not sure to be clear, but I hope to find a solution Howard Lewis Ship wrote: There currently isn't a *global* mechanism to map an interface to a class so that BeanEditForm can instantiate it for you. Instead, you can add an event handler to your page for the prepare event. This method is responsible for preparing the page for either rendering a form, or submitting a form. You can add code to instantiate the UserImpl object there. Sven's option looks wrong; that's how you define a service, which is orthogonal to your problem. -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-T5--Instantiate-%22Interfaces%22-tp18153603p18157112.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] Getting the source of an event
Is there any way to get the component that fired an event? I looked at the documentation and the sources trying to find out, but no success. IMHO it would be very intesresting for mixins. I have just wrote one that uses Hibernate Validator to handle the form validation event automatically and add the error messages. I had two implementation choices: 1) Assume that the validated form always has a default t:id (form): @OnEvent(component = Constants.FORM_ID, value = Form.VALIDATE_FORM) 2) Assume that there will always only a form in the page, as the mixin doesn't know what form fired the event: @OnEvent(value = Form.VALIDATE_FORM) I think the second choice is too harsh, but then my mixin would only with one form per page and its t:id would have always the same. What about a Component getSource() method in EventContext? One another option would be that restricting instance mixins to only handle events originated from their corresponding component instance, but I don't know how difficult would it be to implement. By the way, its amazing how powerful the mixin concept is in Tapestry. Thiago - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: About the value of the parameters
@Component(parameters={onClick=message:key-name}) But then your message would have to contain the javascript (as it would for DH below). But you could tweak DH's suggestion slightly: @Component(parameters = {onClick=confirmMessage}) ... public String getConfirmMessage() { return String.format(return confirm(\%s\);,messages.get(key- name)); } Robert On Jun 27, 2008, at 6/273:00 AM , dhning wrote: 1. @Component(parameters = {onClick=confirmMessage}) public String getConfirmMessage() { return messsage.get(key-name); } Just refer that, I haven't tried for it yet. 2. Or you can define your own binding prefix. Thanks! DH - Original Message - From: 滕训华 [EMAIL PROTECTED] To: 'Tapestry users' users@tapestry.apache.org Sent: Friday, June 27, 2008 2:52 PM Subject: About the value of the parameters Hi,everyone @Component(parameters = {onClick=literal:return confirm(\do you want to delete this record?\);}) The string “do you want to delete this record?” that I want to read it from the properties file,how to do it? I am using the t5 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Instantiate Interfaces
void onPrepare() { user = new UserImpl(); } On Fri, Jun 27, 2008 at 8:02 AM, Kheldar666 [EMAIL PROTECTED] wrote: Yes, I know how to instantiate an Object in a onSetupRender phase for instance. But in the case of the BeanEditForm, the problem occurs when submitting. Maybe the BeanEditForm, on Submit, tries to create a new User before copying all datas from the Form to the user's properties ? So I think I don't really have a place to instantiate anything on my own (or I humbly recognized that I really don't know how to do that... ). I tried to use the @Persist on the property but it doesn't help :(. The thing is that the exact same code with a @ApplicationState instead of the @Persist works perfectly (if User is declared in the ApplicationStateManager), but this is not clean in terms of memory usage... Not sure to be clear, but I hope to find a solution Howard Lewis Ship wrote: There currently isn't a *global* mechanism to map an interface to a class so that BeanEditForm can instantiate it for you. Instead, you can add an event handler to your page for the prepare event. This method is responsible for preparing the page for either rendering a form, or submitting a form. You can add code to instantiate the UserImpl object there. Sven's option looks wrong; that's how you define a service, which is orthogonal to your problem. -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-T5--Instantiate-%22Interfaces%22-tp18153603p18157112.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Getting the source of an event
This would be tricky, the information is somewhat compartmentalized and the other problem is how to communicate the Event object to the event handler method. We could change Event to expose the source Component ... we could also change the EventWorker logic to see if the sole parameter to an event handler method is of type ComponentEvent and pass the event directly to the event handler method. On Fri, Jun 27, 2008 at 8:08 AM, Thiago H. de Paula Figueiredo [EMAIL PROTECTED] wrote: Is there any way to get the component that fired an event? I looked at the documentation and the sources trying to find out, but no success. IMHO it would be very intesresting for mixins. I have just wrote one that uses Hibernate Validator to handle the form validation event automatically and add the error messages. I had two implementation choices: 1) Assume that the validated form always has a default t:id (form): @OnEvent(component = Constants.FORM_ID, value = Form.VALIDATE_FORM) 2) Assume that there will always only a form in the page, as the mixin doesn't know what form fired the event: @OnEvent(value = Form.VALIDATE_FORM) I think the second choice is too harsh, but then my mixin would only with one form per page and its t:id would have always the same. What about a Component getSource() method in EventContext? One another option would be that restricting instance mixins to only handle events originated from their corresponding component instance, but I don't know how difficult would it be to implement. By the way, its amazing how powerful the mixin concept is in Tapestry. Thiago - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Application state objects names
Ideally, we'd be able to recover the generics information, but the Java implementation of generics makes that very hard to accomplish. Type erasure and all that. I think the approach of creating sub-interfaces to nail down the generic types is the best approach. On Fri, Jun 27, 2008 at 7:08 AM, José Paumard [EMAIL PROTECTED] wrote: Hello all, I declared an ASO like that @ApplicationState private SomeIntfA a ; It works very well, and I can find this object across all my pages. But then I declared another one : @ApplicationState private SomeIntfB b ; Following the way Java deals with templates, T5 considers that those two ASO are the same. It's not a big deal, I can extends SomeIntfT with SomeIntfA and SomeIntfB, and work things out like that, but I dont find that very elegant, plus it wont scale nicely as T takes more values. So, would it be possible, or would it make sense, to have some kind of name attribute to the @ApplicationState, allowing one to discriminates ASO, something like that : @ApplicationState(name=SomeIntfA) private SomeIntfA a ; and @ApplicationState(name=SomeIntfB) private SomeIntfB b ; Bytheway, that would allow one to have different ASOs with the same type. Thank you for your answers / thoughts / advice, José - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Application state objects names
What happens if you then declare: @ApplicationState private SomeIntfA a; with no name, and you have two objects of the same type declared elsewhere, with different names? Which object should a be resolved to? Arguably, if it can't be resolved, tapestry would need to throw an exception. Fine. I haven't looked in detail at the instantiation process for ASO's, but what happens if namea is defined on one page (page1), nameb on another(page2), and the above declaration on a third(page3)? Further suppose that on one application run, you hit page1-page3; then you (probably) wouldn't get an exception because at that point in time, there was only one instantiated ASO of that type. On other run, you do: page2-page3. Likewise, no exception, but you'll have a different object sitting in that variable! Finally, if you do page1-page2-page3, you hit an exception. Yuck. The solution to that problem would be for tapestry to pre-load all pages (as it did in T3 and T4). Also yuck. T5 startup time is wonderfully fast. I would hate to slow it down by making it preload/scan every page in the app. Personally, I really like the one class - one value approach. It's very straightforward, with zero configuration, and zero ambiguity. And, I don't have to constantly refer back to other pages to see what I named a particular ASO; I only have to know the type, and the ide helps me there. If I need multiple values of the same type, I use a wrapper object. Robert On Jun 27, 2008, at 6/279:08 AM , José Paumard wrote: Hello all, I declared an ASO like that @ApplicationState private SomeIntfA a ; It works very well, and I can find this object across all my pages. But then I declared another one : @ApplicationState private SomeIntfB b ; Following the way Java deals with templates, T5 considers that those two ASO are the same. It's not a big deal, I can extends SomeIntfT with SomeIntfA and SomeIntfB, and work things out like that, but I dont find that very elegant, plus it wont scale nicely as T takes more values. So, would it be possible, or would it make sense, to have some kind of name attribute to the @ApplicationState, allowing one to discriminates ASO, something like that : @ApplicationState(name=SomeIntfA) private SomeIntfA a ; and @ApplicationState(name=SomeIntfB) private SomeIntfB b ; Bytheway, that would allow one to have different ASOs with the same type. Thank you for your answers / thoughts / advice, José - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Instantiate Interfaces
In fact I think I am confronted with two different issues : 1 - @Persist behavior When I use a @Persist, I am aware that the object will only be kept in 'memory' between two request on the same page / component. So in my head I thought that it was always the same object (the same instance of the object) used by the BeanEditForm all along the process : Display Page A - Submit Form in page A - Display Page A again - Same instance of my User object because of the @Persist - == Wrong ! (at least inside the BeanEditForm) 2 - Mecanism of the BeanEditForm : It recreate an entire object when I submit the form. That is why it work with the ASO. Because it is always the same instance of the object that is updated. In fact when using the @Persist it does not have any effects on the BeanEditForm. So... would not it be possible to make the @Persist work the same way that ASO in this particular case ? It would be very usefull. Hibernate object manipulation/update would be very easy and powerfull. Ex : 1 - Get my User from Hibernate 2 - Pass it to the BeanEditForm 3 - Update the date directly in the bean (because the @Persist would allow to do so ) 4 - use onSuccess to do a Merge and a Commit :) What is your opinion about that ? Regards, Martin -- View this message in context: http://www.nabble.com/-T5--Instantiate-%22Interfaces%22-tp18153603p18158657.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Javascript at the bottom of page
Workaround: put a script tag into your template. You can inject the library as an asset use that as the src attribute of the script tag. This can be a function of your application's layout component. On Fri, Jun 27, 2008 at 4:30 AM, Marcelo Lotif [EMAIL PROTECTED] wrote: I'm having a similar issue, with the @IncludeStylesheetLibrary. This annotation inserts the script tag at the end of the page, but i need to put it at the beginning... There's any solution or at least a workaround for this? On Fri, Jun 27, 2008 at 8:10 AM, lebenski [EMAIL PROTECTED] wrote: Hi This has been an issue for a while now - we're using prototype etc. to manipulate elements in some of our pages but can't access it due to it being loaded at the end of the page. I have read on these forums before that javascript should be loaded at the end of the page to increase load speeds, however this should only be done when javascript isn't used for changing the layout of the page - could tapestry please change this behaviour as it's creating a major headache for us (and I'm sure a lot of others). Thanks -- View this message in context: http://www.nabble.com/Javascript-at-the-bottom-of-page-tp18152871p18152871.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Atenciosamente, Marcelo Lotif Programador Java e Tapestry FIEC - Federação das Indústrias do Estado do Ceará (85) 3477-5910 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Template previewability
On 26 Jun 2008, at 23:31, Geoff Callender wrote: Are you sure? What about... span t:type=output value=student.gradeA/span The core Output component in T5 has a required format parameter, so the above will throw an exception. The Output component is useful for things like dates and interpolating values into messages, but a slightly bigger beast than I was talking about. I have a simpler Text component of my own but felt that at some stage I'll probably rip out all occurrences and replace with whatever the core T5 equivalent is. Really there are 3 styles and I think the doco has slipped up on them. Weren't these the terms being used a while back... - Components as elements, eg. t:pagelink page=IndexHome/ t:pagelink - Embedded components, eg. a t:type=pagelink t:page=Index href=#Home/a - Invisible instrumentation, eg. a t:id=index href=#Home/a with @Component(id = index, parameters = {page=Index}) @SuppressWarnings(unused) private PageLink _index; I don't recall this three-way split being introduced. In fact, the second and third are, to my understanding, both examples of what has been termed invisible instrumentation. You can add just a t:id or just a t:type or you can add both. In cases where you have added a t:id without the t:type, you must include the annotated field in the page class. But really, my point here was to that I think the terminology needs to be improved, to help newcomers get to grips with the framework more quickly. (There's nothing like a slightly inaccurate piece of terminology to cause newbies to hit roadblocks.) I would contend that the above three terms are all quite poor: Components as elements. Well, all components correspond to some element in the template, so this isn't being specific at all. The issue is whether they're Tapestry elements or HTML elements. Embedded components. Embedded in what? The template? Then ditto as to the previous point. Invisible instrumentation. As I pointed out in my previous post, both techniques for instrumenting a Tapestry template are invisible in a rendered browser view, so this is again a bad piece of terminology. I think that the Component Templates page in the User's Guide could do with a re-write to reflect the two possible ways of instrumenting a template: (i) Adding Tapestry elements (ii) Adding attributes to HTML elements These two terms are the best I can come up with to express the fact that there are two ways of doing it. (Maybe someone can be more succinct and accurate.) Also, I think this should be near the top of the Component Templates page, rather than explaining templates in terms of Tapestry elements and then have a quick oh, by the way, there's also another way of doing it... near the bottom. I'd be happy to contribute a draft. Don. This message has been scanned for content and viruses by the DIT Information Services E-Mail Scanning Service, and is believed to be clean. http://www.dit.ie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Template previewability
On 26 Jun 2008, at 20:28, Howard Lewis Ship wrote: There's some gaps waiting to be filled (not abandoned, just prioritized a bit lower than more urgent bug fixes). That's great to hear. Thanks. If you want to use T4 style, how about: t:output value=property/ public class Output { @Parameter (required=true) private String value; boolean beginRender(MarkupWriter writer) { if (value != null) writer.write(value); return false; // skip body } } Thanks. I have a similar little component. As a total aside, I feel compelled to say that Output is a really terrible name for a component. Just about every component outputs something so the name is providing next-to-no information. (I called mine Text, by the way.) Regards, Don. This message has been scanned for content and viruses by the DIT Information Services E-Mail Scanning Service, and is believed to be clean. http://www.dit.ie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T4 to T5 migration guide
Hi, is there a T4 to T5 migration guide out there? Any links would be helpfull. Thanks. ..kace -- View this message in context: http://www.nabble.com/T4-to-T5-migration-guide-tp18162390p18162390.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Template previewability
Well, Insert is a terrible name :-) There's already OutputText (for formatted output). Perhaps FormatText would have been a better name in retrospect. On Fri, Jun 27, 2008 at 10:06 AM, Don Ryan [EMAIL PROTECTED] wrote: On 26 Jun 2008, at 20:28, Howard Lewis Ship wrote: There's some gaps waiting to be filled (not abandoned, just prioritized a bit lower than more urgent bug fixes). That's great to hear. Thanks. If you want to use T4 style, how about: t:output value=property/ public class Output { @Parameter (required=true) private String value; boolean beginRender(MarkupWriter writer) { if (value != null) writer.write(value); return false; // skip body } } Thanks. I have a similar little component. As a total aside, I feel compelled to say that Output is a really terrible name for a component. Just about every component outputs something so the name is providing next-to-no information. (I called mine Text, by the way.) Regards, Don. This message has been scanned for content and viruses by the DIT Information Services E-Mail Scanning Service, and is believed to be clean. http://www.dit.ie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Template previewability
Don, You're right about there being only a two-way split. I've looked in the archives and found as long ago as 2002 Howard described invisible instrumentation as being a term for how Tapestry HTML templates maintain WYSIWYG editor compatibility. So, as you say, my 2nd and 3rd styles are both examples of invisible instrumentation. Regarding embedded components, I'd offer the suggestion that we can think of invisible instrumentation as being achieved by embedding components in regular HTML elements. Tapestry recognises the embedded component at runtime by the presence of a namespaced type or id attribute, eg. t:type=foo, and/or t:id=bar. I dunno, maybe embedding is ambiguous. Geoff On 28/06/2008, at 2:59 AM, Don Ryan wrote: On 26 Jun 2008, at 23:31, Geoff Callender wrote: snip Really there are 3 styles and I think the doco has slipped up on them. Weren't these the terms being used a while back... - Components as elements, eg. t:pagelink page=IndexHome/ t:pagelink - Embedded components, eg. a t:type=pagelink t:page=Index href=#Home/a - Invisible instrumentation, eg. a t:id=index href=#Home/a with @Component(id = index, parameters = {page=Index}) @SuppressWarnings(unused) private PageLink _index; I don't recall this three-way split being introduced. In fact, the second and third are, to my understanding, both examples of what has been termed invisible instrumentation. You can add just a t:id or just a t:type or you can add both. In cases where you have added a t:id without the t:type, you must include the annotated field in the page class. But really, my point here was to that I think the terminology needs to be improved, to help newcomers get to grips with the framework more quickly. (There's nothing like a slightly inaccurate piece of terminology to cause newbies to hit roadblocks.) I would contend that the above three terms are all quite poor: Components as elements. Well, all components correspond to some element in the template, so this isn't being specific at all. The issue is whether they're Tapestry elements or HTML elements. Embedded components. Embedded in what? The template? Then ditto as to the previous point. Invisible instrumentation. As I pointed out in my previous post, both techniques for instrumenting a Tapestry template are invisible in a rendered browser view, so this is again a bad piece of terminology. I think that the Component Templates page in the User's Guide could do with a re-write to reflect the two possible ways of instrumenting a template: (i) Adding Tapestry elements (ii) Adding attributes to HTML elements These two terms are the best I can come up with to express the fact that there are two ways of doing it. (Maybe someone can be more succinct and accurate.) Also, I think this should be near the top of the Component Templates page, rather than explaining templates in terms of Tapestry elements and then have a quick oh, by the way, there's also another way of doing it... near the bottom. I'd be happy to contribute a draft. Don. This message has been scanned for content and viruses by the DIT Information Services E-Mail Scanning Service, and is believed to be clean. http://www.dit.ie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]