Ted,

Thanks for the help, but it isn’t working. Pretty strange, the component simply 
isn't shown and there’s no stack trace on the console.


Cheers,
Flavio

> On 24 Nov 2016, at 15:04, Theodore Petrosky <tedp...@yahoo.com> wrote:
> 
> use personsForTeamProject as a propertyKey like any other. It is an Array of 
> Person. add it to the displayPropertyKeys of the page
> 
> it is returning Person so you must have a rule that specifies 
> keyWhenRelationship
> 
> 100 : (pageConfiguration = 'EditProject' and propertyKey = 
> 'personsForTeamProject') => componentName = "ERD2WEditToOneRelationship" 
> [com.webobjects.directtoweb.Assignment]
> 
> 
>> On Nov 24, 2016, at 11:29 AM, Flavio Donadio <fla...@donadio.com.br 
>> <mailto:fla...@donadio.com.br>> wrote:
>> 
>> Thanks, Ted!
>> 
>> 
>> Your ideia seems good. My method would end up like this:
>> 
>> public NSArray<Person> personsForTeamProject() {
>>      return this.team().persons();
>> }
>> 
>> What I need to know is how to bind the returned NSArray to the dropdown. 
>> This should be D2W 101, but I can’t find it.
>> 
>> 
>> Cheers,
>> Flavio
>> 
>>> On 24 Nov 2016, at 13:46, Theodore Petrosky <tedp...@yahoo.com 
>>> <mailto:tedp...@yahoo.com>> wrote:
>>> 
>>> I have only done this with a fetch specification. I create a fetch spec on 
>>> person then the rule is simple:
>>> 
>>> 102 : (pageConfiguration like 'Query*' and propertyKey = 'client') => 
>>> restrictingFetchSpecification = "currentClients" 
>>> [com.webobjects.directtoweb.Assignment]
>>> 
>>> In this case I have a boolean currentClients. I suppose you could traverse 
>>> the foreign key ids, or use direct sql in the fetch spec.
>>> 
>>> what about creating a method on Project that returns what you want and bind 
>>> that to the dropdown?
>>> 
>>> public NSArray<Person> personsForTeamProject() {
>>> 
>>>    NSArray allPersons = Person.fetchAllPersons(editingContext());
>>> 
>>>    EOQualifier personQualifier = <create a qualifier>
>>> 
>>> return ERXQ.filtered(allPersons, personQualifier);
>>> }
>>> 
>>> 
>>> 
>>>> On Nov 24, 2016, at 10:06 AM, Flavio Donadio <fla...@donadio.com.br 
>>>> <mailto:fla...@donadio.com.br>> wrote:
>>>> 
>>>> Hello, everybody!
>>>> 
>>>> 
>>>> One more question that looks simple, but is making me bang my head on the 
>>>> wall...
>>>> 
>>>> Just consider a D2W app with these entities:
>>>> 
>>>> Team <—>> Person
>>>> Team <—>> Project
>>>> Project <—>> Task
>>>> Task <—> Person
>>>> 
>>>> I have this EditEmbeddedTask in an EditProject page. User can select 
>>>> Person on a dropdown but, the way my app is working now, it shows all 
>>>> Persons in the database. I want it to show only the Persons in 
>>>> "project.team.persons".
>>>> 
>>>> How can I achieve that?
>>>> 
>>>> 
>>>> Cheers,
>>>> Flavio
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com 
>>>> <mailto:Webobjects-dev@lists.apple.com>)
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com 
>>>> <https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com>
>>>> 
>>>> This email sent to tedp...@yahoo.com <mailto:tedp...@yahoo.com>
> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to