Closed (fixed)
Project:
Hierarchical Select
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
4 Mar 2009 at 16:34 UTC
Updated:
25 Mar 2009 at 00:22 UTC
Jump to comment: Most recent file
Comments
Comment #1
wim leersIt's supported. But you haven't added the .js file yet that is needed to make HS work. This is Drupal core's fault, really. But you can work around it by including the file yourself in advance.
Comment #2
jberube commentedI should have mentioned that on the initial page load there is already an HS select and it's working fine. When you AHAH in a new HS field though, the new one doesn't initialize. Since the page is originally loaded with an HS field, the JS files "hierarchical_select.js" and "hierarchical_select_formtoarray.js" are already loaded.
Comment #3
jberube commentedWhen you bring in new fields don't you have to initialize them somehow?
Comment #4
jberube commentedIf I re-run Drupal.HierarchicalSelect.initialize() after the new HS fields are brought in, the "No JS" message goes away, but when you make a selection on the HS field, the AJAX response is this:
Fatal error: Unsupported operand types in /Users/admin/Sites/sitename/includes/common.inc on line 2835
Comment #5
wim leersHuh? You shouldn't have to call .initialize() yourself. For some time, the D6 version of HS's JS uses Drupal.behaviors, which should do this automatically. Please verify that you have version 1.88 of hierarchical_select.js.
Comment #6
wim leersAlso, please ensure that
Drupal.setting.HierarchicalSelectgets updated through AHAH. There should be a series of settings in there for each HS instance.I.e. if you've got one HS on the page, it should have id 0 and you should have:
Drupal.setting.HierarchicalSelect.settings[0]I.e. if you've got two HSs on the page, they should have ids 0 and 1 and you should have:
See the attached screenshot for clarification.
Comment #7
wim leersThis is already working in the patch I posted a couple of days ago in http://drupal.org/node/342991. You can look there for examples. This is pretty advanced stuff though: Drupal doesn't make it easy (enough) yet.
You need a good understanding of how Drupal.settings, drupal_add_js(), page refreshes and AHAH loads interact. I don't have the time to explain this in great lengths, so if the above wasn't enough for you, you'll have to learn from that patch. I hope it's enough. If not, I hope for your understanding.