Re: DirectAction question
Re: DirectAction question
- Subject: Re: DirectAction question
- From: LD <email@hidden>
- Date: Mon, 11 Jul 2005 09:51:31 +1000
Hi there,
On 11/07/2005, at 3:59 AM, Guido Neitzer wrote:
I have a short question regarding direct actions:
If I build an application, that uses direct actions, should I see
the instance number in the URL?
No. The content is dynamic - but Direct Actions are (usually) session-
less. So unless you're using Session-based objects in your components
the URL should be /clean/.
Things that'll create a session object are objects such as
WOTextField where you're binding it's 'value' to a session variable
in your component (or otherwise).
I use WOHyperlink with "directActionName" bound and nothing more. I
don't see the instance number in deployment.
Also, if I create a session in one component, this session shows up
in the URLs on exactly this page, but only on WOHyperlinks that use
the standard "action" binding.
Correct.
Do I really need to make my own handling for all that?
In short, yes.
For a direct action - you'll find the return values and/or query
values in the url, for example, in
(NSDictionary) request().formValues() or
request().formValueForKey(key) or... you get the idea.
e.g.,
public WOActionResults submitFormAction() {
WOComponent nextPage = pageWithName("Main");
String checkBoxValue = (String) request().formValueForKey
("CheckBox");
if (checkBoxValue != null && checkBoxValue.equals("on")) {
nextPage.takeValueForKey(Boolean.TRUE, "isCheckBoxTicked");
}
return nextPage;
}
You might like to look at the following blog:
http://david.codebase.ca/index.php?cat=14
It's a 5-part tutorial on direct actions.
with regards,
--
LD
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden