directtoweb and readOnlyEntityNames rule
directtoweb and readOnlyEntityNames rule
- Subject: directtoweb and readOnlyEntityNames rule
- From: Steve Quirk <email@hidden>
- Date: Tue, 29 Aug 2006 18:41:01 -0400 (EDT)
I'm trying to remove the edit/delete buttons from the UI of a D2W app by
using the "readOnlyEntityNames" rule. I'd like to make the result of this
to be conditional on a Session method "noEdits()".
I put this rule in my d2w.d2wmodel (using RuleEditor):
{
author = 50;
class = "com.webobjects.directtoweb.Rule";
lhs = {
class = com.webobjects.eocontrol.EOKeyComparisonQualifier;
leftKey = "session.noEdits";
rightKey = 1;
selectorName = "isEqualTo";
};
rhs = {
class = "com.webobjects.directtoweb.Assignment";
keyPath = readOnlyEntityNames;
value = (User, Group);
};
}
This is the *only* rule in this file. FYI, the only rule in user.d2wmodel
is
{
class = com.webobjects.directtoweb.Rule;
author = 100;
rhs = {
class = com.webobjects.directtoweb.Assignment;
keyPath = look;
value = "BasicLook";
};
}
D2W.factory().newSignificantKey("session.noEdits") has been added to
Application.java
The edit/delete buttons always show however. When tracing the rule
firing, I only see the default readOnlyEntityNames rule:
****** fire : *true* => readOnly=isEntityReadOnly (-1)
****** fire : *true* => readOnlyEntityNames=() (com.webobjects.foundation.NSMutableArray) (-1)
If I rummage through the D2WModel _rules array at runtime, I can find my
rule. If I manually call the fire() method on my rule, I get the expected
("User", "Group") array.
Anyone have any ideas on what I'm doing wrong? Suggestions on how to do
this easily? (Editing the rules is pretty much out of the question, this
is a boiled down version of an existing app whose rule file is 18000+
lines - but "no code", jeez!!).
Steve
_______________________________________________
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