Action

1 view
Skip to first unread message

Ron X

unread,
Mar 30, 2012, 3:48:35 AM3/30/12
to WebObjects Development
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.

Johann Werner

unread,
Mar 30, 2012, 4:08:32 AM3/30/12
to Ron X, WebObjects Development
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.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobje...@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/webobjects-dev-garchive-31333%40googlegroups.com

This email sent to webobjects-dev...@googlegroups.com

Pascal Robert

unread,
Mar 30, 2012, 4:41:23 AM3/30/12
to Johann Werner, WebObjects Development
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 (Webobje...@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:

> https://lists.apple.com/mailman/options/webobjects-dev/probert%40macti.ca
>
> This email sent to pro...@macti.ca

Ramsey Gurley

unread,
Mar 30, 2012, 12:41:28 PM3/30/12
to Ron X, WebObjects Development
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

Reply all
Reply to author
Forward
0 new messages