Re: Follow up on Rule Modeler and Repetitions
Re: Follow up on Rule Modeler and Repetitions
- Subject: Re: Follow up on Rule Modeler and Repetitions
- From: Ramsey Lee Gurley <email@hidden>
- Date: Fri, 14 Aug 2009 08:32:07 -0400
Hi Dan,
You can use the D2WCustomComponent anywhere in your inspect page where
you can use a property level component really. Take your rule for
instance,
(task = "inspect" and entity.name = "MyEntity" and propertyType = "r"
and smartRelationship.isToMany = '1') => componentName =
D2WCustomComponent
Now, you can look in the WO for D2WCustomComponent located at
/System/Library/Frameworks/JavaDirectToWeb.framework/Resources/
D2WCustomComponent.wo/
and see that is is a very simple component wrapper. It uses the
customComponentName binding to attach whatever component you would
like. Additionally, it will hand your component two other bindings:
object and key. So, to use it, you need another component...
something similar to what I included in the last email perhaps... and
a rule to reference that component. So let's say that component is
MyDisplayBrowser.wo, you'd need a second rule like
(task = "inspect" and entity.name = "MyEntity" and propertyType = "r"
and smartRelationship.isToMany = '1') => customComponentName =
MyDisplayBrowser
So, when the page gets to MyEntity's relationship properties, it will
insert a D2WCustomComponent using the first rule, and the
D2WCustomComponent will insert MyDisplayBrowser using the second
rule. Of course, since you are building a component already, you
could simply descend from ERD2WComponent and skip the middleman.
The tutorial sounds like a good idea and it looks nice so far. New
material that guides people down the D2W path will certainly be a
welcome addition.
Ramsey
On Aug 14, 2009, at 12:05 AM, DANIEL BEATTY wrote:
Greetings Ramsey,
Well I was there for David's talk at WOWODC west. There were a few
things that I did not catch. This had to do with how he was
displaying the results of to-many relationships, and pop ups of to-
one relationships.
I was using WOBrowser as just an example of a repetition based
component. Now I have to admit I still have a bit of confusion here
about D2WCustomComponent.
First, is it possible to insert such a custom component into an
existing edit or inspect task by rule, and if so what rule sequence
allows this? Can it be applied to a to-many relation so that a
table like structure appears instead of a "Cheap copy" of a mutable
array tag?
To help me answer these questions, I am building a little toy
example to ensure that I gain understanding of the possible uses of
these custom components. This toy example is described at http://venus.cs.ttu.edu/groups/webobjects/wiki/761ea/Direct_To_Web_Tutorial.html
. It is a work in progress. Furthermore, would anyone like to
help coach and guide me in finishing this example? I would like to
make it available for community benefit when finished.
Thank you,
Dan
On Aug 13, 2009, at 6:24 PM, Ramsey Lee Gurley wrote:
I don't think you're going to find a plethora of components to -
display- a list using a WOBrowser. Being a form control, it
implies submitting a value. Using it outside of a form is
completely non standard and counter intuitive to end users. The
only standard components that use it which I'm aware of are query
and edit components. Perhaps you might like a table or scrollable
ul? [Sorry, I live to validate ;-)]
That said, if you have to use a WOBrowser, I would suggest watching
David LeBer's podcast from WOWODC 09 demonstrating the use of the
D2WCustomComponent. You can use that to insert a component that
has a WOBrowser in the HTML, 'object' and 'key' bindings, and a
method to fetch your to-many list using kvc addtions... Something
like
----HTML
<webobject name="Browser"/>
---WOD
Browser: WOBrowser {
list = list;
item = item;
displayString = item.userPresentableDescription;
}
----Java
public Object object;
public String key;
public Object item;
public NSArray list() {
return
(NSArray)NSKeyValueCodingAddtions.Utility.valueForKeyPath(object,
key);
}
Ramsey
On Aug 13, 2009, at 12:46 AM, Daniel Beatty wrote:
Greetings all,
This may be a David (LeBer or Holt question). How does one
active the WO Browser effect in the inspect task for to-many
relations? My first guess would be the Rule Modeler, but I get
stuck after establishing a LHS of
(task = "inspect" and entity.name = "MyEntity" and propertyType =
"r")
I am pretty sure there was a fourth option about
(smartRelationship.isToMany = 1) , but I still get stuck as to
what to put on the RHS.
I tried componentName = WOBrowser but this fails since it is
needing the keys for list and item assigned, and I am not sure
where to stick that. The other thought was to use pageName to
identify a custom inspection component. At which, point I get
stuck on the nextPageDelegate method.
Would some folks from the audience shed some light and help lead
to a better understanding of this great D2W mystery?
Thank you,
Dan Beatty, M.S. CS (B.S. EECS)
Ph.D. Student
Texas Tech University
email@hidden
http://venus.cs.ttu.edu/~dabeatty
http://web.me.com/danielbeatty/My_Home_Page/Welcome.html
_______________________________________________
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
Dan Beatty, M.S. CS (B.S. EECS)
Ph.D. Student
Texas Tech University
email@hidden
http://venus.cs.ttu.edu/~dabeatty
http://web.me.com/danielbeatty/My_Home_Page/Welcome.html
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