D2WList from hitting a link, no template, no frozen component
D2WList from hitting a link, no template, no frozen component
- Subject: D2WList from hitting a link, no template, no frozen component
- From: Justin Tocci <email@hidden>
- Date: Fri, 27 Aug 2004 09:06:38 -0500
I tried the code published with the article "The Best Kept Secret of
The Best Kept Secret" at stepwise.com and couldn't cause a D2WList to
be generated and come up with a list of data. I got it working but
don't know if I'm doing anything wrong:
Hyperlink1: WOHyperlink {
action = adminUsers;
}
--------------------------
import com.webobjects.foundation.*;
import com.webobjects.appserver.*;
import com.webobjects.directtoweb.*;
import com.webobjects.eocontrol.*;
import com.webobjects.eoaccess.*;
public class Main extends WOComponent {
-snip-
public NSArray xwebuser() {
return
EOUtilities.objectsForEntityNamed(session().defaultEditingContext(),
"Xwebuser1");
}
public EOArrayDataSource xwebuser1ArrayDataSource() {
EOClassDescription cd =
EOClassDescription.classDescriptionForEntityName("Xwebuser1");
EOArrayDataSource dataSource = new EOArrayDataSource(cd,
session().defaultEditingContext());
dataSource.setArray(xwebuser());
return dataSource;
}
public WOComponent adminUsers(){
ListPageInterface lpi =
(ListPageInterface)D2W.factory().listPageForEntityNamed("Xwebuser1",
session());
lpi.setNextPage(this);
lpi.setDataSource(xwebuser1ArrayDataSource());
return (WOComponent)lpi;
}
}
Am I all wet or is this ok? I am going to try to use a fetchspec in
xwebuser() next. D2WList is not talked about much in the docs or in the
lists so I'm guessing this stuff is totally obvious to you all.
justin tocci
fort wayne, in
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.