Solved Re: Direct Action is not getting called
Solved Re: Direct Action is not getting called
- Subject: Solved Re: Direct Action is not getting called
- From: Greg Hulands <email@hidden>
- Date: Fri, 28 Nov 2003 08:14:27 +1000
I am a dumbass, I forgot to put the port in the url while I have been
developing it. All is well.
Greg
On 28/11/2003, at 8:05 AM, Greg Hulands wrote:
> Hi,
> I am having trouble in getting my direct action to be called. Below is
> the class for where it is declared. In the browser I have the
> following:
>
> var img = new Image();
> img.src =
> "http://localhost//cgi-bin/WebObjects/LightBox.woa/wa/DirectAction/
> consumerSetAnnotationForImage?image=7563a13f-7a82-4249-b134
> -1dacc079470e/f21538a6-9455-4d38-92a6-
> bcf14afd9589.jpg&title=My New Title";
>
> The src is autogenerated via javascript so that it can be used for all
> the images on the page. I assign the src to the img so that it updates
> the WO app. The img is just a temp variable so that the user doesn't
> know that there was a trip to the server and makes the app look more
> responsive.
>
> I have tried adding /consumerSetAnnotationForImageAction? as well, but
> it doesn't seem to be getting called either. I have tried removing
> DirectAction in the url as well, but still no success.
>
>
> Any ideas?
>
> Greg
>
>
>
> public class DirectAction extends WODirectAction {
>
> public DirectAction(WORequest aRequest) {
> super(aRequest);
> }
>
> public WOActionResults defaultAction() {
> return pageWithName("Main");
> }
>
> public WOComponent consumerSetAnnotationForImageAction() {
> String image = context().request().stringFormValueForKey("image");
> String annotation =
> context().request().stringFormValueForKey("title");
> EOEditingContext ec = new EOEditingContext();
> EOQualifier qualifier =
> EOQualifier.qualifierWithQualifierFormat("thumbnail = %@", new
> NSArray(image));
> EOFetchSpecification fetchSpec = new
> EOFetchSpecification("ClientImage", qualifier, null);
>
> ec.lock();
> NSArray results = ec.objectsWithFetchSpecification(fetchSpec);
>
> if (results.count() > 0)
> {
> ClientImage img = (ClientImage)results.objectAtIndex(0);
> img.setAnnotation(annotation);
> ec.saveChanges();
> }
> ec.unlock();
>
> ConsumerImageAnnotation next =
> (ConsumerImageAnnotation)pageWithName("ConsumerImageAnnotation");
> next.setTitle(annotation);
> return next;
> }
> }
_______________________________________________
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.