Hi again,

The workaround is not what my initial e-mail was about - the reason for this behaviour is what was bothering my colleague and me. After spending some time investigating the issue it turned out that all components that have at some point occupied the WOSwitchComponent are registered as subcomponents in the component that contains the switch. These components are not removed from the subcomponents list once they're no longer displayed and get awaken in the component's _awakeInContext(...) method. I'm not sure whether this is a bug, but it's definitely something to keep in mind when using WOSwitchComponent.

Cheers,
Katya

On Oct 22, 2009, at 3:06 PM, Ramsey Lee Gurley wrote:

I'm a bit surprised by the behavior myself, and I'm not sure why it does that. I would imagine using a stateless component might help reduce the number of cached components. You can also simply return a clean page like

        public WOActionResults goToPageOne() {
                System.out.println("Main.goToPageOne");
                WOComponent result = pageWithName(Main.class.getName());
result.takeValueForKey(ComponentOne.class.getSimpleName(), "componentName");
                return result;
        }

if the multiple awakes are causing you some problem.

Ramsey

On Oct 22, 2009, at 2:22 AM, Katya Yurukova wrote:

Hi Andrew,

Yes, awake() and sleep() are called for previously loaded components despite that they are no longer present in the current R- R loop.
Here's a simple test case for anyone interested.


<WOSwithcComponentTest.zip>



Cheers,
Katya


On Oct 22, 2009, at 2:14 AM, Andrew Lindesay wrote:

Hello Katya;

That is interesting. So you mean that previous components which previously resided in the switch are restored and awoken despite not being the component named in the switch for the present request-response cycle?

cheers.

We've stumbled upon an interesting thing when using WOSwitchComponent ( WO 5.4.3 ).

The situation is as follows :
1. There is a base component that contains WOSwitchComponent element and navigation menu. 2. Upon click on any of the navigation items a component action is performed in which the WOComponentName binding of the WOSwitchComponent is changed to the desired page name and null is returned.

The thing is whenever you navigate to some page awake() is called for all previously visited pages. The question is why are those components awaken and is this behaviour normal and expected?

___
Andrew Lindesay
www.lindesay.co.nz

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/rgurley%40mac.com

This email sent to rgur...@mac.com


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to