It worked after all.
The trick was to create a page property with the facilities list and
initialize it during pageBeginRender. It seems that ognl has a problem with
expressions of the type a.b.c where b or c is null.
So the solution was to add in .page:
and in pageBeginRender:
setRoomFacilityList(getRoom().getFacilities());
...along with an IPrimaryKeyConverter implementation in the same .java file
(without this, the data that gets transmitted during form rewind can get
huge).
Grigoris
On Jan 25, 2008 7:51 PM, Ulrich Stärk <[EMAIL PROTECTED]> wrote:
> Page rewinding is a necessary mechanism to map HTML attribute names and
> their values to the corresponding page properties. When the page is
> rendered, Tapestry generates HTML attribute names and values for each
> element inside your form. When the form is submitted the same mechanism
> makes sure the submitted values map correctly to your page properties.
> There is no way to get around this. So you will either have to persist
> your room facility in the session or if it is a persistent object you
> could just store its identifier and load it from your persistence store
> upon rewinding. You'ld do this by implementing one of the interfaces
> mentioned here:
> http://tapestry.apache.org/tapestry4.1/usersguide/events.html
>
> Uli
>
> Grigoris Ioannou schrieb:
> > Good evening all,
> >
> > I have a question regarding Tapestry 4.1.3 and page rewinding. So, in my
> > page, there is a @For component:
> >
> >
> >
> >
> >
> >
> >
> >
> > I implemented the IPrimaryKeyConverter interface and at first pass it
> works
> > fine. But when the form is submitted, i see that the page tries to
> render
> > itself again, finding the room parameter null, and ofcourse throwing a
> null
> > exception, without even entering the facilityConverter.
> >
> > I also note that the problem remains even if I include this @For
> component
> > inside an @If component (in the .html page):
> >
> >
> >
> >
> >
> > Is there a way to avoid this stupid null exception? Can I somehow
> disable
> > page re-rendering on rewind? I would like to avoid persisting anything
> in
> > the session.
> >
> > Thank you in advance,
> > Grigoris
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>