• 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: Passing URL parameters to component via direct action
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing URL parameters to component via direct action


  • Subject: Re: Passing URL parameters to component via direct action
  • From: Peter Vandoros <email@hidden>
  • Date: Tue, 12 Aug 2008 09:33:01 +1000

John,

I don't think there is anything that comes "out of the box" to do this, however, you could create an element that cycles through the context().request().formValues() NSDictionary and adds hidden fields to your form.

Hope that helps

Regards

Peter

John Pollard wrote:
Bill,

On 11 Aug 2008, at 20:14, William Hatch wrote:

Hi John,

It sounds like you want to call a DA, then return the same page you were on when calling the DA, and have the page contain the same values it had before you called the DA. Correct?

No, I want it to accept the WOPopUpButton selections made by the person viewing the web page. I don't need it to remember anything about the state it had before. The same page yes, but not the same values it had before.


If so, you can just pass all of the values you need to the da as request parameters, outlined previously, and then make sure your component can set them with either standard getters and setters or using KVC.

I want the values to be set within a WOForm within my page. The values are passed fine to the DA. I could take them out of the request myself and work out how to set the WOPopUpButton selected values in the form. But what I'm after is a way for the WOForm to take the values from the request, the DA request without me having to do it. After all, the values are in the URL, so why should I parse them to take them out and set the WOPopUpButton states when I'm guessing WO can do it for me? Sorry I haven't read those DA articles etc. but I will do.

Thanks,
John

Any other things required to render should be able to be derived from what you're setting up in the component during the DA.


Bill



On Aug 11, 2008, at 12:29 PM, John Pollard wrote:

Lachlan,

On 11 Aug 2008, at 13:29, Lachlan Deck wrote:

On 11/08/2008, at 10:10 PM, John Pollard wrote:

I have a page containing a WOForm with some dynamically created WOPopUpButtons. The WOForm is set to submit a Direct Action request (using get as opposed to post).

The request received by the DA method contains information from a couple of hidden fields in the form which allows me to construct and configure the right page which is actually just a new instance of the same page.

Is there a really simple way to get the WOPopUpButton values from the request DA URL into the WOForm as if the WOForm had been submitted with those values as a component action?

public String getSomeSelectedValue()
{
    if ( someSelectedValue == null )
        someSelectedValue = context().request().stringFormValueForKey( "someSelectedValue" );
    return someSelectedValue;
}

Yes, that's fine, I can get a named value no problem. But here I am referring to an array of dynamically generated named values that make up a WOForm content. My feeling is that I shouldn't need to pick out the values, the WOForm should be able to take them from the request, even if the request comes via a DA.

I tried calling takeValuesFromRequest(request(), context()) from my DA method but that produced a NPE. Perhaps this method can't work from a DA request/context?

What's the stack trace?

I expect the above call makes no sense anyway, it was a long shot. However, if someone says this should work, I'll give a stack trace.



Obviously I can parse the DA request, dig out the WOPopUpButton selections and pass them to the page myself and set the popup selections, but it strikes me that there ought to be an easy way.

There's lots of ways to do things.

I'm just looking for the lazy man's way that will save me picking out values now and in the future when I need to do similar again.

I will look at David LeBer's articles and podcasts as advised by Ramsey and see if that helps.

Thanks,
John
_______________________________________________
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


--
Peter Vandoros
Software Engineer
Etech Group Pty Ltd
Level 3/21 Victoria St
Melbourne VIC 3000
Australia

Ph: +61 3 9639 9677
Fax: +61 3 9639 9577
----------------------------------
IMPORTANT: This e-mail message and any attachments are confidential and may be privileged. If received in error, please reply to this message and destroy all copies and any attachments. You should check this message and any attachments for viruses or defects. Our liability is limited to resupplying any affected message or attachments. For more information about Etech Group, please visit us at http://www.etechgroup.com.au.
 _______________________________________________
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: 
 >Passing URL parameters to component via direct action (From: John Pollard <email@hidden>)
 >Re: Passing URL parameters to component via direct action (From: Lachlan Deck <email@hidden>)
 >Re: Passing URL parameters to component via direct action (From: John Pollard <email@hidden>)
 >Re: Passing URL parameters to component via direct action (From: William Hatch <email@hidden>)
 >Re: Passing URL parameters to component via direct action (From: John Pollard <email@hidden>)

  • Prev by Date: Re: [OT] FrontBase problem when copying databases
  • Next by Date: Fwd: When importing examples I am getting following errors
  • Previous by thread: Re: Passing URL parameters to component via direct action
  • Next by thread: Re: Passing URL parameters to component via direct action
  • Index(es):
    • Date
    • Thread