The strategy used in ERD2W and the ERXNavigation stuff is to include the 
context id in direct action requests.  The context id and the session allow you 
to restore the previous page for a direct action request.  From 
ERD2WDirectAction:

    public WOComponent previousPageFromRequest() {
        String cid = context().request().stringFormValueForKey(contextIDKey);
        if(cid == null) return context().page();
        WOComponent comp = session().restorePageForContextID(cid);
        // (ak) we need to put the component to sleep again
        // Michael Bushkov: WO5.4.3 tracks all awakened components so no need 
to call this manually
        if(comp != null && !ERXApplication.isWO54()) {
            comp._sleepInContext(comp.context());
        }
        return comp;
    }

So that would be something like

<wo:link directActionName="yourDirectActionName" 
?__cid=session.context.contextID>

if you want to do the same.

Ramsey

On Mar 30, 2012, at 1:41 AM, Pascal Robert wrote:

> I'm pretty sure you can get the name of the last action in context().request()
> 
>> calling a direct action:
>> 
>> <wo:link directActionName="yourDirectActionName">fire direct action</wo:link>
>> 
>> Why would you want to know the name of the last used direct action? You 
>> would have to pass the name via URL or cookie as direct actions normally are 
>> stateless. If you are using them with a session then you could stash the 
>> name into it.
>> 
>> 
>> Am 30.03.2012 um 09:48 schrieb Ron X:
>> 
>>> hi,
>>> can i call direct action in the component by the name and how can i get the 
>>> name of last direct action used?
>>> thanx.
>> 
>> 
>> 
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/probert%40macti.ca
>> 
>> This email sent to [email protected]
> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/rgurley%40smarthealth.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to