Populate Checkbox Tree sys_CheckBoxTree from XML Application(s)?

All of the following refers to version 6.5.2

We have a set of Products and Product Variants in an external database that we want to use to populate a CheckBox Tree control, such that the editor can select one or more Product Variants. The structure would be like:

[ul]
[li]Product 1 Name[LIST]
[/li][li]Product Variant 1 Name
[/li][li]Product Variant 2 Name
[/li][/ul]
[li]Product 2 Name[ul]
[/li][li]Product Variant 3 Name
[/li][/ul]
[/LIST]

The Product Variants should be selectable, the Products should not.

Based on what I read in the PDF documentation and from this thread, I did the following:

[ol]
[li]Created an XML Application with a query resource based on sys_Lookup.dtd with the ids and labels for my Product Variants (LookupProductVariants)
[/li][li]Created an XML Application with a query resource based on sys_CheckboxTreeControl.dtd with the node structure with Products as the first level nodes and Product Variants as the second level nodes (CheckboxProductVariants)
[/li][li]Set the Choices tab for the sys_CheckBoxTree field to “Retrieve from xml application” and selected the LookupProductVariants application
[/li][li]Added the tree_src_url parameter under the Control tab to the URL of the CheckboxProductVariants application
[/li][/ol]

When I go to edit the content type that contains the field, instead of a list of checkboxes, I get a big blank square with a “broken image X” icon in the corner.

Does anyone have any suggestions? Or know of somewhere that there is a step-by-step example for setting up a CheckBox Tree, like the example for the DropDownSingle that’s in the PDF docs? Thanks.

I’m still looking for assistance with setting up a checkbox tree control populated from XML applications for the choices and tree structure. This would be the optimal user interface for our editors if I can get this working, and I’m not seeing any reason for it to not be working. Any help or a point in the direction of documentation would be appreciated.

Thanks.

Elizabeth,

The tree_source_url should point to a static XML file that defines the tree. See the discussion of the sys_checkboxtree control on p. 43 of the Technical Reference.

RLJII

Thanks. It was my understanding that the id’s need to match in the tree_source_url XML file versus the Choices query. How do I do that with a static XML file? The set of Products and related Product Variants may have additions over time, so is the only way to do this to have to update the static XML file every time something is added to those tables?

I tried to reference the discussion you mentioned, but page 43 of the Technical Reference does not talk about the checkboxtree control. I check in both the v6.7 document you linked and the v6.5.2 document since that’s the version we’re using. I’ll keep looking though.

It’s actually on p. 48 in the 6.7 version of the document, and on p. 47 of the 6.5.2 version.

Guess I need to visit the optometrist again. And these are brand new lenses, too. :frowning:

Elizabeth,

I was talking to one of our consultants yesterday about your situation, and he told me that it should be possible to use a dynamic lookup for both required XMLs. If I were going to do this, I would test each lookup with a static XML first to ensure that the queries were working, then use the two dynamic queries together.

As for the control being replaced by an X, that suggests that the control applet did not initialize correctly. Again, I would start with a static XML file for the source_tree_url to see if perhaps a data problem in your lookups caused the initialization problem. If the control does not initialize correctly with a static tree, there’s something else wrong that needs investigation.

RLJII

Wonderful. Thanks for the answers, and the suggestions on how to debug this. I’ll work up static XML files for the required XMLs to debug this, and see what the results are from there. Will post back when I have results.

Thanks.

Just to make sure I’m creating these static XML correctly, do the tree structure XML (set as tree_src_url) and the lookup XML (set on the Choices tab) use the same DTD, or different DTDs?

The technical reference for the sys_checkboxtree control says “The second XML file is a dynamically-generated lookup used to support Content Editor validation. This file has the same structure as the “tree” XML.”, which would seem to imply that they need the same DTD, but later in the same paragraph it says “The lookup file can be generated either from a keyword or dynamically using an internal lookup. For details on creating keywords, see “Creating Keywords” in the Rhythmyx Workbench Help. For details on creating an internal lookup, see Creating an Internal Lookup Query (on page 68).”, which seems to imply that the tree structure XML should be defined based on the tree node sys_CheckboxTreeControl.DTD and the lookup XML should use the sys_Lookup.DTD

Which is correct? Both based on sys_CheckboxTreeControl.dtd? Tree structure based on sys_CheckboxTreeControl.dtd and lookup based on sys_Lookup.dtd? Or am I not even in the right ballpark on this?

Elizabeth,

The DTD for the static tree is sys_CheckboxTreeControl.dtd.

It’s been a couple of years since we wrote that material so my memory is rusty and I don’t recall exactly what we did in our example; I think we used a keyword. But it would certainly make sense to use sys_CheckboxTreeControl.dtd for this lookup rather than sys_lookup.dtd.

RLJII