Hi I am trying to access a environment variable in a page.  The variable is
pushed onto the environment from the enclosed component.

The code for the component is something like the following

public class PageComponent {

        @Inject
        private Environment environment;

        @BeginRender
        Object pushObject() {
            try {

                        Display display = new Display();

                        environment.push(Display.class, display);
        }
        
        @AfterRender
        void popObject () {
                environment.pop(Display.class);
        }
}


I want to now access my display object from the calling page but getting
errors that the object is not in the environment.

Calling page code is 

public class Page {

        @Environmental
        private Display display;


}

I have tried accessing this variable in BeginRender but does not work.  It
seems like the AfterRender on the component is being called before the page.


Could someone advise on a better way of doing this?

Thanks

Rizwan








--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Using-environment-to-access-object-in-component-from-calling-page-tp4505889p4505889.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to