• 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: D2W Help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: D2W Help


  • Subject: Re: D2W Help
  • From: Ramsey Gurley <email@hidden>
  • Date: Wed, 27 Aug 2008 23:43:36 -0400


On Aug 27, 2008, at 2:46 PM, Ted Archibald wrote:

Let's say I have a simple D2W app (using wonder) with two entities, Person and Addresses which are related with a one to many relationship.

In the edit page for the person entity is there a way to add a "Create new Address" action to create a new address entity? I've gone through all the components and all I can do is choose an address that is already created, which doesn't make sense for the workflow. Do I need to create a component with this action? If so, how do you do that?


I'm assuming you're using the default Wonder Neutral look. You should be able to do this with an EditRelationshipPage. You'll need to create a rule like:

(task = 'edit' and smartRelationship.isToMany = 1) => componentName = "ERD2WEditToManyFault"

Once you do that, you'll see you know longer get the () beside Addresses when you're creating a person. Instead, you should see a WOBrowser with a little edit icon beside it. In my example here, I'm using Manufacturer <->> Products, but the premise is the same...

PNG image




When you create a person, click the little edit icon by the Address relationship, and it takes you to a EditRelationship page. You can then click the "New" button which will allow you to create a new Address.


PNG image




This will not be visible if your address entity is readonly. If you do not see the button, you may want to add a rule like:


*true* => isEntityEditable = "true"

That of course makes all your entites editable all the time, so you probably won't leave it that way, but it is false globally by default. For your testing, turn it on. Anyway, moving right along... After you've clicked "New" and entered your address info, you should be able to "Save" the address.

PNG image




Even though your person relationship is probably mandatory, don't worry about creating the Person relationship just yet.... You should now see a new Address in the WOBrowser. Now click the Return button in the EditRelationship page which will take you back to your EditPerson page.


PNG image




At this point, the EditPerson page will be complaining about any missing required info if you have any... like a name, so go ahead and enter your remaining info, click "Save" and you're done :-) Just don't forget to select your newly created address before clicking save!


PNG image




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: D2W Help
      • From: "Ted Archibald" <email@hidden>
References: 
 >D2W Help (From: "Ted Archibald" <email@hidden>)

  • Prev by Date: Re: NSRecursiveLock.lock() causing deadlock??
  • Next by Date: Re: How I Got WebAssitant Working on Leopard
  • Previous by thread: Re: D2W Help
  • Next by thread: Re: D2W Help
  • Index(es):
    • Date
    • Thread