D2W and rule controlled visibleEntityNames
D2W and rule controlled visibleEntityNames
- Subject: D2W and rule controlled visibleEntityNames
- From: Markus Ruggiero <email@hidden>
- Date: Tue, 08 Nov 2011 11:22:56 +0100
I am trying to control the list of visible entities through a rule file. That works as expected. However the same app is deployed in several regions. Each region has its own requirements for the visibleEntityNames. So I create a key "region" in the D2WContext and use this in various places throughout the app to show/hide (non-)relevant fields. I inject the region-key into the D2WContext in the pageWrapper awake() (probably overkill)
public void awake() { super.awake(); D2WContext ctx = d2wContext(); if (ctx != null) { Application application = (Application)Application.application(); String region = "UNKNOWN"; if (application.isEurope()) { region = "europe"; } else if (application.isPefa()) { region = "pefa"; } else if (application.isNorthAmerica()) { region = "na"; } ctx.takeValueForKey( region, "region" ); } }
It works everywhere except for visibleEntityNames. Obviously this list is built before the first pageWrapper is instantiated. At that moment region is not yet set. The resulting list of entities is never rebuilt later, so my rule
region="europe" => visibleEntityNames=....
never fires. How can I solve this? When is the list of entity names built? Where would I have to inject the region key into the D2WContext for the proper rule to fire?
Thanks ---markus---
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden