getPage().getRequestCycle().getInfrastructure().getApplicationStateManager()

will give you the ASM from every component.

take the getPage() out when the class is a page class.

so i think this will let you go ?

Cheers,
Ron



[EMAIL PROTECTED] wrote:
I'm replacing the old getVisit() object.

So most of my pages have a call to getVisit(), which returns my AdminVisit 
object, which has the information about if they are logged in, what permissions 
they have etc.

Almost every page calls getVisit(), my Border also calls getVisit() to determine if it's 
showing a simple "Login" link on the left, or if it's showing a full menu 
because they are logged in.

I'm close to wrapping up day 3 trying to get things working! So far the end is 
not in sight.

What I've been able to gather is that I *think* I need to store 
ApplicationStateManager somewhere as a singleton, and then retrieve my visit 
object or store it as needed from there.

I've implemented this method (obviously doesn't work) in hopes that it will 
work someday, I think the idea is correct?

        protected AdminVisit getAdminVisit()
          {
           AdminVisit aVisit = (AdminVisit) 
PCTAdminApplicationServlet.asm.get("adminVisit");
if (aVisit == null){
             aVisit = new AdminVisit();
PCTAdminApplicationServlet.asm.store("adminVisit", aVisit);
           }
           return aVisit;
          }


Thanks,
Greg

-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] Behalf Of Ron Piterman
Sent: Thursday, December 14, 2006 2:23 PM
To: users@tapestry.apache.org
Subject: Re: Proper way to get ApplicationStateManager?


Tell us when do you need it and why... *maybe* we can tell you how...
Cheers,
Ron



[EMAIL PROTECTED] wrote:

Thanks Dennis - I'm not sure I understand how to go about fixing the problem if 
it's null at the times I need it :)

Greg




Greg,

You can do what you described before, but pull your visit object in your SomePage.java classes where you need it. As Ron pointed out, ASM uses other service where WebRequest is required. When you're using it, it's still null.

-Dennis


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


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





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


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




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

Reply via email to