Hi again Colin,

I really like your doublecombo, I learned a lot reading it. But it doesn't 
solve my problem of populating *the first* select. It will solve the 
populating of the second and third select. That is why I can't use it (for 
the first select). I have also read up on JSON, and it seems a lot more 
sensible than my suggestion of a semicolon-separated string, but basically 
the idea is the same, but he syntax more elaborate and extensible. It seems I 
have to do the code for the first select "by hand", and then I can use 
doublecombo for the second and third (which also don't need optgroups).

I hope this was clear on why I cannot use doublecombo for the problem I am 
*currently* struggling with.

Please let me know if I have misunderstood something.

Bjørge

On Tuesday 13 February 2007 16:16, Colin Mollenhour wrote:
> Speed is really a non-issue here. Only if you had a HUGE response would
> you notice a delay (other than ping time), and at that point you would
> have usability problems anyway... I highly recommend using JSON with a
> data structure like I did in Ajax.DoubleCombo if you aren't going to use
> it in the first place (why not?). Like I said you will need to modify it
> to support optgroup if you need support for those, I don't currently
> have the time or need to do it myself. Creating that data-structure
> server-side is VERY easy with any language that has a JSON library
> (probably all).
>
> Colin
>
> Bjørge Solli wrote:
> > Hmm. Is this "some browsers" every browser exept FF? Well, I can't live
> > with that, even how much I like that browser. Is the best solution,
> > except for using a different package, to simply use AJAX.Request with a
> > onSuccess:function(transport){ fillSelect('dataset',
> > transport.responseText); }
> >
> > and have something like this (pseudocode)
> > function fillSelect(sel,str) {
> >   arr = str.split(';');
> >   for foo in arr {
> >     make option-object foo
> >     add option-object foo to select sel
> >   }
> > }
> >
> > What do you guys think of this approach? It is putting a lot more work to
> > the browser, but this should be so little that it will take fractions of
> > a second on even an old computer. I'm interested in "best practices
> > answers" too.
> >
> > Regards
> > Bjørge
> >
> > On Monday 12 February 2007 19:16, Colin Mollenhour wrote:
> >> Man have I got just what you need!
> >> http://colin.mollenhour.com/doublecombo/index.html
> >>
> >> However, I don't think I accounted for optgroups.. I'm sure this could
> >> be made to work though. Either way, you will have to use a DOM method
> >> like mine, innerHTML for selects does not work on some browsers, period.
> >>
> >> Thanks,
> >> Colin
> >>
> >> Bjørge Solli wrote:
> >>> Hi
> >>>
> >>> I'm currently learning how AJAX is working and found prototype.js
> >>> interesting. But I have some issues that might be because of misusage:
> >>>
> >>> http://brasilia.nersc.no/test/PyTest/AJAX.html
> >>> When I use this in Firefox2 it correctly fills the first select, using
> >>> opera9 it is filled, but it just shows a list of "blank" options (no
> >>> description), and in IE6 it doesn't get filled at all.
> >>>
> >>> I use python in the backend, and feeding it the input it replies
> >>> correctly in all browsers:
> >>> http://brasilia.nersc.no/test/PyTest/AJAX.py/getDatasetOptions
> >>>
> >>> This is my code:
> >>>   new Ajax.Updater({ success:'dataset', failure:'image' },
> >>>              'AJAX.py/getDatasetOptions',
> >>>              { method:'get', parameters:$H({ random:Math.random() }),
> >>> insertion: Insertion.Bottom }
> >>>              );
> >>>
> >>> Any help appreciated.
> >>> Thanks!
> >>>
> >>> ###
> >>> For those interested; this will be an open source visualisation tool
> >>> for generating images of climate data using dods/THREDDS in the back.
> >>> (that is why I use python in the back, it makes it possible to talk
> >>> easily with the THREDDS server.)
>
> 
-- 
Bjørge

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to