Re: Posting vars programatically from component to Direct Action
Re: Posting vars programatically from component to Direct Action
- Subject: Re: Posting vars programatically from component to Direct Action
- From: Arturo Pérez <email@hidden>
- Date: Sat, 17 Apr 2004 09:50:00 -0400
On Apr 17, 2004, at 8:49 AM, Randall Perry wrote:
Ah, well, there are lots of different ways to do that. Your technique
is a new
one to me (clever!). You can always do the typical thing of creating
a
variable
(public or with appropriate setters/getters) and doing
WOComponent nextPage = pageWithName("theNextPage");
nextPage.takeValueForKey(val, "variableName");
Will this work when passing vars to a Direct Action? Does WO consider
DA's a
'page'.
Yeah, what I was looking for was how to append form vars to a response
so
they can be picked up by request in the receiving DA.
Ah, ok. You want do to this:
NSMutableDictionary dict = new NSMutableDictionary();
dict.setObjectForKey(user, "username");
WOComponent red = pageWithName("WORedirect");
red.takeValueForKey(context().directActionURLForActionNamed("myDA",
dict), "url");
return red;
That, obviously, redirects to your DA with the parameters passed in the
NSMutableDictionary. The interface WOActionResults may be relevant to
you in this case if you don't want a redirect.
You could go right ahead and use a WOHiddenField.
Ok. Should've checked for that. May be the most straightforward way to
do
it. My purpose is to prevent the user from seeing the info.
Well, a curious (or malign) user can still see the data in a hidden
field.
So, depending on how confidential you need that data to be this may or
may not
be appropriate.
----
WO in philadelphia - wanna cheesesteak with that?
Please visit webobjects.meetup.com.
_______________________________________________
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.