Ted Steen <ted.steen <at> gmail.com> writes:

> What I am looking for is information on when pageAttached(...) and
> pageBeginRender(...) is called.
> when getIsRewind() == true and when it is not.
> some times pageBeginRender(...) with getIsRewind == false never ever
> gets invoked..

pageBeginRender() is called when:
1) a response page is about to render; or
2) when the Form it contains is about to be rewound.

So this is case 1) for you. As long as you're talking about
the right page, pageBeginRender() will be called.

> so I have no Idea when to set persisten objects default value, I`m
> having trouble getting hibernate to play nice with tapestry.
> etc.

Using pageBeginRender() should be fine:

class YourPage implements PageBeginRenderListener {
  @Persist("client")
  public abstract String getObjectId();

  public abstract void setObject(MyObject obj);
  
  void pageBeginRender() {
    if (getObjectId() is found in DB) {
       setObject(load obj from DB);
    } else {
       setObject(new MyObject(...));
    }
  }
  void onSubmit() {
    if (getObjectId() is not found in DB) {
       getObject() and save it to the DB;
    }
  }
}

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to