You have it right as far as you got but I think you have to
initialize the D2WContext like this:
D2WContext context = new D2WContext( session() );
See this post for more detail:
http://www.wodeveloper.com/omniLists/webobjects-dev/2002/November/
msg00366.html
David
On 21-Apr-08, at 11:26 AM, Cuauhtemoc Hohman wrote:
Hi all,
I've made some D2W templates and components.
On some of them, I want to access the rule system through the
d2wcontext (asking for some color preferences and other values I
have added in rules to the .d2wmodel file).
When I have an action method in the page, I can use the d2wContext
().valueForKey("color") to ask the rule system to look for the
value of the "color" key. Until here, that works fine.
However, when I do the same while rendering the page (or in the
constructor), I can't access the current d2wcontext using the
d2wcontext() method as it returns null.
This makes me think, the d2wcontext isn't initialized yet at this
point, but then, how am I supposed to get a reference to it?
Or else, does someone know how can I ask the Rule System for a
value in the rendering process? (using the appropriate task,
entity, etc. values).
I hope someone can help me.
Thanks in advanced.
--
Cuauhtemoc Hohman
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/programmingosx
%40mac.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]