• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Return current page with direct actions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Return current page with direct actions


  • Subject: Re: Return current page with direct actions
  • From: Riccardo De Menna <email@hidden>
  • Date: Sat, 08 Oct 2016 10:21:16 +0200

> On 08 Oct 2016, at 00:58, Ramsey Gurley <email@hidden> wrote:
>
> On the previous page that triggers the direct action, add the context id.
>
> <wo:loop list=$languages item=$language>
> 	<wo:link directActionName=“language" string=$language ?lang=$language ?ctxKey=$context.contextID/>
> </wo:loop>
>
> Then in the direct action
>
> String cid = context().request().stringFormValueForKey(“ctxKey”);
> if(cid != null) return session().restorePageForContextID(cid);

Yesss Ramsey,
Works perfectly.

Google is now happy to see direct actions with language parameters everywhere instead of a component jump into the void.

Thank you so much,
Riccardo

>
>
>
> On Oct 7, 2016, at 3:38 PM, Riccardo De Menna <email@hidden> wrote:
>
>>
>>> On 08 Oct 2016, at 00:11, Paul Hoadley <email@hidden> wrote:
>>> On 8 Oct 2016, at 8:10 AM, Riccardo De Menna <email@hidden> wrote:
>>>> With component actions I simply return null but how do I return the current page with direct actions?
>>> You should have access to context().page(). Does that achieve what you want?
>>
>> I get a null page with that…
>>
>>
>> My direct action scenario is like the following...
>>
>> public WOActionResults performActionNamed(String anActionName) {
>>   languageSetup();
>>   return super.performActionNamed(anActionName);
>> }
>>
>> public void languageSetup() {
>>   Session s = session();
>>   if ( s != null ) {
>>       s.takeLanguageFromRequest(request()); // Method that looks for language parameters in different ways (URL, Cookies, Browser, Geolocalization ecc)
>>   }
>> }
>>
>> public WOActionResults languageAction() {
>>   return context().page();
>> }
>>
>> Is there anything wrong in this setup?
>>
>> regards,
>> Riccardo
>>
>>
>> _______________________________________________
>> 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
>


 _______________________________________________
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


References: 
 >Return current page with direct actions (From: Riccardo De Menna <email@hidden>)
 >Re: Return current page with direct actions (From: Paul Hoadley <email@hidden>)
 >Re: Return current page with direct actions (From: Riccardo De Menna <email@hidden>)
 >Re: Return current page with direct actions (From: Ramsey Gurley <email@hidden>)

  • Prev by Date: Re: Return current page with direct actions
  • Next by Date: Does NSUndoManager work?
  • Previous by thread: Re: Return current page with direct actions
  • Next by thread: Does NSUndoManager work?
  • Index(es):
    • Date
    • Thread