Re: How to pass parameters from a Page to another Page in java code?

2011-02-21 Thread leon
It works! Thanks a lot! On Mon, Feb 21, 2011 at 3:18 PM, Taha Hafeez tawus.tapes...@gmail.comwrote: On Mon, Feb 21, 2011 at 9:50 AM, leon mail@gmail.com wrote: Hi All, Hi I know that we can pass a parameter through context attribute of tag in template, but how to achieve it in

Re: Access displayed rows of grid component in page

2011-02-21 Thread Joost Schouten (ml)
Hi, I assume that I can use Grid.getCurrentPage() and Grid.getRowsPerPage() for that. Correct, but even better would be to implement your own GridDataSource since then you can do all the data fetching and preperations in one go. Your own GridDataSource forms the source @Parameter for the

Re: [Bulk] Re: 10 Minute Web Application Demo

2011-02-21 Thread onj888-tapestry
good point 於 2011/2/18 4:06, Howard Lewis Ship 提到: I spend a lot of time when teaching Tapestry getting people to do One Small Step at a time. Everyone feels the need to jump from a blank page to the final solution in one go, and that's really hard. I do a lot of placeholder goes here, then

Re: Tapestry app using JDBC

2011-02-21 Thread robnangle
User user = userDao.get(loginName); The above line, is the user entity class? And what is the userDao doing? stateManager.set(User.class, user); This is setting the user as the current state? User user = stateManager.get(User.class); And the above is just returning the current user? --

Re: Tapestry app using JDBC

2011-02-21 Thread Richard Hill
On Mon, 2011-02-21 at 02:27 -0800, robnangle wrote: User user = userDao.get(loginName); The above line, is the user entity class? And what is the userDao doing? User could be an entity, depends on whether you are using an ORM or not. Generally though your DAO is going to return an object of

Re: Access displayed rows of grid component in page

2011-02-21 Thread Timo Westkämper
Hi. I have my own GridDataSource for that, but I want to extend the data fetched by the GridDataSource. I can see the following options for that. * lazily init reference data by using the objects return from dataSource.getRowValue(0) to dataSource.getRowValue(grid.getRowsPerPage() -1) *

Re: Tapestry app using JDBC

2011-02-21 Thread robnangle
So I have a 'User' entity class and then my Login class. So in my login I should have: private String username; private String password; @Inject private ApplicationStateManager stateManager; private Object userDao;

Re: Tapestry app using JDBC

2011-02-21 Thread Richard Hill
Assuming Login is a tapestry page then yes, exactly. (although you can skip the last line: User user = stateManager.get(User.class); as user is already defined here.) On Mon, 2011-02-21 at 02:57 -0800, robnangle wrote: So I have a 'User' entity class and then my Login class. So in my login I

Re: Tapestry app using JDBC

2011-02-21 Thread robnangle
What if I have created the Login as a form component? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-app-using-JDBC-tp3390993p3393999.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Tapestry app using JDBC

2011-02-21 Thread Richard Hill
On Mon, 2011-02-21 at 03:07 -0800, robnangle wrote: What if I have created the Login as a form component? Sure, that's fine. It'll work with a page or component - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org

Re: Tapestry app using JDBC

2011-02-21 Thread Thiago H. de Paula Figueiredo
On Mon, 21 Feb 2011 07:40:42 -0300, Richard Hill r...@su3analytics.com wrote: This just puts the retrieved user object into the session as an SSO. This means it is accessible from all pages/components, unlike say @Persist'd quantities which are scoped to individual pages/components. You can

Re: Tapestry app using JDBC

2011-02-21 Thread Richard Hill
Yes, sorry, was thinking of @Persists there. SSO's are keyed by class: stateManager.get(User.class) so for SSOs you can only have one of each class type. On Mon, 2011-02-21 at 08:33 -0300, Thiago H. de Paula Figueiredo wrote: On Mon, 21 Feb 2011 07:40:42 -0300, Richard Hill

Java based spring configuration

2011-02-21 Thread Bård Magnus Kvalheim
Hi all, Versions Tapestry: 5.2.4 Spring: 3.1.0.M1 We're using java based container configuration with spring - so no xml files are used for configuring beanfactories. With tapestry-spring this is currently unsupported as TapestryApplicationContext extends from XmlWebApplicationContext. As a

Re: Access displayed rows of grid component in page

2011-02-21 Thread Joost Schouten (ml)
I have a few places where I do this sort of thing. Preferable I wrap the original value obtained from my DAO in the GridDataSource right after obtaining it. Where the wrapper does the further initilization required. If that is not an option, you can always do the wrapping in @SetupRender and

Re: Tapestry 5 - cache issue when accessed via proxy

2011-02-21 Thread Pablo dos Reis
If your problem occurs in multiple pages I recommend put the cache configuration in your AppModule. public RequestFilter cacheFilter() { return new RequestFilter() { public boolean service(Request request, Response response, RequestHandler handler) throws

Re: Tapestry 5.1.0.5 and HTML 5 Doctype

2011-02-21 Thread Bob Harner
By the way, I have added Nille Hammer's work-around (for emitting the HTML5 doctype) to the documentation, at https://cwiki.apache.org/confluence/display/TAPESTRY/Component+Templates On Sun, Feb 20, 2011 at 3:13 PM, Christian Riedel cr.ml...@googlemail.com wrote: Hi François, the central

Re: Tapestry 5.1.0.5 and HTML 5 Doctype

2011-02-21 Thread Bob Harner
Correction, the URL should be: http://tapestry.apache.org/component-templates.html (once the change propagates in an hour or two, and the apache site comes back up) On Mon, Feb 21, 2011 at 9:21 AM, Bob Harner bobhar...@gmail.com wrote: By the way, I have added Nille Hammer's work-around (for

Re: 10 Minute Web Application Demo

2011-02-21 Thread Mark
Thanks, and I appreciate your suggestions. There is probably a big difference between the pacing necessary to actually teach Tapestry (what this mailing list audience may be more interested in) and the pacing to get people interested in learning Tapestry (what this video was really designed for).

Exciting opportunity in Berlin

2011-02-21 Thread Stefan Schuetz
Hi guys, are here any tapestry pros which will mind about to take a really exciting offer as a tapestry developer in a permanent position here in Berlin/Germany? Please feel free to contact me! - Stefan smime.p7s Description: S/MIME cryptographic signature

Enum or Drop Down

2011-02-21 Thread robnangle
Hi all, Is it possible to populate an enum class with data from a database or what component acts like a drop down box in tapestry? Cheers -- View this message in context: http://tapestry.1045711.n5.nabble.com/Enum-or-Drop-Down-tp3394312p3394312.html Sent from the Tapestry - User mailing list

Re: Tapestry app using JDBC

2011-02-21 Thread robnangle
Cheers got that sorted.. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-app-using-JDBC-tp3390993p3394313.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe,

[T5] Tapestry and Servlet 3.0 web fragments (zero configuration)

2011-02-21 Thread Everton Agner
Hey! Is Tapestry going to support the Servlet 3.0 and it's specification for web fragments? I mean, load itself without the need for us to speficy it's filter in the app's web.xml? I'm anxious to see it trully zero configuration! I guess this is the only thing left for it, even though it's far

Re: Enum or Drop Down

2011-02-21 Thread Richard Hill
You want to take a look at the t:select component. It takes a select model but tap can provide one automatically for an enum On Mon, 2011-02-21 at 07:45 -0800, robnangle wrote: Hi all, Is it possible to populate an enum class with data from a database or what component acts like a drop down

Re: Enum or Drop Down

2011-02-21 Thread Thiago H. de Paula Figueiredo
On Mon, 21 Feb 2011 12:55:59 -0300, Richard Hill r...@su3analytics.com wrote: You want to take a look at the t:select component. It takes a select model but tap can provide one automatically for an enum Plus see the SelectModelFactory interface to generate the select model easily. --

Re: Exciting opportunity in Berlin

2011-02-21 Thread Gutemberg Albuquerque Da Silva
hi, I'd like this position. 2011/2/21 Stefan Schuetz ste...@wammel.com Hi guys, are here any tapestry pros which will mind about to take a really exciting offer as a tapestry developer in a permanent position here in Berlin/Germany? Please feel free to contact me! - Stefan --

Re: Enum or Drop Down

2011-02-21 Thread robnangle
So there is no way of doing it like a grid: t:grid source=players / //players being a list populated from a database.. You have to create a model ect... -- View this message in context: http://tapestry.1045711.n5.nabble.com/Enum-or-Drop-Down-tp3394312p3394364.html Sent from the Tapestry -

Re: Enum or Drop Down

2011-02-21 Thread Stefan Schuetz
No, because tap needs to know how to remap the values on a form submit. So you need to provide a select model. But it's really easy stuff! Take a look: http://jumpstart.doublenegative.com.au/jumpstart/ - Stefan Am 21.02.2011 um 17:26 schrieb robnangle: So there is no way of doing it like

Re: Enum or Drop Down

2011-02-21 Thread Richard Hill
I always thought it would be nice if tap could generate a drop down given just a list - it could take the object id and toString() as values for example. But sadly this does not exist so you have to build a model, which as Stefan says is actually pretty simple. And in fact being forced to supply

Re: Enum or Drop Down

2011-02-21 Thread robnangle
Richard Hill-7 wrote: I always thought it would be nice if tap could generate a drop down given just a list - it could take the object id and toString() as values for example. But sadly this does not exist so you have to build a model, which as Stefan says is actually pretty simple. And

Re: Enum or Drop Down

2011-02-21 Thread Thiago H. de Paula Figueiredo
On Mon, 21 Feb 2011 13:36:55 -0300, Richard Hill r...@su3analytics.com wrote: I always thought it would be nice if tap could generate a drop down given just a list - it could take the object id and toString() as values for example. There are two problems that you need to solve when writing

Re: Enum or Drop Down

2011-02-21 Thread Richard Hill
know how to do that. Anyway, writing your own ValueEncoder is easy. * What objects will be used as options? There's no way for Tapestry to do that automatically in a reasonable way even when using tapestry-hibernate. And SelectModelFactory already does the heavy lifting for you. To be

Re: [T5] Tapestry and Servlet 3.0 web fragments (zero configuration)

2011-02-21 Thread Thiago H. de Paula Figueiredo
On Mon, 21 Feb 2011 12:51:31 -0300, Everton Agner ton.ag...@gmail.com wrote: Hey! Hi! Is Tapestry going to support the Servlet 3.0 and it's specification for web fragments? I mean, load itself without the need for us to speficy it's filter in the app's web.xml? I don't know, but

Re: Enum or Drop Down

2011-02-21 Thread Thiago H. de Paula Figueiredo
On Mon, 21 Feb 2011 13:52:46 -0300, Richard Hill r...@su3analytics.com wrote: To be honest I never understood value encoder and don't use it. Recommendation: learn it and use it. In software development, ignorance is not bliss. :) When rendering a page all you need are a) the list

Re: Enum or Drop Down

2011-02-21 Thread robnangle
I am not using tapestry-hibernate, is there any examples out there because the few I have came across seem to be very complex? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Enum-or-Drop-Down-tp3394312p3394431.html Sent from the Tapestry - User mailing list archive at

Re: [T5] Tapestry and Servlet 3.0 web fragments (zero configuration)

2011-02-21 Thread 9902468
Hi, Tomcat 7, Jetty 8, Glassfish 3.0.1 + 3.1, JBOSS AS 6.0 support 3.0 spec. (Just a list from my memory, if I made a mistake please correct me.) If you know more, please add to the list, I really would like to know. :) - Ville -- View this message in context:

Re: Enum or Drop Down

2011-02-21 Thread Thiago H. de Paula Figueiredo
On Mon, 21 Feb 2011 14:05:25 -0300, robnangle robnan...@gmail.com wrote: I am not using tapestry-hibernate, is there any examples out there because the few I have came across seem to be very complex? There are some examples out there that I consider the wrong approach, specifically

Re: Default Ordering for BeanEditForm

2011-02-21 Thread Josh Canfield
http://download.oracle.com/javase/6/docs/api/java/lang/Class.html#getDeclaredMethods() The elements in the array returned are not sorted and are not in any particular order. Java's reflection mechanism doesn't guarantee the order of methods returned so it would be hard for Tapestry to do much

Re: Default Ordering for BeanEditForm

2011-02-21 Thread Howard Lewis Ship
Acutally, Tapestry 5.2 uses Javassist to get at attribute information for the methods, including the line numbers where available. However, I'm honestly not sure what happens in a transformed component class. Certainly, if the @Property annotation is used, there is no line number information to be

Re: RequestFilter not called (sometimes)

2011-02-21 Thread Josh Canfield
I've made a RequestFilter that's only loaded in development mode, but the problem is it isn't always loaded properly - when I start tapestry (maven jetty:run) about 1/3rd of the time it works, but the rest of the time it doesn't. Where in the list are you putting your request filter?

Re: Tapestry 5 - cache issue when accessed via proxy

2011-02-21 Thread Josh Canfield
Considering the option you mentioned, am guessing if we can add some dynamic parameter in url which changes for each request which should resolve the problem. You should consider putting your search terms in the url either as a path parameter or a query parameter so that you can take advantage

Re: [T5] Tapestry and Servlet 3.0 web fragments (zero configuration)

2011-02-21 Thread Josh Canfield
Is Tapestry going to support the Servlet 3.0 and it's specification for web fragments? I mean, load itself without the need for us to speficy it's filter in the app's web.xml? The other thing that I'd love to get into Tapestry is the support for long running requests using

Re: [T5] Tapestry and Servlet 3.0 web fragments (zero configuration)

2011-02-21 Thread Howard Lewis Ship
That's something that's much more interesting for me ... long running processes that can push updates (such as a progress bar) to a client. On Mon, Feb 21, 2011 at 10:38 AM, Josh Canfield joshcanfi...@gmail.com wrote: Is Tapestry going to support the Servlet 3.0 and it's specification for web

Global Configuration/Logging/Properties files locations

2011-02-21 Thread Lenny Primak
Hi guys, So far, I counted two places to put global properties in tapestry: - WEB-INF/app.properties - resources/log4j.properties What is the proper place to put global properties, WEB-INF or resources? Also, I am deploying on glassfish and I don't think log4j.properties actually works for this.

Re: Default Ordering for BeanEditForm

2011-02-21 Thread Josh Canfield
Acutally, Tapestry 5.2 uses Javassist to get at attribute information for the methods, including the line numbers where available. The getMethods in CtClass is not documented as being ordered, so I peeked at the code and unless I'm looking at the wrong spot it comes from an un-ordered HashMap.

Re: Global Configuration/Logging/Properties files locations

2011-02-21 Thread Thiago H. de Paula Figueiredo
On Mon, 21 Feb 2011 16:05:29 -0300, Lenny Primak lpri...@hope.nyc.ny.us wrote: Hi guys, So far, I counted two places to put global properties in tapestry: - WEB-INF/app.properties - resources/log4j.properties What is the proper place to put global properties, WEB-INF or resources? What are

Re: Global Configuration/Logging/Properties files locations

2011-02-21 Thread Lenny Primak
That's the question, what goes into resources (globally?) i.e. resources/app.properties, etc. Are there any other properties that goes into resources/ root folder? And how does log4j.properties work in case of glassfish then/? On Feb 21, 2011, at 2:19 PM, Thiago H. de Paula Figueiredo wrote: On

Re: Global Configuration/Logging/Properties files locations

2011-02-21 Thread Josh Canfield
That's the question, what goes into resources (globally?) i.e. resources/app.properties, etc. Are there any other properties that goes into resources/ root folder? And how does log4j.properties work in case of glassfish then/? log4j.properties is for log4j and is only included by the tapestry

Re: Global Configuration/Logging/Properties files locations

2011-02-21 Thread Bob Harner
Just a note: http://tapestry.apache.org/localization.html is the newer version of that page. On Mon, Feb 21, 2011 at 3:00 PM, Josh Canfield joshcanfi...@gmail.com wrote: That's the question, what goes into resources (globally?) i.e. resources/app.properties, etc. Are there any other properties

Re: Global Configuration/Logging/Properties files locations

2011-02-21 Thread Lenny Primak
So basically in my glassfish deployment, there is nothing that needs to be put into resources/ folder, as far as tapestry configuration is concerned, correct? And the logging is controlled through glassfish itself, not through a file in this folder. Thanks for your answer/confirmation On Feb 21,

Re: RequestFilter not called (sometimes)

2011-02-21 Thread Donny Nadolny
Ah that's why, thanks Josh. I didn't specify any order, so some of the time my filter (and the TimingFilter) would be added before the StaticFilesFilter in which case the timing filter will print out the time, and sometimes it will be placed after, so the static files filter handles the request

Re: Enum or Drop Down

2011-02-21 Thread Taha Hafeez
To add to Thiago's golden words, you can have a simple ListValueEncoder for using index/toString() like this class ListValueEncoderT(){ final private ListT values; public ListValueEncoder(ListT values){ this.values = values; } public String toClient(T value){ return

Re: Default Ordering for BeanEditForm

2011-02-21 Thread Mark
This wasn't using the @Property annotations. I was using getters and setters. The ordering isn't working when using a bean that is injected either. I'm not sure if this is a bug or if it is just something where it is impossible to get the information for ordering. Mark On Mon, Feb 21, 2011 at

Re: Default Ordering for BeanEditForm

2011-02-21 Thread Mark
Josh, But it is documented--at least for normal beans. The notes section paragraph of the BeanEditForm documentation discusses the reorder parameter and then says: You can accomplish the same thing by changing the order of the getter methods in the bean class. The default order for properties