Re: Direct Actions and Sessions
Re: Direct Actions and Sessions
- Subject: Re: Direct Actions and Sessions
- From: Jim Pearson <email@hidden>
- Date: Thu, 27 Nov 2003 10:14:04 -0500
Greg,
A couple of things that may help:
The direct action thing is noted in a wonderful tutorial page in the
online Apple documentation on the web. This doc set outlines which
page(s) get direct actions, and how they work given the URL given by the
user. Go here to see it:
http://developer.apple.com/documentation/WebObjects/Reference/API5.2/com/webobjects/appserver/WODirectAction.html
A WODirectAction subclass (such as the one defined by default in a new
WO project) has access to the session via inheritance with the session()
method.
Getting the arguments from the URL is part of the response header, they
can be retrieved via value/key logic - you could, for example use
headerForKey to look through header data...
HTH
jimp
------------------
Jim Pearson
Greg Hulands wrote:
Hi,
I am trying to create a direct action that will update an Enterprise
Object and save the changes to the database. What essentially happens
is that the user clicks a button to change the title of an image. A
javascript prompt asks for the name and dynamically changes the title
on the page. What then needs to occur is to send back the new title of
the image to the WO app to update the database.
I have struggled to find much documentation on how direct actions work
and how I can use them with sessions, as all it basically says is that
direct actions are for sessionless applications.
The way I will update the WO app would be something like
/MyApp.woa/wa/setTitleForImage?image=uniqueImageNumber&title=newtitle.
Questions:
1. How do I get the session with a direct action as I need to get the
default editing context to update the database.
2. How do I parse passed in parameters to the direct action, eg image
and title in the above example.
Any pointers to documentation on how to use direct actions properly
would be appreciated.
Regards,
Greg
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.