Hi all,
I have a page class, which in "beginRender" pushes a class into the
environment. Then a component uses that environmental value. This works
fine, and I use it in the page activation and passivation methods and
all is well.
In the component, I have a form which sets some values. When I submit
the form, I get the message "No object of type SomeClass is available in
the Environment".
My question is: does the form submission passivate the page class? It
seems like it doesn't, is that the correct behaviour? I think I'm
misunderstanding how events and the like work. What should I be doing? I
can get around it by passing in the instance of 'SomeClass' as context
to the form, but that means I can't include other values that the page
itself passivates.
I've added some "psuedo-code" below which demonstrates what my code
looks like. I've deliberately left out lots of chaff to make it clearer.
Carl
class Page {
void onActivate( SomeClass test ) { this.test = test }
void beginRender{ environment.push( SomeClass.class, this.test ); }
void afterRender{ this.test = environment.pop( SomeClass.class ); }
Object[] onPassivate() { return new Object[]{ this.test }; }
}
class Component {
@Environmental SomeClass test;
void setFoo( int val ) { test.setFoo( val ); }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org