• 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: Prevent NEW in D2W?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prevent NEW in D2W?


  • Subject: Re: Prevent NEW in D2W?
  • From: Ramsey Gurley <email@hidden>
  • Date: Mon, 29 Aug 2011 08:18:46 -0700

On Aug 29, 2011, at 6:32 AM, Markus Ruggiero wrote:

> Quick D2W question:
>
> isEntityEditable, isEntityDeletable, isEntityInspectable are all fine, but is there something like isEntityNewable?
>
> In other words: I have an entity with exactly one record that contains some global parameters to my app. The user must be able to update that one record but he must not be able to add a new record, there must be exactly one record with the same primary key at all times. How would I do this?
>
> Thanks
> ---markus---

This sounds like a model problem, not a view or controller problem.  If this is a one to one relationship, then model it that way.

If the relationship is required, you can simply model it as a mandatory one-to-one joined on PKs and propagate the primary key.  EOF will automatically create the related object for you when your eo is created.

If it is an optional one-to-one, then model it as two to-one relationships with an FK on each table.  Then in your entity class, override the inverseKeyForRelationship method to return the proper inverse relationship for each.

If you have no control over the database schema and you need to do optional one-to-one with PKs then you're out of luck.  From your description, it sounds like doing it in the app is the wrong way to do it. To do it the wrong way, you'll need to provide your page level actions using a branch delegate and something like ERDControllerButton instead of using isEntity* since there is no key like isEntityNewable.  Either that, or you can build your own d2w page template and include an isEntityNewable conditional.

Ramsey

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Prevent NEW in D2W?
      • From: Markus Ruggiero <email@hidden>
References: 
 >Prevent NEW in D2W? (From: Markus Ruggiero <email@hidden>)

  • Prev by Date: Documention Working Group meeting TODAY
  • Next by Date: Need conceptual help with weird data model
  • Previous by thread: Prevent NEW in D2W?
  • Next by thread: Re: Prevent NEW in D2W?
  • Index(es):
    • Date
    • Thread