Re: Help: D2W attributes' defaults when via relationships
Re: Help: D2W attributes' defaults when via relationships
- Subject: Re: Help: D2W attributes' defaults when via relationships
- From: Ramsey Lee Gurley <email@hidden>
- Date: Sat, 19 Sep 2009 12:49:53 -0400
On Sep 19, 2009, at 10:45 AM, Mr. G Brown wrote:
Hi,
ER/D2W will pick an attribute for a related entity. Often, I find,
it picks an attribute I don't want. : < (
Is there any good general way to choose which attribute gets thrown
up in edit/inspect tasks?
100: entity.name = 'MyEntity' => displayPropertyKeys =
("attribute1","attribute2",
"relationship1","relationship2.attribute3") [Assignment]
For example, let's say we have a person table, related to many
events, which in turn are related to many event-details. This is a
fairly common pattern.
person< >> events< >> details
Q1. If, every time D2W must pick a related attribute from the person
table, how can I make sure it is the one I want to use?
You mean to specify the Person relationship in the EditEvent page so
that it is preset when you come into the page? Use a NextPageDelegate.
i.e., override the default? What is the best general way?
Branch delegates are pretty awesome...
http://wiki.objectstyle.org/confluence/display/WO/D2W+Flow+Control
Q2. If I am editing an event-detail, how can I use for a query a
numeric attribute from the person table in a keypath?
I'm not sure I follow your question here... Are you talking about
querying in an editRelationship page? If you need to query a related
keyPath then it's
100: (entity.name = 'Detail' and task = 'query') =>
displayPropertyKeys = ('event.person.personNumber',
'otherDetailAttribute') [Assignment]
D2W seems to only accept strings. I could be doing it wrong, but if
I use something like "person.personNumber" in the key
keyWhenRelationship,
keyWhenRelationship is used to decide what key on an entity is used to
display that entity in a meaningful way in the interface. It usually
resolves to userPresentableDescription. You can change it with a rule
like
100: (propertyType = 'r' and relationship.destinationEntity.name =
'Person') => keyWhenRelationship = "personNumber" [Assignment]
D2W gives me an error:
java.lang.NumberFormatException: For input string: "1%"
You're editing a number without a number formatter to transform your
string into a number. It sounds like you're getting an edit string
component when you want an edit number component.
Also, when I turn on 'rule tracing': Just where do I seen the rules
being traced?
Thanks,
gb
In the eclipse console... It sounds like you are using wonder, so for
you, the best way to turn these on is to have
log4j.logger.er.directtoweb.rules.ERD2WTraceRuleFiringEnabled=DEBUG
in your app's properties file. Then, when you launch your app, click
on the Log4J link and you can enable rule tracing for the specific key
you are interested in. Ravi put up a movie on the wiki that shows the
Log4J page. Look for the "RHS Rule" field on the far right of the
page with the pink stripes.
http://wiki.objectstyle.org/confluence/display/WO/How+to+debug+a+D2W+application
So, for example, if you want to know what rules are causing you to
evaluate to a edit string component instead of an edit number
component, just enter 'componentName' into the 'RHS Rule' field and
the Log4J page will automatically create the three correct Loggers
needed to do Wonder's rule tracing on that rule system key. Make sure
to set all three of them to 'DEBUG' and click the update button before
returning to the app. It's very slick. It beats the old style of
using -D2WTraceRuleFiringEnabled, which just blatts out everything
that was evaluated.
Just remember, you have to add
log4j.logger.er.directtoweb.rules.ERD2WTraceRuleFiringEnabled=DEBUG
for this to work. You can even do that in the Log4J page too if you
forget to add it to your properties file :-)
Ramsey
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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