Hi,

I'm having trouble getting my head around some behavior that I'm seeing. Here's the scenario:

I have two components that appear on every page of my application, component A & B.

When I start a new Visit to the application, the Home page renders and users can invoke an action on component A that sets a cookie and returns the next page. Based on the value of this cookie some behavior on component B should change when the next page is rendered. Simple enough.

The problem I'm having, for whatever reason, component B is not able to retrieve the cookie value on the first render after the cookie is originally set. All subsequent actions (any action, not just the one related to Component A), component B is able to retrieve the cookie successfully.

Here's where I get lost trying to figure out how the RequestCycle works. Both components (A & B) implement PageRenderListener and define a pageBeginRender(PageEvent event) method (this is where I attempt get a handle of the cookie). I've added some debugging output to these methods and the results are a bit puzzling.

After first action is invoked, the order goes something like this:

- Component A: pageBeginRender() is fired
- Component B: pageBeginRender() is fired
- Cookie is written
- Component A: pageBeginRender() is fired (2nd time)
- Component B: pageBeginRender() is fired (2nd time)
- Attempt to retrieve cookie returns null
- Component A: pageBeginRender() is fired (3rd time)
- Component B: pageBeginRender() is fired (3rd time)
- Additional attempt to retrieve cookie returns null
- Next page renders.

The any additional request, the cycle's path seems much simpler:

- Component A: pageBeginRender() is fired
- Component B: pageBeginRender() is fired
- Cookie successfully returns

Anyone have any advice on what's going on here?

Thanks,
Eric




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



Reply via email to