Re: Tapestry 5 service configuration

2007-10-14 Thread Kristian Marinkovic
hi peter, ASOs that have a (non-empty) constructor can be instantiated by contributing to the ApplicationStateManager service. Please see the thread for the source. if you contribute to this service you can still use the @ApplicationState annotation. http://www.nabble.com/-T5-Question-on-ASO-co

Re: T5: Tapestry, Hibernate and Underscores.

2007-10-14 Thread Davor Hrg
maybe you missed the point here, never mind the reason I use the _ prefix .. the problem was with hibernate, not with tapestry Davor Hrg On 10/15/07, Christian Gruber <[EMAIL PROTECTED]> wrote: > > Tapestry doesn't require _ prefixes, mind you. That's a Howard M. > Lewis Ship-ism. (act

Re: Tapestry 5 service configuration

2007-10-14 Thread Chris Lewis
Hi Peter 1) I think the general opinion on this is that a service and an aso are completely different animals. I can't think of a situation where I'd ever want an aso to be a service (or vice versa), but that's just me. If there is a way to do this, someone else will need to chime in. 2) @In

Tapestry 5 service configuration

2007-10-14 Thread Peter Stavrinides
Hi all, Following on from a previous post on this subject I have some questions on Tapestry 5 IoC: 1. How do you register an ASO as a service if you have to provide arguments to the constructor (i.e. you cannot use @ApplicationState in this case). 2. How do you retrieve a service object th

Re: [T5] Recommended naming of configurations

2007-10-14 Thread lasitha
Thanks Nick - you're right, i should have looked over list and jira first: http://thread.gmane.org/gmane.comp.java.tapestry.user/51015 https://issues.apache.org/jira/browse/TAPESTRY-1679 I agree that 'configure' is a step forward - configureRequestHandler() is better than contributeRequestHandler(

Re: T5 Order in which modules load

2007-10-14 Thread Nick Westgate
Doesn't an ordered configuration help you there? http://tapestry.apache.org/tapestry5/tapestry-ioc/configuration.html#Ordered%20List The order of module processing shouldn't be important since the final ordering is imposed by resolving all such configurations after loading. (Sorry, I haven't exp

T5 Order in which modules load

2007-10-14 Thread Martin Reurings
Hey Guys, I've quite happily been working on creating my own module to enhance Tapestry5. This module is a generic patch so that I can more rapidly create new WebApps based on T5. I've added some components and a service and all seemed to be working quite well. Now I've run into a problem thou

Re: Binding to sub-properties

2007-10-14 Thread andyhot
they should both work, what's the error you're getting? Jesse Merriman wrote: (Tapestry newb, using 4.1.3, maybe answered before but I couldn't find it.) Is it possible to bind to a sub-property? Eg, this works: Home.html: Home.java: public abstract class Home extends BasePage impl

Binding to sub-properties

2007-10-14 Thread Jesse Merriman
(Tapestry newb, using 4.1.3, maybe answered before but I couldn't find it.) Is it possible to bind to a sub-property? Eg, this works: Home.html: Home.java: public abstract class Home extends BasePage implements PageBeginRender { public abstract int getNum(); public abstract void

Re: T5: Tapestry, Hibernate and Underscores.

2007-10-14 Thread Christian Gruber
Tapestry doesn't require _ prefixes, mind you. That's a Howard M. Lewis Ship-ism. (actually, I have it too from my NeXTSTEP days.) It's not mandatory, however, so on your persistent objects, you could use the typical pattern and annotate your properties, if that's how you want to do it.

Re: [T5] Recommended naming of configurations

2007-10-14 Thread Nick Westgate
Tapestry-ioc already calls the "something" a configuration: http://tapestry.apache.org/tapestry5/tapestry-ioc/configuration.html so Howard's "configure" naming suggestion looks even better. (This has been discussed previously in this list.) Cheers, Nick. lasitha wrote: Howard, Just in case t

Re: t5 : how to set page paramaters in pagelink ?

2007-10-14 Thread Nick Westgate
There are at least 2 ways to do this. If you follow Serge's suggestion of a context, you need to use the context to set "name" in page B using the onActivate event: http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html The alternative is to use an ActionLink instead of PageLink i

Re: how to inject PersistentLocale for manage app locales ??

2007-10-14 Thread Nick Westgate
I can't check the code right now, but pageAttached may be too early. Try either onActivate or setupRender. Cheers, Nick. Mohammad Shamsi wrote: i wrote this code to change locale, but i got NullPointerException, any idea please? public class Start { @Inject PersistentLocale locale;

how to inject PersistentLocale for manage app locales ??

2007-10-14 Thread Mohammad Shamsi
i wrote this code to change locale, but i got NullPointerException, any idea please? public class Start { @Inject PersistentLocale locale; @PageAttached public void attached() { locale.set(Locale.GERMAN); } } -- sincerely yours M. H. Shamsi

Re: how to use ioc of t5 ?

2007-10-14 Thread Davor Hrg
IOC helps your code being more modular and less dependable, you make your DAO class so it receives Session via constructor, you can use your DAO class in any project easily. in a tapestry app you add your DAO as service, an later on inject it where needed. IOC gives your DAO class the Session and

Re: T5: Tapestry, Hibernate and Underscores.

2007-10-14 Thread Davor Hrg
hi, I've tried to adopt underscores for private fields, so the the tutorial got mixed when I've created that page with AngeloChen. I'll check tomorow if this is true, but I belive you can avoid this problem by not putting annotations on the fields and putting them on the getters or setters instea

Re: T5 2 question about loop component parameters

2007-10-14 Thread Andreas Andreou
Not having to create getters & setters (or abstract getters in T4) just so that @Loop (and @For) values and indexes can become accessible is a fairly often request/question... Creating a custom binding prefix (perhaps named temp) that attaches objects to the currect requestcycle and reads from the

Re: [T5] RadioGroup

2007-10-14 Thread Michael Gerzabek
Sorry for my dumb questions. I've been away from java since 1.4 and so I'm not used to play with such magic tricks. Anyway, can I see those values when I do a System.out.println()? I use Eclipse for debugging. Does it make a difference if I set a method breakpoint or a line breakpoint? I'm not o

Re: T5 2 question about loop component parameters

2007-10-14 Thread Howard Lewis Ship
You can define a variable as a field of your component class. However, it won't be visible without your providing a getter and setter. Example: ${user.name} Java code: public class MyPage { @Inject private UserDatabase _database; private User _user; public UserDatabase getDataba

Re: [T5] RadioGroup

2007-10-14 Thread Howard Lewis Ship
There's a bit of magic going on. Most of your parameters will be null except when you have a break point inside code during the rendering of the component. Further, some of your code will have to read a value from a parameter field for the field to get filled in. Basically, the first time you ha

Re: [T5] RadioGroup

2007-10-14 Thread Michael Gerzabek
Thanks for the advice. I also planned to follow the first path you outlined. It just cost me some time to get familiar with the concept of the inner live of forms in T5 and I wanted to make a rapid prototype before I would step into the definition of a service which is another new area of T5 to

t5 : is it possible : more than one value for tapestry.app-package ??

2007-10-14 Thread Mohammad Shamsi
dear friends, is it posible to define multiple value for tapestry.app-package context parameter ? -- sincerely yours M. H. Shamsi

Re: t5 : how to set page paramaters in pagelink ?

2007-10-14 Thread Mohammad Shamsi
please look this code : // first page. class A { } // second page class B { private String name; } in A page template i have this linke : B i want to set name parameters of page B in this link. is it possible ? On 10/14/07, SergeEby <[EMAIL PROTECTED]> wrote: > > > Hi, > > You can use

Re: T5 2 question about loop component parameters

2007-10-14 Thread Mohammad Shamsi
hi Howard, i have no experience in Tapestry, i just test it for replacing my company framework. i use for 6 years struts, webworks and my own framework that based on both struts and webworks. in pages that made from JSP and JSTL , we can simply define a variable in page, this variable bind on

Re: [T5] Recommended naming of configurations

2007-10-14 Thread lasitha
Howard, Just in case that was an invitation for proposals :), how about: contributeSomethingToSomeService(), where 'Something' is optional? Allows for a little more specificity while still being an easily parsed convention. And for those that don't care - its only two more characters :) In any

Re: [T5] RadioGroup

2007-10-14 Thread Howard Lewis Ship
I would avoid the use of static maps for tracking the radio groups. In addition, static will be shared between threads, so you have code that will likely break in production. In my book, static should always be stateless. You have two approaches that work better (and are more testable): - Define

SourceKibitzer + Tapestry

2007-10-14 Thread Andreas Andreou
I just saw that www.sourcekibitzer.org is using Tapestry4 and Tacos - I didnt know! Perhaps we can get them to write a success story, or talk about their future plans -- Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting

Re: [T5] RadioGroup

2007-10-14 Thread Michael Gerzabek
Sorry, you're right: The component is basically a compilation of Radio and RadioGroup. I use a static Map to secure the unique names of [EMAIL PROTECTED]'s. In setupRender() I prepare the environment in cleanupRender() I wrap it up. Here's the code ... package com.michaelgerzabek.services.we

Re: OT: Different type of MVC

2007-10-14 Thread Howard Lewis Ship
Because it is perfectly shared and uniform, reasonable to cache (portions in memory), uniformly accessible from multiple machines, etc. However, such systems rarely get other aspects right, like coordinating code changes with content changes, or providing adequate history (equivalent to Subversion

Re: [T5] Recommended naming of configurations

2007-10-14 Thread Howard Lewis Ship
Where I dropped the ball here, in a minor way, is that it should be "contributeTo" as a prefix, or perhaps "configure". It's a prefix on the *service* being configured or contributed to. So I would choose option #2 or #3. I wonder if there's some value in something like: @Contribute(FooBar.clas

Re: T5 2 question about loop component parameters

2007-10-14 Thread Howard Lewis Ship
If we made the getIndex() and getValue() methods of Loop public, then you could: ${loop.currValue} But then you must define your loop in your Java class and expose it as a property: @Component private Loop _loop; public Loop getLoop() { return _loop; } how

Re: OT: Different type of MVC

2007-10-14 Thread Andrea Chiumenti
I always wonder why some ppl want to use a db like a file system. On 10/13/07, Renat Zubairov <[EMAIL PROTECTED]> wrote: > > I've worked once with the application where all content, e.g. HTML, > Javascript, CSS was put in the DB. Not very good idea . > > Renat > > On 12/10/2007, Daniel Jue <[EMAIL

Re: T5 2 question about loop component parameters

2007-10-14 Thread Nick Westgate
I can see what you mean, though it is quite common to use the index inside the page class too. T5 keeps things simple to cover the most common cases. You can create your own components if you don't like the default ones. It would be interesting to see an alternative if you write one. Cheers, Nic

Re: T5: Escaping espansions

2007-10-14 Thread SergeEby
Hi, Did you try the "literal:" binding prefix? --- /Serge Hans Jörg Hessmann wrote: > > Hi, > > I'd like to show a static text containing ${something} on a page. Is > there a way to escape the "${"? > > Thanks, > Hans Joerg Hessmann > > -

Re: T5 bad URL generation

2007-10-14 Thread SergeEby
Hi, This issue has been discussed in the past. Please search the list. -- /Serge Foror wrote: > > Some package "pages.articles" and page "Articles.java" in this package. > URL > "http://localhost/articles/";. When need context page="articles/" context="literal:param1">test then URL > "http:/

Re: T5 bad URL generation

2007-10-14 Thread Angelo Chen
Hi Foror, how about page="articles"? Foror wrote: > > Some package "pages.articles" and page "Articles.java" in this package. > URL > "http://localhost/articles/";. When need context page="articles/" context="literal:param1">test then URL > "http://localhost/articles//param1"; two slashes bef

T5 bad URL generation

2007-10-14 Thread Foror
Some package "pages.articles" and page "Articles.java" in this package. URL "http://localhost/articles/";. When need context test then URL "http://localhost/articles//param1"; two slashes before "param1". ^ ---

Re: t5 : how to set page paramaters in pagelink ?

2007-10-14 Thread SergeEby
Hi, You can use the context parameter: http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html#orgapachetapestrycorelibcomponentspagelink -- /Serge dalahoo wrote: > > dear friends, > > i want to set some value for may page properties, with pagelink compoent, > is > it p

Re: T5 2 question about loop component parameters

2007-10-14 Thread Ted Steen
java: private int currValue; public int getCurrValue() { return currValue; } public void setCurrValue(int currValue) { this.currValue = currValue; } template: ${currValue}

t5 : how to set page paramaters in pagelink ?

2007-10-14 Thread Mohammad Shamsi
dear friends, i want to set some value for may page properties, with pagelink compoent, is it posible ? -- sincerely yours M. H. Shamsi

Re: T5 2 question about loop component parameters

2007-10-14 Thread Mohammad Shamsi
dear Nick, i want index just for iteration, i don't need it in may page class, i think that its better to define in Loop component class, suppose that i want to use Loop, 5 times in a singe page, then i most define 5 index value, and five item object ??? On 10/14/07, Nick Westgate <[EMAIL PROT

Re: T5 2 question about loop component parameters

2007-10-14 Thread Nick Westgate
The value and index have to go somewhere. Why not in your page class? Cheers, Nick. Mohammad Shamsi wrote: hi all, please take a look at my page bellow, ??? ${item.firstName} ${item.lastName} ${item.ph

Re: [T5] RadioGroup

2007-10-14 Thread Nick Westgate
Hard to say without seeing the source and how you are using the component. Cheers, Nick. Michael Gerzabek wrote: I implemented an alternative radio component. When I debug my setupRender() the parameters from the template are all null. When I look into the ComponentResources in _bindings ther

Re: [T5] RadioGroup

2007-10-14 Thread Michael Gerzabek
I implemented an alternative radio component. When I debug my setupRender() the parameters from the template are all null. When I look into the ComponentResources in _bindings there are all my Parameters but the annotated values in my own component seem never be initialized. What am am I missi

T5 2 question about loop component parameters

2007-10-14 Thread Mohammad Shamsi
hi all, please take a look at my page bellow, ??? ${item.firstName} ${item.lastName} ${item.phone} 1 - i just want to use item object here, for iteration, i don't want to define it at my