• 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: Filtering options in a dropdown (toOne relationship)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filtering options in a dropdown (toOne relationship)


  • Subject: Re: Filtering options in a dropdown (toOne relationship)
  • From: Theodore Petrosky <email@hidden>
  • Date: Thu, 24 Nov 2016 10:46:50 -0500

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 <email@hidden> 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      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden


 _______________________________________________
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


  • Follow-Ups:
    • Re: Filtering options in a dropdown (toOne relationship)
      • From: Flavio Donadio <email@hidden>
References: 
 >Filtering options in a dropdown (toOne relationship) (From: Flavio Donadio <email@hidden>)

  • Prev by Date: Filtering options in a dropdown (toOne relationship)
  • Next by Date: Re: Filtering options in a dropdown (toOne relationship)
  • Previous by thread: Filtering options in a dropdown (toOne relationship)
  • Next by thread: Re: Filtering options in a dropdown (toOne relationship)
  • Index(es):
    • Date
    • Thread