Re: Tapestry Hibernate Session usage

2013-05-13 Thread Dmitry Gusev
On Tue, May 14, 2013 at 12:05 AM, Boris Horvat wrote: > Hi Dmitry > > Please ignore the naming as I haven't really user he real names here as > this is just an example (the project also has nothing to do with Students > but it is easier for the explanations :) ). In all fairness though I do > pref

Re: how to use HibernateEntityValueEncoder

2013-05-13 Thread Jens Breitenstein
Hi Ken, please paste the whole Bean class, too. I got an NPE in the past due to an leading underscore in my pk member name. "_pk" --> NPE "pk" --> works fine. Guess this is a bug, because Tapestry in general is happy with "_" when accessing properties. Jens Am 13.05.13 23:26, schrieb Ken

RE: Strategy for dealing with stale sessions?

2013-05-13 Thread Ben Titmarsh
Lenny, George, Thanks for the replies. I actually left a somewhat crucial piece of information out of my initial post in that I am talking specifically about Ajax! So Lenny this library looks fantastic, exactly what I was looking for! > CC: users@tapestry.apache.org > From: lpri...@hope.nyc.n

RE: how to use HibernateEntityValueEncoder

2013-05-13 Thread Ken in Nashua
its obviously happening on the valueencoder final PropertyAdapter propertyAdapter = classPropertyAdapter.getPropertyAdapter(labelProperty);5455final ValueEncoder encoder = this.valueEncoderSource.getValueEncoder(propertyAdapter.getType());56 I changed the property metho

Re: how to use HibernateEntityValueEncoder

2013-05-13 Thread Thiago H de Paula Figueiredo
On Mon, 13 May 2013 17:15:05 -0300, Ken in Nashua wrote: Hi Thiago, Here is the console... after I induce the NPE. It doesn't contain the stack trace, so it's completely useless. -- Thiago H. de Paula Figueiredo - To uns

RE: how to use HibernateEntityValueEncoder

2013-05-13 Thread Ken in Nashua
Thanks Jens... I believe I posted the Year.class for Thiago the primary keye is just ID Is this a bug ? I would like to get into the create routine for the factory but dont know how

RE: how to use HibernateEntityValueEncoder

2013-05-13 Thread Ken in Nashua
Ooops... this is the code I am exercising... @Persist @Property private EnumValueEncoder yearValueEncoder; @Inject @Property private TypeCoercer typeCoercer; @Inject private SelectModelFactory selectModelFactory; @Property private SelectModel yearSelectM

RE: how to use HibernateEntityValueEncoder

2013-05-13 Thread Ken in Nashua
Thanks Jens... I just stepped thru debugger... @SetupRender void setupRender() { grid.reset(); years = new ArrayList(TynamoUTIL.loadCollection(hibernatePersistenceService, Year.class)); yearValueEncoder = new EnumValueEncoder(typeCoercer, Year.class); t

RE: how to use HibernateEntityValueEncoder

2013-05-13 Thread Ken in Nashua
Hi Thiago, Here is the console... after I induce the NPE. 2013-05-13 16:11:14.622:INFO:oejs.Server:jetty-7.6.0.v20120127 2013-05-13 16:11:22.970:INFO:oejpw.PlusConfiguration:No Transaction manager found - if your webapp requires one, please configure one. 2013-05-13 16:11:23.424:INFO:oejsh.Conte

Re: how to use HibernateEntityValueEncoder

2013-05-13 Thread mailingl...@j-b-s.de
Hi Ken! Just a shot in the dark: Are you sure the PKs of your hibernate beans are not null (maybe you have a newly created bean instance which is not persited yet)? Afair the HibernateValueEncoder requires properly filled PK fields otherwise pk.toString() fails. Unfortunately the stacktrace i

Re: Tapestry Hibernate Session usage

2013-05-13 Thread Boris Horvat
Hi Dmitry Please ignore the naming as I haven't really user he real names here as this is just an example (the project also has nothing to do with Students but it is easier for the explanations :) ). In all fairness though I do prefer to append DAOService in front as it allows me to search for the

RE: how to use HibernateEntityValueEncoder

2013-05-13 Thread Ken in Nashua
whats so bad about a year class ? @Entity @ClassDescriptor(hasCyclicRelationships = true, nonVisual = false) public class Year implements Cloneable, Serializable { private static final Log log = LogFactory.getLog(Year.class); private Integer id = null; private Integer yearStart = new

Re: how to use HibernateEntityValueEncoder

2013-05-13 Thread Thiago H de Paula Figueiredo
By the way, do you really have an Year class? Why? On Mon, 13 May 2013 16:00:50 -0300, Ken in Nashua wrote: thanks guys... but I keep gettign an NPE @Persist @Property HibernateEntityValueEncoder yearValueEncoder; @Inject private ValueEncoderSource valueEncoderSource;

Re: how to use HibernateEntityValueEncoder

2013-05-13 Thread Thiago H de Paula Figueiredo
Please copy stack traces from the console, not the error page. On Mon, 13 May 2013 16:00:50 -0300, Ken in Nashua wrote: thanks guys... but I keep gettign an NPE @Persist @Property HibernateEntityValueEncoder yearValueEncoder; @Inject private ValueEncoderSource valueEnc

RE: how to use HibernateEntityValueEncoder

2013-05-13 Thread Ken in Nashua
Here is the tml How do I know which valuencoder its using? Why the NPE ?

RE: How to stay on same page

2013-05-13 Thread nhhockeyplayer nashua
Thnanks jens Here is my passivate @OnEvent(EventConstants.PASSIVATE) Object[] passivate() {return new Object[] { beanType }; } but I toggle it when I hit submit @OnEvent(value = "go") public Object submit() { logger.debug("In submit : "); switch (reportType) { case TEAM:

RE: how to use HibernateEntityValueEncoder

2013-05-13 Thread Ken in Nashua
thanks guys... but I keep gettign an NPE @Persist @Property HibernateEntityValueEncoder yearValueEncoder; @Inject private ValueEncoderSource valueEncoderSource; @Inject private SelectModelFactory selectModelFactory; private ArrayList years; @Setu

Re: Strategy for dealing with stale sessions?

2013-05-13 Thread Lenny Primak
FlowLogix library handles this generically by reloading the page if session expired. Take a look specifically at @AJAX annotation. http://code.google.com/p/flowlogix/wiki/TapestryLibrary http://code.google.com/p/flowlogix/wiki/TLAJAXAnnotation On May 13, 2013, at 6:24 AM, Ben Titmarsh wrote:

Re: Strategy for dealing with stale sessions?

2013-05-13 Thread Michael Prescott
I think this is an application-specific question. When the application server's underlying session expires, all your @Persisted fields become null, as you say. If the user continues, it's just as if a random, unknown user arrived and attempted to start interacting with your application somewhere

Re: How do you remove link Parameters generically?

2013-05-13 Thread Barry Books
Thanks, That does exactly what I needed. It appears to be called before the new parameters are added so it lets you remove the defaults. On Mon, May 13, 2013 at 7:27 AM, Alejandro Scandroli < alejandroscandr...@gmail.com> wrote: > Hi Barry > > I've been using a different workaround for this and

Re: How do you remove link Parameters generically?

2013-05-13 Thread Alejandro Scandroli
Hi Barry I've been using a different workaround for this and maybe it could help you. You can listen for the DECORATE_PAGE_RENDER_LINK and then "decorate" the link as you want. Add something like this to your page. @OnEvent(EventConstants.DECORATE_PAGE_RENDER_LINK) void decoratePageRenderLink(Lin

Re: how to use HibernateEntityValueEncoder

2013-05-13 Thread Taha Hafeez Siddiqi
In case you exclusively want to get the encoder, you can inject ComponentDefaultProvider and then use http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/ComponentDefaultProvider.html#defaultValueEncoder(java.lang.String, org.apache.tapestry5.ComponentResources) regards Tah

Re: how to use HibernateEntityValueEncoder

2013-05-13 Thread Thiago H de Paula Figueiredo
On Mon, 13 May 2013 04:44:36 -0300, Ken in Nashua wrote: Hi Folks, Hi! Finding scant docs on this class usage. And getting pulled down a rabbit hole. Are there any example usages of this ? All i want to do is populate my select component with database entities strings. HibernateEnt

Strategy for dealing with stale sessions?

2013-05-13 Thread Ben Titmarsh
My application is heavily dependent on state using @Persist annotations. If a user gets the application into a certain state, then their session becomes stale (i.e. they leave their computer for half an hour), what is the preferred approach for graceful recovery of the application now that the

Re: hover pop show image widget

2013-05-13 Thread mailingl...@j-b-s.de
Hi Ken! I use bootstrap / tapestry-jquery for this. See: http://tapestry5-jquery.com/mixins/docstooltip Sent from my iPhone On 13.05.2013, at 04:29, nhhockeyplayer nashua wrote: > Hi Folks, > > Is there a hover show widget? Something like what netflix does when you hover > over a movie, it

Re: Tapestry Hibernate Session usage

2013-05-13 Thread Dmitry Gusev
On Mon, May 13, 2013 at 2:59 AM, Boris Horvat wrote: > Hi all, > > Hi! > I have a question about what should be the best way to use hibernate > session in tapestry. > > My environment consists of 2 layers (relevant to this). > > The first one would be a group of classes that represent an access

how to use HibernateEntityValueEncoder

2013-05-13 Thread Ken in Nashua
Hi Folks, Finding scant docs on this class usage. And getting pulled down a rabbit hole. Are there any example usages of this ? All i want to do is populate my select component with database entities strings. thanks

Re: How to stay on same page

2013-05-13 Thread mailingl...@j-b-s.de
Hi Ken! Can you paste your onPassivate method? Maybe you always return Team.class as context parameter instead of beanType member? I expect you want to see the selection in the URL like: query/team right? Than you need an proper on activate, too. So if you use your enum ReportType in onPassiva