• 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
Very interesting case
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Very interesting case


  • Subject: Very interesting case
  • From: Don Lindsay <email@hidden>
  • Date: Mon, 21 Sep 2009 16:17:43 -0400

Hello;

I have a component that I am updating a table of answers based on selections made by the user from a worepitition.

The code being executed is:

try {
String sEoQualifierText  = "page=";
sEoQualifierText += Integer.toString((Integer)thePage().valueForKey("identifier"));
sEoQualifierText += " and question=";
sEoQualifierText += Integer.toString((Integer)theQuestion().valueForKey("identifier"));
sEoQualifierText += " and user=";
sEoQualifierText += Integer.toString((Integer)((EOEnterpriseObject)theUser).valueForKey("identifier"));
EOQualifier oQual = EOQualifier.qualifierWithQualifierFormat(sEoQualifierText,null);
EOFetchSpecification oFetch = new EOFetchSpecification("UserAnswers",oQual,null);
NSArray aAnswer = oEO().objectsWithFetchSpecification(oFetch);
oEO().lock();
((UserAnswers)aAnswer.objectAtIndex(0)).setTheAnswer((QuestionLookup)theAnswer());
//((EOEnterpriseObject)aAnswer.objectAtIndex(0)).willChange();
oEO().unlock();
//System.out.println("updates to be saved: " + oEO().updatedObjects());
oEO().saveChanges();
} catch (Exception e) {
e.printStackTrace();
System.out.println(e.getMessage());
System.out.println("hissssss, didn't work");
}
if (theAnswer!=null) {
System.out.println("append to response firing "+(String)theAnswer.valueForKey("desc"));
} else {
System.out.println("append to response firing but the answer is null");
}

ThePage is an item from a listing of available pages repetition.
TheQuestion is an item from listing of questions repitition.
TheUser is the user who is currently working with the page.

The entity has 4 attributes (user, page, question, answer).

When I turn on EO Debugging I see that an update is made, but when I check the database the answer is always null.  I do not get any errors in the logs.  If I had an error I could start working it out.

Anyone have any ideas?

Thanks

Don


 _______________________________________________
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: Very interesting case
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: AjaxAutoComplete - is it possible to have the equivalent of a noDisplayString?
  • Next by Date: DirectAction with cookies and session
  • Previous by thread: Re: Default form value encoding was changed after parsing multi-part form. Form values will be lost.
  • Next by thread: Re: Very interesting case
  • Index(es):
    • Date
    • Thread