T5: how to obtain the current session's locale in a Translator?

2007-07-13 Thread Martin Dietze
Hi, I am currently working on Ted's DatePicker component. It uses a Translator for parsing the entered String and convert it into a Date object. The Translator is registered like this: | public static void contributeTranslatorSource(MappedConfiguration configuration) { | configuration.add("j

Re: T5 / DatePicker: Error obtaining injected value for field

2007-07-12 Thread Martin Dietze
Again answering myself... On Thu, July 12, 2007, Martin Dietze wrote: > Exception constructing service > 'ClasspathAssetAliasManager': Error invoking constructor > org.apache.tapestry.internal.services.ClasspathAssetAliasManagerImpl(Request, > Map) (at ClasspathAssetAl

Re: T5 / DatePicker: Error obtaining injected value for field

2007-07-12 Thread Martin Dietze
Replying to myself... On Thu, July 12, 2007, Martin Dietze wrote: > I modified these like this: > > | @Inject > | @Value("${net.keso.ted.jscalendarscript}/button-image.png") > | private Asset defaultButtonImage; As I now understand it, the code above should

T5 / DatePicker: Error obtaining injected value for field

2007-07-12 Thread Martin Dietze
Hi, I am trying to get the DatePicker class from the tapestry5-jscalendar package [1] to work with the latest 5.0.5 snapshot. The code did not compile initially since there were @Inject annotations like this one: | @Inject("${net.keso.ted.jscalendarscript}/button-image.png") | private Asset defa

Re: Set component parameters from page class

2007-07-02 Thread Martin Dietze
On Mon, July 02, 2007, Francois Armand wrote: >@Component(parameters="disabled=prop:isdisabled") >private TextField textField; > >public boolean getIsdisabled() { >return disabled; >} >@SetupRender >void setup() { > if(should de disabled) { >disable

Re: Set component parameters from page class

2007-07-02 Thread Martin Dietze
On Mon, July 02, 2007, Francois Armand wrote: > I'm not sure I have correctly understood your concern, so excuse me if I > answer to something else ;) > When you have a component with parameter, you have two way to specify it > the actual parameter value : > - in the template, with "paramname=bi

Re: Set component parameters from page class

2007-07-02 Thread Martin Dietze
On Mon, July 02, 2007, Massimo Lusetti wrote: > > I'd like to set some component paramameters ("disabled" for > >inputs) from within my page classes. As far as I've seen so far > >the usual way to do this would be to put a "name=${prop:value}" > >attribute into my template. Can this also be done b

Set component parameters from page class

2007-07-02 Thread Martin Dietze
Hi, I'd like to set some component paramameters ("disabled" for inputs) from within my page classes. As far as I've seen so far the usual way to do this would be to put a "name=${prop:value}" attribute into my template. Can this also be done by using a simple setter in my Java code? This would im

T5: Conditional JavaScript code

2007-06-27 Thread Martin Dietze
Hi, I would like to add inline JavaScript code to a form depending on conditions set within the page class. I thus wrote code like this: | | function myFunc() { | | for (var i = 0; i < someConstant; i++) { | doSomethin(); | } | | } | This code ca

T5: replacing Messages with my @Service

2007-06-25 Thread Martin Dietze
Hi, we recently derived our own Messages class from AbstractMessages to replace T5's i18n mechanisms by our own. We created a (spring) service "i18nMessages" for it and used code like this in page classes: | @Inject | @Service("i18nMessages") | private Messages _messages; It turned out that

Grid: Failure writing parameter rowsPerPage [...] is read-only.

2007-06-21 Thread Martin Dietze
Hi, consider the following code: [ in the template ] | [ in the page class ] | @Component(id = "EntryGrid") | private Grid _grid; [...] | private int _rowsPerPage; [...] | public void onSuccessFromGridForm() { | _rowsPerPage = getNewRowsPerPage(); | _grid.setRowsPerPage(_rowsPerPage); |

Re: T5: change a grid's rowsPerPage property dynamically?

2007-06-20 Thread Martin Dietze
On Wed, June 20, 2007, Martin Dietze wrote: > I tried this, too, but calling the setRowsPerPage() method from > within my page class had no effect either. Folowing up my own posting - the problem is still unsolved, has anyone found a solution to this? Cheers, Martin -- ---

Re: T5: change a grid's rowsPerPage property dynamically?

2007-06-20 Thread Martin Dietze
On Wed, June 20, 2007, Martin Grotzke wrote: > Would it be possible to have the grid component in your page class > so that you can update the rowsPerPage property directly? I tried this, too, but calling the setRowsPerPage() method from within my page class had no effect either. Cheers, Martin

T5: change a grid's rowsPerPage property dynamically?

2007-06-19 Thread Martin Dietze
Hi, I am using a Grid component for displaying a larger set of data. On my page I have form which I use to allow the user to set the perferred page size. When the user selects a new setting the form submits and changes the page class'es _rowsPerPage property which is used by the grid in the templ

Re: T5: inherited @Parameter's in component classes

2007-06-11 Thread Martin Dietze
Hi, On Fri, June 08, 2007, Martin Dietze wrote: > I tried to inherit some compoment classes from an abstract > component base class which contains some propeties the above > share. In the template I would then use these components like > this: > > > >

T5: inherited @Paramet's in components

2007-06-08 Thread Martin Dietze
Hi, I tried to inherit some compoment classes from an abstract component base class which contains some propeties the above share. In the template I would then use these components like this: In the base class I have: @Parameter private String _myCommonParam; public String getMyCommo

Re: T5: property lifecycle again

2007-06-07 Thread Martin Dietze
On Thu, June 07, 2007, Davor Hrg wrote: > It's a guess, but I think that you just need to persist the property. > @Persist("flash") That's what I thought, but it does not work. It seems to have to do with the way T5 initializes its member variables (my guess)... Cheers, Martin -- ---

T5: property lifecycle again

2007-06-07 Thread Martin Dietze
Hi, I want to load a page which displays a particular entry from a database. To accomplish this I create an action link in the parent page which causes the parent page's object to call a method of my display-an-entry page object passing the DB-bean as a parameter. Within that method I assign this

T5: How to display an enum?

2007-06-06 Thread Martin Dietze
Hi, for enum-based select inputs I can use value encoders to get my enum's tags displayed correctly. Now I have a template in which I need to display an enum variable. How can I use a mechanism similar to the one for select inputs? Cheers, Martin -- --- / http://herbert.the-little-red

T5: How to generate page links from Java code?

2007-06-01 Thread Martin Dietze
Hi, I'm trying to create a component for a navigation element which contains page links for all of my pages but renders the currently loaded page differently (i.e. not a href, different font etc.). It seems to me like the best way to do this is have my component's java code write the lines conta

Re: T5: when is @Persist necessary and when not...

2007-06-01 Thread Martin Dietze
On Thu, May 31, 2007, Ben Sommerville wrote: > For a form I'd say the best place to create those compound objects > is in the onPrepare method. This will be invoked before any processing/ > rendering occurs. (see the Form component subsection of > http://tapestry.apache.org/tapestry5/tapestry-c

Re: T5: select using a wrapped enum

2007-05-31 Thread Martin Dietze
On Thu, May 31, 2007, Howard Lewis Ship wrote: > Have you considered using OptionGroups as the labels? To me it seemed that if I have to create a number of selects with similar structure, just plugging in the appropriate enum might actually be an elegant solution. Do you seen anything wrong wit

Re: T5: Using my own localization backend

2007-05-31 Thread Martin Dietze
On Thu, May 31, 2007, SergeEby wrote: > You can provide your own implementation by contributing to aliasOverrides: > > http://tapestry.apache.org/tapestry5/tapestry-core/guide/alias.html Thank you for your reply. I took a look at that page, but I do not quite understand it. It seems like I lack

T5: Using my own localization backend

2007-05-31 Thread Martin Dietze
Hi, I need to use a particular localization backend for my project. As I understand, T5 provides its own code for retrieving messages based on the .properties files, and if I understand Howard's posting from Mar 4 right, simply plugging in my own ComponentMessageSource implementation is not yet s

T5: select using a wrapped enum

2007-05-31 Thread Martin Dietze
Hi, I created a selectmodel based on a enum wrapped by a generic wrapper and using a generic value encoder. By this I intend to simplify creating select inputs consisting of something like "please select" and "" followed by the enum's entries which are the only valid inputs for the select.

Re: T5: when is @Persist necessary and when not...

2007-05-31 Thread Martin Dietze
On Wed, May 30, 2007, Howard Lewis Ship wrote: > >On 5/30/07, Martin Dietze < [EMAIL PROTECTED]> wrote: [...] > >> > >For all these I have getters and setters defined. > >> > > > >> > >In my page class I have a const

Re: T5: when is @Persist necessary and when not...

2007-05-30 Thread Martin Dietze
On Wed, May 30, 2007, Howard Lewis Ship wrote: > >I have a page class which keeps form data like this: > > > >| // class MyForm > >| private Person _person; > >| private String _homepage; > > > >The class Person consists of several fields: > > > >| // class Person > >| private String _firstName >

T5: when is @Persist necessary and when not...

2007-05-30 Thread Martin Dietze
ere at all since I am only handling submitted data, or do I misunderstand anything here? Cheers, Martin P.S.: These is the relevant entries in my form: | [...] | [...] | Martin -- ------ Martin Dietze --- / -- freiheit.com -- -- [EMAIL PROTECTED] -- /

Re: T5: No tag rendered when using enum

2007-05-29 Thread Martin Dietze
On Tue, May 29, 2007, Martin Dietze wrote: > On Tue, May 29, 2007, Howard Lewis Ship wrote: > > > Just hasn't been fleshed out yet; there needs to be a negotiation between > > the MarkupWriterFactory service and the page that does the rendering to > > deter

Re: T5: No tag rendered when using enum

2007-05-29 Thread Martin Dietze
On Tue, May 29, 2007, Howard Lewis Ship wrote: > Just hasn't been fleshed out yet; there needs to be a negotiation between > the MarkupWriterFactory service and the page that does the rendering to > determine the correct MarkupWriter configuration for the result. sorry, -v, please :) Cheers, Ma

T5: more than one select options set to selected="selected"

2007-05-29 Thread Martin Dietze
Hi, I use a custom select model based on an AbstractSelectModel and using a custom ValueEncoder. When running the code I get this here generated (newlines added by me *g*): | | bitte wählen...< | option disabled="disabled" selected="selected" value="null">---< | option value="MR">

Re: T5: No tag rendered when using enum

2007-05-29 Thread Martin Dietze
Hi, > Howard Lewis Ship wrote on Sat, 24 Mar 2007 11:42:22 -0800 > This is correct behavior for rendering HTML (as opposed to XHTML). > Unlike T4, T5 knows the difference. HTML is a SGML language where > open tags are not necessarly balanced with close tags. > What's coming is the ability for T