drgorb <maillist <at> tapestryforums.com> writes:

> I try to use getContainer() inside a component to get at its parent, but the 
> method allways returns the page object, no matter what.

Try:

class Record ... {
  final static String KEY="ActiveRecord";

  void prepareForRender(IRequestCycle cycle) {
    super.prepareForRender(cycle);
    cycle.setAttribute(KEY, this);
  }
  void cleanupAfterRender(IRequestCycle cycle) {
    cycle.removeAttribute(KEY);
    super.cleanupAfterRender(cycle);
  }
  public static Record getActiveRecord(IRequestCycle cycle) {
    return (Record )cycle.getAttribute(KEY);
  }
}

--
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