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:

  <component id="roomFacilities" type="For">
    <binding name="source" value=" room.facilities" />
    <binding name="value" value="currentRoomFacility" />
    <binding name="index" value="currentRoomFacilityIndex" />
    <binding name="converter" value="facilityConverter" />
  </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):

<div jwcid="@If" condition="ognl:room.facilities.size() > 0">
  <span jwcid="roomFacilities">
</div>

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]

Reply via email to