• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mixing D2JC with Non-Direct Java Client
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mixing D2JC with Non-Direct Java Client


  • Subject: Re: Mixing D2JC with Non-Direct Java Client
  • From: David Avendasora <email@hidden>
  • Date: Thu, 26 Mar 2009 16:41:18 -0400


On Mar 26, 2009, at 3:57 PM, John Ours wrote:


On Mar 26, 2009, at 2:01 PM, David Avendasora wrote:

I believe so. In my D2JC app, I get a new window with the form in there. I'm assuming it's a JFrame, but then again, I've never written a single line of Swing, so I can only guess at what WebObjects is doing behind the scenes to do this.


OK, here's the story.  Your code works if I change it like this (take listWithEntity for example):

public static void listWithEntityName(String entityName,
EOFetchSpecification fs) {
EOControllerFactory f = EOControllerFactory.sharedControllerFactory();
EOController controller = f.controllerWithSpecification(
new NSDictionary(new Object[] { entityName,
EOControllerFactory.ListTask,
EOControllerFactory.TopLevelWindowQuestion },
new Object[] { EOControllerFactory.EntitySpecification,
EOControllerFactory.TaskSpecification,
EOControllerFactory.QuestionSpecification }),
true);
if (controller != null) {
EOListController listController = (EOListController) f
.controllerWithEntityName(controller,
EOControllerFactory.List.class, entityName);
listController.listObjectsWithFetchSpecification(fs);
listController.setEditability(EOEditable.NeverEditable);
listController.showInSupercontroller();
listController.component().getParent().getParent().setSize(700, 700);
listController.makeVisible();
}
}

The first line seems reasonable enough, but the following line is clearly a hack.  When I look at the object tree I see listController has a _component of type EOView, which has a parent of type EOView, which has a parent of type EOTabSwitchController, which has no parent.  All of them have heights and widths set to negative values (?!)   The hack above confirms that's the problem, but my knowledge of D2JC is limited entirely to what David's posted and I wouldn't know where else to look.

Does anyone what part of WO is responsible for managing EOComponentControllers and setting their sizes/layouts/etc?  

Hmm. There are rules for setting the minimum width and height for the Form task, but not for the List task. I set them with the EOAssistant for the Form, below are the rules that it generated.

Here's a link to where I got the concept for the code I originally wrote: http://developer.apple.com/documentation/WebObjects/DesktopApplications/T10CustomListControllers/T10CustomListControllers.html#//apple_ref/doc/uid/TP30001017-CH319-TP1
I just made changes to get the form task to work.

That section of the Java Client documentation contains a lot of information about controllers, maybe it's a start? (ignore the NIB stuff, that's all deprecated)

Dave



{
"class" = "com.webobjects.directtoweb.Rule";
"author" = "100";
"rhs" = {
"class" = "com.webobjects.directtoweb.Assignment";
"value" = "400";
"keyPath" = "minimumHeight";
};
"lhs" = {
"class" = "com.webobjects.eocontrol.EOAndQualifier";
"qualifiers" = (
{
"class" = "com.webobjects.eocontrol.EOKeyValueQualifier";
"value" = "windowController";
"selectorName" = "isEqualTo";
"key" = "controllerType";
},
{
"class" = "com.webobjects.eocontrol.EOKeyValueQualifier";
"value" = "MyEntity";
"selectorName" = "isEqualTo";
"key" = "entity.name";
},
{
"class" = "com.webobjects.eocontrol.EOKeyValueQualifier";
"value" = "form";
"selectorName" = "isEqualTo";
"key" = "task";
},
{
"class" = "com.webobjects.eocontrol.EOKeyValueQualifier";
"value" = "window";
"selectorName" = "isEqualTo";
"key" = "question";
}
);
};
},
{
"class" = "com.webobjects.directtoweb.Rule";
"author" = "100";
"rhs" = {
"class" = "com.webobjects.directtoweb.Assignment";
"value" = "400";
"keyPath" = "minimumWidth";
};
"lhs" = {
"class" = "com.webobjects.eocontrol.EOAndQualifier";
"qualifiers" = (
{
"class" = "com.webobjects.eocontrol.EOKeyValueQualifier";
"value" = "windowController";
"selectorName" = "isEqualTo";
"key" = "controllerType";
},
{
"class" = "com.webobjects.eocontrol.EOKeyValueQualifier";
"value" = "MyEntity";
"selectorName" = "isEqualTo";
"key" = "entity.name";
},
{
"class" = "com.webobjects.eocontrol.EOKeyValueQualifier";
"value" = "form";
"selectorName" = "isEqualTo";
"key" = "task";
},
{
"class" = "com.webobjects.eocontrol.EOKeyValueQualifier";
"value" = "window";
"selectorName" = "isEqualTo";
"key" = "question";
}
);
};
}

 _______________________________________________
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

References: 
 >Mixing D2JC with Non-Direct Java Client (From: David Avendasora <email@hidden>)
 >Re: Mixing D2JC with Non-Direct Java Client (From: John Ours <email@hidden>)
 >Re: Mixing D2JC with Non-Direct Java Client (From: David Avendasora <email@hidden>)
 >Re: Mixing D2JC with Non-Direct Java Client (From: John Ours <email@hidden>)

  • Prev by Date: Re: WO is dead!
  • Next by Date: Re: newEO.localInstanceIn(localEditingContext)
  • Previous by thread: Re: Mixing D2JC with Non-Direct Java Client
  • Next by thread: Re: WONoVA Web/Pod/Broadcast
  • Index(es):
    • Date
    • Thread