Component only invokes javascript correctly from BeginRender

2009-11-02 Thread Jonathan O'Connor
exception while running. I also tried setting the javascript to run on DOMLoaded(), but that does not work at all, from BeginRender, or .tml. Is there any reason why it should work correctly with BeginRender method, but not a .tml file? Ciao, Jonathan O'C

Re: GridSortModel

2009-07-31 Thread Jonathan O'Connor
Hi, in your tml file, provide an override for the usernamecell. You will need to provide 2 attributes, username and usernameUppercase. Or you can modify the DataSourceModel and add a usernameUppercase. The trick is to tell the grid to use the usernameUppercase as the column data, but then in t

Changing Sort on Grid Column

2009-07-07 Thread Jonathan O'Connor
Hi, I have a Grid with a string column displaying a date. I want this column to be of String type because of my automatic code to generate a CSV file from the grid. However, if I sort the column, it is sorted using alphabetic ordering, thus 25-12-2001 comes after 01-01-2009. Is there a way to

Re: Inheriting from Component Classes

2009-07-06 Thread Jonathan O'Connor
was easier to just provide a tml file. Ciao, Jonathan On 06/07/2009 15:45, Thiago H. de Paula Figueiredo wrote: n Mon, Jul 6, 2009 at 10:20 AM, Jonathan O'Connor wrote: Hi, Hi! I'm pretty sure what the answer is, but can someone confirm that it is not poss

Inheriting from Component Classes

2009-07-06 Thread Jonathan O'Connor
e layout of the Grid. Would this work for me? Thanks for any advice, Jonathan O'Connor - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org

Re: [t5.0.18] Is it possible to nested normal jsp/html content into one layout component region?

2009-03-13 Thread Jonathan O'Connor
Zenberg, I added Tap5 pages to an existing struts 1 application. The trick is to reimplement a login page (I presume you have a login page) as a T5 page, and then you can initialize the JSP session variables you need for working together. You will also have to be careful generating links from

Re: generics and pages, components and edit blocks

2009-03-09 Thread Jonathan O'Connor
Although you can't use generics directly, I presume you can define a subclass that inherits from a given generic superclass. For instance, class CrudPage { // Stuff with T } class CustomerCrud extends CrudPage { } Would this work? I suppose if you used a generic service, then you would hav

Re: Grid: multiple within grid row

2009-02-24 Thread Jonathan O'Connor
Jason, I wanted to add onclick, onmouseover and onmouseout to the rows in my grid, and due to some timing issues with JavaScript enhancement (it could take 3-4 seconds before the JS was loaded after the browser displayed the HTML), I went with DOM rewriting. Here's a sample of my code. You can

Re: Using Tapestry 5 IOC in tapestry 4 pages.

2009-02-16 Thread Jonathan O'Connor
Travis, I don't know Tap 4, so, I don't know if the approach I will describe can work. I was able to integrate Tapestry 5 with Struts 1. I followed the approach described by Kent Tong in his E-Book on Tapestry 4. 1. The main problem is setting up the session. As struts is a thin layer on top

Re: AppModule conventions

2009-02-13 Thread Jonathan O'Connor
read the "Modules", "Services", "Decorators" and "Configuration" pages, at a bare minimum. Robert On Feb 13, 2009, at 2/137:38 AM , Jonathan O'Connor wrote: Hi, I've been looking for documentation about how the AppModule class works. Sadly,

AppModule conventions

2009-02-13 Thread Jonathan O'Connor
Hi, I've been looking for documentation about how the AppModule class works. Sadly, I have only found a few examples of bind/contribute and build methods, but nothing that explains when and what to use. I would like to know: 1. Which methods should be static and which non-static? Does it matte

Re: [T5] Internationalizing included js

2009-02-11 Thread Jonathan O'Connor
Alex, according to Thiago, you can have string substitution in the javascript: >>>THIAGO Another solution is to put a Tapestry expression expansion inside the Javascript code: Page class: public Link getEventLink() { return componentResources.createXXXLink(parameters); } Template: window

Re: Hibernate ID

2009-02-10 Thread Jonathan O'Connor
Uli, Using Object for key fields is a standard micro pattern in JPA and Hibernate. Of course, the DB does not want to save null as a key field value, but the most people get the entity manager to auto-generate keys for their objects. By leaving the key as null, the entity manager knows that i

Re: How can I modify the rendering of grid rows?

2009-02-09 Thread Jonathan O'Connor
m Mon, 09 Feb 2009 21:09:06 -0300, Jonathan O'Connor escreveu: Thiago, Hello, Jonathan! I am most impressed with Prototype. I really like using $$(). Me too. As I can see, you quickly learned enough Prototype in a couple hours to do what you needed. :) Here's my code to

Re: How can I modify the rendering of grid rows?

2009-02-09 Thread Jonathan O'Connor
#x27;, function(ev) { this.className = 'DataTableEntryOdd'; }); Event.observe(elmt, 'click', click); }); }); Hope this helps the next person! Jonathan On 09/02/2009 18:52, Thiago H. de Paula Figueiredo wrote: Em Mon, 09 Feb 2009 14:40:33 -0300, Jonat

Re: How can I modify the rendering of grid rows?

2009-02-09 Thread Jonathan O'Connor
I had another idea, that I could modify the DOM tree after rendering (say in cleanupRender) but I haven't seen any examples do this. Ciao, Jonathan On 09/02/2009 18:27, Thiago H. de Paula Figueiredo wrote: Em Mon, 09 Feb 2009 14:19:20 -0300, Jonathan O'Connor escreveu: Hi, I would lik

How can I modify the rendering of grid rows?

2009-02-09 Thread Jonathan O'Connor
Hi, I would like to modify the way grid rows are rendered. I want add an onmouseout, onmouseover handlers to the tags. I suppose I could do a load of cut and paste, and reimplement the grid, but is there an easier way? Ciao, Jonathan

Re: Dynamic Variables in Asset declarations

2009-02-09 Thread Jonathan O'Connor
Dave, thinking out of the box, can you instead set up some server cron job to copy the css files over from the other web server to your server. Would that make it easier? Jonathan On 08/02/2009 14:07, Dave Greggory wrote: So, tell me whether I have this straight. In order to create Asset ins

Re: Protecting ActionLinks when using a Dispatcher.

2009-02-06 Thread Jonathan O'Connor
loader for the class, and bingo! No more page instanciation. Ciao, Jonathan On 06/02/2009 11:22, Thiago H. de Paula Figueiredo wrote: On Thu, Feb 5, 2009 at 10:43 PM, Jonathan O'Connor wrote: Thiago, Hi! I guess you want the Class if your doing annotation based protecti

Re: [T5] filesystem asset problems

2009-02-05 Thread Jonathan O'Connor
Manuel, look at the AssetDispatcher class. That will clear up a lot of problems, I think. Ciao, Jonathan On 06/02/2009 00:49, manuel aldana wrote: hi, want to create a new asset-type, which makes images available from filesystem (file:/) to webapp (http:/), but somehow I don't get it... I

Re: Protecting ActionLinks when using a Dispatcher.

2009-02-05 Thread Jonathan O'Connor
, Feb 5, 2009 at 12:51 PM, Thiago H. de Paula Figueiredo wrote: Em Thu, 05 Feb 2009 15:20:02 -0300, Jonathan O'Connor escreveu: Thiago, Hi! I thought about the service idea, but what would it look like? Class extractPageClass(String requestPath) would be wha

Re: Protecting ActionLinks when using a Dispatcher.

2009-02-05 Thread Jonathan O'Connor
onent class will need to be involved in the complete solution. Hmm, interesting design problem. It's after midnight here, so maybe I'll think some more tomorrow. Ciao, Jonathan On 05/02/2009 20:51, Thiago H. de Paula Figueiredo wrote: Em Thu, 05 Feb 2009 15:20:02 -0300, Jonathan O&#x

Re: Protecting ActionLinks when using a Dispatcher.

2009-02-05 Thread Jonathan O'Connor
xtractPageClass only on the UsesPagesDispatchers. Does that all make sense? Or is there a better way? Ciao, Jonathan On 05/02/2009 18:59, Thiago H. de Paula Figueiredo wrote: Em Thu, 05 Feb 2009 07:40:24 -0300, Jonathan O'Connor escreveu: Daniel, I was looking at this problem the other

Re: Protecting ActionLinks when using a Dispatcher.

2009-02-05 Thread Jonathan O'Connor
Daniel, I was looking at this problem the other day, and you should look at the ComponentEventDispatcher. I think you need to first check if you get a matching page, and then check if you have an event. You can then extract the Pagename from the request path using that monster Reg exp. Sadly,

Re: Dynamic Assets

2009-02-04 Thread Jonathan O'Connor
Sid, I think you will have to create a new binding prefix like "myAsset:", and hook it in to a dispatcher that returns a StreamResponse. That way you can decide how to read the images, e.g. from DB, or from directory on your server. Your myAsset binding prefix will probably convert the value i

NPE when adding sortable property to model without Conduit

2009-01-23 Thread Jonathan O'Connor
Hi, I was adding a property to a model, and I set the PropertyConduit to null. Then when the grid was rendering I got a big long exception stack trace starting with an NPE: * org.apache.tapestry5.internal.grid.CollectionGridDataSource$2.compare(CollectionGridDataSource.java:78) * org.a

Re: T5: Component Suggestion/Question

2009-01-22 Thread Jonathan O'Connor
James, I just did this yesterday. Its based on the code found in the WIKI: http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained My Javascript code sets the class of an element to "vanished" that does display:none in my stylesheet. // A class that hides and shows the simple and com

Adding onclick to row in Grid component

2009-01-21 Thread Jonathan O'Connor
Hi, I have a grid, and I want the user to be able to click on a row to select it. I know I can add a link to each cell, but that's not very nice, as the link only works if you click on text, and there could be plenty of whitespace in the row. I see there is a GridRows component, which is part

Re: Where to check that the user is logged in when rendering a page

2009-01-16 Thread Jonathan O'Connor
rect. No doubt, I'll get used to it. Ciao, Jonathan On 16/01/2009 15:55, Thiago HP wrote: On Fri, Jan 16, 2009 at 1:42 PM, Jonathan O'Connor wrote: Hi, Hi! I have been reading the documentation, and I haven't seen what I need to find out: How can a page fin

Where to check that the user is logged in when rendering a page

2009-01-16 Thread Jonathan O'Connor
Hi, I have been reading the documentation, and I haven't seen what I need to find out: How can a page finding that the user is not logged in, it should jump to a login page, and optionally jump back to the requested page? I already know how to check the session to see if a) there is a session,

Re: T5: Pages can't have getErrorMessage() method

2009-01-13 Thread Jonathan O'Connor
page class (shown in the exception page). On 13/01/2009 12:30, Jonathan O'Connor wrote: Hi, I have a page class that had a String getErrorMessage() method. Sadly, this is not allowed by Tap5, and I get a lovely exception page telling exactly what is going on. Is this documented anywher

T5: Pages can't have getErrorMessage() method

2009-01-13 Thread Jonathan O'Connor
Hi, I have a page class that had a String getErrorMessage() method. Sadly, this is not allowed by Tap5, and I get a lovely exception page telling exactly what is going on. Is this documented anywhere? I did a google for Tap5 and getErrorMessage, but didn't see anything relevant. My work aroun

Re: T5: How to inject a Link

2009-01-05 Thread Jonathan O'Connor
new URL(page); Hope this helps anyone in the same boat as I was, Jonathan On 03/01/2009 20:22, Howard Lewis Ship wrote: You can return a URL no problem. The trick is to generate a proper URL even when behind a firewall. On Fri, Jan 2, 2009 at 9:51 AM, Jonathan O'Connor wrote: Hi, it

Re: T5 newbie books/tutorials and a couple of questions?

2009-01-03 Thread Jonathan O'Connor
Kevin, I'm a believer in Samson and Delilah. Cutting your hair is making you weak! As a chess player, I never play chess the week after I get a haircut, as I just loose. Also, Garry Kasparov, former world champion, used to say that the brain worked better if it was 1 degree warmer than the res

Re: T5: How to inject a Link

2009-01-03 Thread Jonathan O'Connor
the remote address is null :-( I'll let you off the hook now! Ciao, Jonathan On 03/01/2009 21:12, Jonathan O'Connor wrote: Howard, I tried the following: HttpServletRequest req = getRequest(); String page = "http://"; + req.getLocalAddr() +

Re: T5: How to inject a Link

2009-01-03 Thread Jonathan O'Connor
2009 20:22, Howard Lewis Ship wrote: You can return a URL no problem. The trick is to generate a proper URL even when behind a firewall. On Fri, Jan 2, 2009 at 9:51 AM, Jonathan O'Connor wrote: Hi, it must be too much Christmas cheer, but I am not sure how to jump to a non-Tap

T5: How to inject a Link

2009-01-02 Thread Jonathan O'Connor
n the internal package, and so unusable)? Or should I generate a relative URL? Thanks and Happy New Year to one and all, Jonathan O'Connor - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional comman

Re: T5: Proper project layout?

2008-12-18 Thread Jonathan O'Connor
;Connorwrote: Jonathan, yes, I used to be a big fan of spindle when I worked in Tap3, many moons ago! I'll grab it now. Ciao, Jonathan On 18/12/2008 15:15, Jonathan Barker wrote: The Loom plugin for Eclipse (see link on the T5 main page) makes that jumping around painles

Re: T5: Proper project layout?

2008-12-18 Thread Jonathan O'Connor
ssage- From: Jonathan O'Connor [mailto:ninki...@eircom.net] Sent: Thursday, December 18, 2008 08:16 To: users@tapestry.apache.org Subject: T5: Proper project layout? Hi, I've just started working with Tapestry 5, and I have found 2 different project layouts. Howard (I presume) suggested t

Re: T5: Proper project layout?

2008-12-18 Thread Jonathan O'Connor
Andy, thanks. I just joined up last night! Ciao, Jonathan On 18/12/2008 13:37, Andy Pahne wrote: This has been discussed a few days ago. Search for the thread "Advantages of various .tml storage locations?" Andy Jonathan O'Connor schrieb: Hi, I've just started wor

T5: Proper project layout?

2008-12-18 Thread Jonathan O'Connor
esources folder." Is this documentation up to date? Thanks, Jonathan O'Connor - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org

Re: Tapestry 3 and Valid XHTML Forms (generated Script tag)

2007-05-30 Thread Jonathan O'Connor
Andrew, sorry I can't help you on that. I guess get out and grep for script. Try putting a breakpoint on the rendering methods, and see what happens. Ciao, Jonathan O'Connor XCOM Dublin And

Re: Tapestry 3 and Valid XHTML Forms

2007-05-30 Thread Jonathan O'Connor
should be able to do the same with the Form class too. Sorry I can't be more explicit, but its over a year since I did any Tapestry work (all Tap3). Good luck, Jonathan O'Connor XCOM Dublin And

Re: What are benefits of pure HTML templates?

2007-05-23 Thread Jonathan O'Connor
a $Remove$ component. So, you could add HTML tags from a component, and see it immediately in the browser. Adding CSS on top of that is easy. This is one of the reasons I hate the JSF stuff, because the "HTML" looks so ugly. I do hope Tap5 doesn't go down the same root. Ciao, Jona