• 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: Direct2Web ordered to-many relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Direct2Web ordered to-many relationship


  • Subject: Re: Direct2Web ordered to-many relationship
  • From: Ramsey Gurley <email@hidden>
  • Date: Thu, 05 Jul 2012 08:25:25 -0700

On your Recipe entity class add:

public void addToSteps(Step eo) {
	//Set step value…
	includeObjectIntoPropertyWithKey(eo, "steps");
}

public void removeFromSteps(Step eo) {
	//Update step values…
	excludeObjectFromPropertyWithKey(eo, "steps");
}

Ramsey

On Jul 5, 2012, at 2:14 AM, Amy Worrall wrote:

> I have a Recipe which can have any number of Steps. Each Step can only
> be attached to a single recipe. The Steps have an order, which is
> stored in a stepOrder property on the Step itself.
>
> I'd like the user to only interact with Steps in the context of a
> Recipe, so I'll make it display the steps as an inline edit
> relationship when editing a Recipe.
>
> The question is how best to deal with the ordering? Ideally I'd like
> these things to happen:
>
> * Steps are always numbered within a recipe 1, 2, 3, …
> * The user can't enter step numbers directly. Creating a new step adds
> it to the end of the list with the appropriate number.
> * Step numbers are displayed to the user, as read only.
> * By each step is an "Up" and a "Down" button. Press "Up" and it swaps
> the step in question with the one above it, changing the numbers as
> appropriate.
> * If a step is deleted, all the numbers of the remaining steps shuffle
> up to remain continuous.
>
> Is there any built in D2W-friendly way to work with an ordering like this?
>
> Thanks,
>
> Amy
>
> _______________________________________________
> 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: Direct2Web ordered to-many relationship
      • From: Ramsey Gurley <email@hidden>
References: 
 >Direct2Web ordered to-many relationship (From: Amy Worrall <email@hidden>)

  • Prev by Date: Direct2Web ordered to-many relationship
  • Next by Date: Re: Direct2Web ordered to-many relationship
  • Previous by thread: Direct2Web ordered to-many relationship
  • Next by thread: Re: Direct2Web ordered to-many relationship
  • Index(es):
    • Date
    • Thread