Re: Tapestry Combobox

2014-10-23 Thread Chris Poulsen
I don't know what you are trying to achieve, but you can always provide your own select model, if you need something more flexible than what the standard coercions provide. (if that was the question?) -- Chris On Thu, Oct 23, 2014 at 12:36 AM, Sloshed Techie wrote: > Hello, > > Have just start

Re: Tapestry Combobox

2014-10-23 Thread Thiago H de Paula Figueiredo
On Thu, 23 Oct 2014 05:05:00 -0200, Chris Poulsen wrote: I don't know what you are trying to achieve, but you can always provide your own select model, if you need something more flexible than what the standard coercions provide. (if that was the question?) That's correct, but I guess a Val

Page with @Persist and default value fails to instantiate

2014-10-23 Thread Deepak
I'm just beginning with Tapestry and referring to "Tapestry 5, Building Web Applications" by Alexander Kolesnikov. But I'm using version 5.3.7. I have a page with a property annotated with @Persist and a default value of an enum. Male Female @Property @Persist private String gender = "F"; W

Re: Page with @Persist and default value fails to instantiate

2014-10-23 Thread Chris Poulsen
I think that private String gender = "F"; is suspect, you should probably not initialize it to "F", instead you can use onActivate or setupRender to default it, if it is null. -- Chris On Thu, Oct 23, 2014 at 2:45 PM, Deepak wrote: > I'm just beginning with Tapestry and referring to "Tapestr

Re: Page with @Persist and default value fails to instantiate

2014-10-23 Thread George Christman
Male Female @Property @Persist private String gender; void onActivate() { gender = "F"; } or void onSetupRender() { gender = "F"; } On Thu, Oct 23, 2014 at 9:24 AM, Chris Poulsen wrote: > I think that > > private String gender = "F"; > > is suspect, you should probably not init

Re: Tapestry Combobox

2014-10-23 Thread George Christman
1. You can either put all your values in your enum and store the string in the database or 2. build a simple lookup table in the database containing your enum values and create a relationship with your primary table. I would recommend option 2. There would be no need for a value encoder then. It w

Re: Page with @Persist and default value fails to instantiate

2014-10-23 Thread Thiago H de Paula Figueiredo
On Thu, 23 Oct 2014 10:45:00 -0200, Deepak wrote: @Property @Persist private String gender = "F"; As Chris and George already said, never, never ever initialize a page, component or field in its initialization. Their suggestion of using setupRender() or onActivate() to initialize it is sp

Re: Page with @Persist and default value fails to instantiate

2014-10-23 Thread Deepak
Great, that worked !!! As a general rule of thumb, does this mean that i should initialize variables in these methods rather than during declaration ? On Thu, Oct 23, 2014 at 6:54 PM, Chris Poulsen wrote: > I think that > > private String gender = "F"; > > is suspect, you should probably not ini

Re: Page with @Persist and default value fails to instantiate

2014-10-23 Thread Deepak
Please ignore my 2nd question. I did not notice the rest of the conversation in my inbox..sorry, my apologies. On Thu, Oct 23, 2014 at 10:06 PM, Deepak wrote: > Great, that worked !!! As a general rule of thumb, does this mean that i > should initialize variables in these methods rather than dur

Re: Page with @Persist and default value fails to instantiate

2014-10-23 Thread Deepak
I'm noticing that the exception raised by my tapestry application do not appear as a stack track and not at all colored and highlighted as shown in various posts and blogs. The exception is just displayed in a single sentence paragraph. Am i missing any jar for the decoration ? The jars I've used i

Re: Page with @Persist and default value fails to instantiate

2014-10-23 Thread Thiago H de Paula Figueiredo
On Thu, 23 Oct 2014 14:56:40 -0200, Deepak wrote: I'm noticing that the exception raised by my tapestry application do not appear as a stack track and not at all colored and highlighted as shown in various posts and blogs. The exception is just displayed in a single sentence paragraph. Am i

Re: Tapestry Combobox

2014-10-23 Thread Sloshed Techie
Hi, Good Afternoon! Thanks. Due to some constraints for using only Enum. can you please elaborate the step 1. It should be something like the values for select box should be loaded as per the values defined in Enum but with the selected enum value( which is stored in database), should be the def

Re: Tapestry Combobox

2014-10-23 Thread George Christman
Have you seen the following example? http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Select.html On Oct 23, 2014 2:10 PM, "Sloshed Techie" wrote: > Hi, > > Good Afternoon! > > Thanks. Due to some constraints for using only Enum. can you please > elaborate the s

Re: Page with @Persist and default value fails to instantiate

2014-10-23 Thread Deepak
Hi, Thiago. No, I've not created log4j.properties file but I've set the app to run in development mode under web.xml as tapestry.execution-mode development I've attached the screen shot of how exception is displayed in the app. Thanks. On Thu, Oct 23, 2014 at 10:50 PM, Thiago H de Pa

Re: Page with @Persist and default value fails to instantiate

2014-10-23 Thread Thiago H de Paula Figueiredo
On Thu, 23 Oct 2014 17:01:42 -0200, Deepak wrote: Hi, Thiago. Hi! No, I've not created log4j.properties file but I've set the app to run in development mode under web.xml as tapestry.execution-mode development This just tells DevelopmentModule to be loaded alongside AppModul

Re: Tapestry Combobox

2014-10-23 Thread Sloshed Techie
Hello, Thanks. I had a look before it. Apparently, I can make it work with a simple Enum. Hope I didn't overlook but it doesn't talk about the scenario I'm talking about. Thanks! Niks On Thu, Oct 23, 2014 at 8:23 PM, George Christman wrote: > Have you seen the following example? > > > http:/

Re: 5.4 application-version still required?

2014-10-23 Thread Howard Lewis Ship
That is correct; tapestry.application-version is no longer needed. Each individual asset gets its own content fingerprint. This has huge implications for upgrades of you application, as often, all the unchanged assets will maintain the same fingerprint, and already be present in the end-user's bro

Re: 5.4 application-version still required?

2014-10-23 Thread Paul Stanton
great! On 24/10/2014 8:37 AM, Howard Lewis Ship wrote: That is correct; tapestry.application-version is no longer needed. Each individual asset gets its own content fingerprint. This has huge implications for upgrades of you application, as often, all the unchanged assets will maintain the same

Putting property values in Validate

2014-10-23 Thread Name Surname
Lets say I have an input field with validation parameter something like and in my Java code I have a public function getNumber(){ } Now is it possible to manipulate with Validation like this and how can I achieve it?

Re: Page with @Persist and default value fails to instantiate

2014-10-23 Thread Deepak
Thanks a lot for the pointer. With the setting of tapestry.production-mode the stack trace is now displayed in its full glory :) On Fri, Oct 24, 2014 at 1:02 AM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Thu, 23 Oct 2014 17:01:42 -0200, Deepak wrote: > > Hi, Thiago. > > > H

Re: Page with @Persist and default value fails to instantiate

2014-10-23 Thread Geoff Callender
This might help you further. http://jumpstart.doublenegative.com.au/jumpstart7/examples/infrastructure/exceptionreport Cheers, Geoff On 24 Oct 2014, at 2:30 pm, Deepak wrote: > Thanks a lot for the pointer. With the setting of tapestry.production-mode > the stack trace is now display

Re: Tapestry Combobox

2014-10-23 Thread Chris Mylonas
Sloshed hey hehehe :) I'm doing something with a select atm, so here's my 2c on howto do what you want, but I'm using Objects rather than simple enums, but you can make a List of your ENUMTYPE or something equally (un)elegant i guess. In page class you're going to need this stuff pri

Re: Tapestry Combobox

2014-10-23 Thread Lance Java
I'd just create a wrapper object that can point to either a db entity, or an enum instance. eg: public class Wrapper { private MyEnum myEnum; private DbEntity dbEntity; public String getKey() { return myEnum != null ? myEnum.name() : String.valueOf(dbEntity.getId()); } publ