• 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: Changing value of a WOConditional binding inside WORepetition
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing value of a WOConditional binding inside WORepetition


  • Subject: Re: Changing value of a WOConditional binding inside WORepetition
  • From: David Holt <email@hidden>
  • Date: Tue, 30 Aug 2005 15:17:01 -0700



On 30 Aug 2005, at 2:49 PM, Chuck Hill wrote:

public void appendToResponse(WOResponse aResponse, WOContext aContext) {
if (documentToUndelete != null) {


            EOEditingContext ec = session().defaultEditingContext();

To make this safer for future changes,
EOEditingContext ec = documentToUndelete.editingContext();

Thanks, I'll do that.


            Integer i = new Integer(0);
            documentToUndelete.takeValueForKey(i,"deleted");
Why not bury this particular nastiness in the EO where it belongs:
documentToUndelete.undelete();

Okay.


DeletedLookup aDeletedLookup = (DeletedLookup)documentToUndelete.valueForKey("deletedLookup");
I'm not at all sure what this is.

I'm sure this is a remnant from my SQL days. All I am doing is providing a description for the 0,1 values in the Document class.



documentToUndelete.addObjectToBothSidesOfRelationshipWithKey(aDeletedL ookup,"deletedLookup");

Both delete and undelete use .addObjectToBothSidesOfRelationshipWithKey(aDeletedLookup,"deletedLooku p"); Should one of them be using removeObject...?

I am just toggling a flag. I included the relationship bit because I thought it was what was necessary to get the WOConditional to update. In truth it was all working equally badly by just setting the value of Document.deleted to 0 or 1.


It is now obvious that there are much better ways to go about this. What do people normally do to hold pending record deletions? (I would prefer not to use checkboxes because then I will have to provide the submit button on the bottom of the form).

_______________________________________________
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: Changing value of a WOConditional binding inside WORepetition [SOLVED]
      • From: David Holt <email@hidden>
References: 
 >Changing value of a WOConditional binding inside WORepetition (From: David Holt <email@hidden>)
 >Re: Changing value of a WOConditional binding inside WORepetition (From: Ken Anderson <email@hidden>)
 >Re: Changing value of a WOConditional binding inside WORepetition (From: David Holt <email@hidden>)
 >Re: Changing value of a WOConditional binding inside WORepetition (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Changing value of a WOConditional binding inside WORepetition
  • Next by Date: Re: Properties File Problem with WARs [SOLVED]
  • Previous by thread: Re: Changing value of a WOConditional binding inside WORepetition
  • Next by thread: Re: Changing value of a WOConditional binding inside WORepetition [SOLVED]
  • Index(es):
    • Date
    • Thread