• 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: "Manual" form submission with Ajax.framework
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Manual" form submission with Ajax.framework


  • Subject: Re: "Manual" form submission with Ajax.framework
  • From: Aaron Rosenzweig <email@hidden>
  • Date: Mon, 21 Apr 2014 09:14:08 -0400

Hi Paul (and Jonathan),

Let’s *assume* that the bootstrap code is a good citizen and fires an “on-change” event for the real, though hidden, select element.

Now, Let’s simplify your ajax to test that assumption out because there are many ways to set things up let’s do the simplest.

1.) Get rid of your AjaxObserveField, you don’t need it.

2.) Give your real select a true CSS ID.

3.) Add a binding to your AjaxUpdateContainer: “observeFieldID” and then give it the CSS ID of the element you want to observe (the real select that is hidden).

Try it out and report back.
Aaron Rosenzweig / Chat 'n Bike
e:  email@hidden  t:  (301) 956-2319
Chat 'n Bike Chat 'n Bike

On Apr 21, 2014, at 2:16 AM, Jonathan Miller <email@hidden> wrote:

Hi Paul,

I think it should work.  Are you sure something else is going on?

I have a JQuery version of Ajax Framework and I use that script too.  I tried using an observer with it and it worked.  Not exactly same as Ajax Framework but the observer is observing the original popup button.

You can see sample here: http://www.kahalawai.com/cgi-bin/WebObjects/JQueryExample.woa/1/wa/PageAction/SelectPickerPage

Johnny




On Sun, Apr 20, 2014 at 7:12 PM, Paul Hoadley <email@hidden> wrote:
Hello,

I'm working with a front-end designer who really wants to use the "bootstrap-select" customisation for drop-downs:

http://silviomoreto.github.io/bootstrap-select/

What happens here, roughly, is that bootstrap-select hides the regular select element on the rendered page, substitutes its own more easily styled markup, but updates the select element in the background (based on user interaction with its inserted structure) so that form submission still works.

There's a part of the application that uses a pair of "dependent drop-downs": the user makes a selection from the first, and the content of the second is updated based on the choice.  This is currently implemented using an AjaxObserveField on the first drop-down and an AjaxUpdateContainer around the second, and everything is fine.

Enter bootstrap-select.  The user doesn't interact directly with the first select element, so the AjaxObserveField never sees anything happen.  (I take it that whatever bootstrap-select is doing in the background to keep the select element consistent is not triggering whatever the AjaxObserveField is waiting for.)  We can trigger the AjaxUpdateContainer update manually on the second drop-down (by calling <containerID>Update()), but, of course, there's no form submission happening, so the selection made via the first drop-down is not being updated server-side and the second drop-down is not displaying the right content.

Obviously none of this is very surprising, as we're really fighting the AjaxObserveField here.  In any case, some questions:

1.  Is there an event we can fire to force the AjaxObserveField to notice the background (that is, not via the UI) update to the select that it's watching?

2.  Failing that, is there a _javascript_ hook to manually fire whatever the AjaxObserveField would fire, and cause the partial form submission?


--
Paul Hoadley
http://logicsquad.net/




 _______________________________________________
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
  • Follow-Ups:
    • Re: "Manual" form submission with Ajax.framework
      • From: Paul Hoadley <email@hidden>
References: 
 >"Manual" form submission with Ajax.framework (From: Paul Hoadley <email@hidden>)
 >Re: "Manual" form submission with Ajax.framework (From: Jonathan Miller <email@hidden>)

  • Prev by Date: Re: "Manual" form submission with Ajax.framework
  • Next by Date: Re: "Manual" form submission with Ajax.framework
  • Previous by thread: Re: "Manual" form submission with Ajax.framework
  • Next by thread: Re: "Manual" form submission with Ajax.framework
  • Index(es):
    • Date
    • Thread