Re: Ponder: ERCoreBL User Sessions Stage Manager Actors ?

Ramsey Gurley <[email protected]>
Newsgroups gmane.comp.web.webobjects.wonder-disc
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.