Re: Ponder: ERCoreBL User Sessions Stage Manager Actors ?
Ramsey Gurley <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.wonder-disc |
|---|---|
| Message-ID | <[email protected]> |
I think I spotted the problem. Standalone edit relationship pages in ERD2W use non-validating nested ecs. So saving changes won't throw validation exceptions. I wasn't doing that. But I think inline edit relationship pages do need to be in the original validating editing context, otherwise, saving will have no effect on the child ec. So I added some code to do that. Let me know if it is still broken. Ramsey On Dec 22, 2012, at 9:49 AM, Ramsey Gurley wrote: > Oh, I see. It's actually throwing the validation exception instead of handling it :-/ That's new. I'll look into it when I have time. I'll look into your idea of doing things too. It probably shouldn't display a validation error till they try to save. I'll see if that can work... > > > On Dec 21, 2012, at 8:16 PM, Ramsey Gurley wrote: > >> >> On Dec 21, 2012, at 7:54 PM, James Cicenia wrote: >> >>> Yes I looked through... something is messed up. None of the above worked as expected >>> The only way I get it to work is to set it directly: >>> >>> ERXSession.session().objectStore().takeValueForKey(user,"user"); >> >> That's bonkers. That should be functionally identical to the other method. Not sure what's going wrong there. >> >>> There is also a "flow bug." >>> If you have a required field in a new object, go off and maybe add some related records, cancel, cancel... bam. >>> Validation error... I think it tries to save and then sees that "title" wasn't entered and is required. >> >> Sounds odd. There shouldn't be any attempt to save changes in cancel, so I don't know how it would throw a validation error. >> >> If you mean that returning to the page after you left to edit a relationship shows a validation error, then that's not entirely unexpected. When you click any button on the original edit page to go edit a relationship, it submits the form, nulls and all. That's gonna leave a validation error in the edit page that you see when you return. >> >> I suppose the edit relationship action could clear validation errors before proceeding to the edit relationship page… but then, that would clear errors related to non-null fields too. You could enter "bacon" into a quantity field or something and it would be sitting there happily until you try to save. I guess I just expect to see errors sooner than later :-) >> >>> >>> >>> >>> On Dec 21, 2012, at 8:49 PM, Ramsey Gurley <[email protected]> wrote: >>> >>>> >>>> On Dec 21, 2012, at 6:59 PM, James Cicenia wrote: >>>> >>>>> Time to dive into understanding your threadstorage bits... >>>>> >>>>> I display a list of users as admin. >>>>> I want to run my app as the user. >>>>> To do this I wanted to swap out the session user with the user they picked. >>>>> >>>>> I thought something like this: >>>>> >>>>> ERCoreBL.setActor(eo); >>>>> >>>>> But that doesn't seem to change my session user in: >>>>> >>>>> user = (User) ERStageManager.USER.valueInObject(ERXSession.session().objectStore()); >>>>> >>>>> or >>>>> >>>>> ERStageManager.INSTANCE.setActor(eo); >>>> >>>> That should work. If you look at the code for that method, all it does is: >>>> >>>> ERCoreBL.setActor(actor); >>>> ERXWOContext.currentContext().session(); >>>> USER.takeValueInObject(actor, ERXSession.session().objectStore()); >>>> >>>> So if you call that and then turn around and say >>>> >>>> user = (User)ERStageManager.USER.valueInObject(ERXSession.session().objectStore()); >>>> >>>> and get the wrong answer, then something is pretty messed up. >>>> >>>>> >>>>> That doesn't seem to work either. >>>>> >>>>> Basically how do I swap user in the session. >>>>> >>>>> Thanks >>>>> James >>>> >>>> >>> >>> ------------------------------------------------------------------------------ >>> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial >>> Remotely access PCs and mobile devices and provide instant support >>> Improve your efficiency, and focus on delivering more value-add services >>> Discover what IT Professionals Know. Rescue delivers >>> http://p.sf.net/sfu/logmein_12329d2d_______________________________________________ >>> Wonder-disc mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/wonder-disc >> > ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ Wonder-disc mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wonder-disc