Hi,
I’m trying to create a checkBoxTree with dynamic value that are loaded by an internal lookup query. That part I don’t know how to do is the tree definition ? It would be easy to do with static value but how can I define that tree with dynamic values ?
There is some evolution on my problem. I created another internal lookup query for the tree definition but it still not working. I think that my problem is on the call of that internal query definition because when I copy the result document in a file and call the file instead of the query definition for the tree definition, the chexkBoxTree work fine.
See attachment for the call of my query definition.
I’m not sure I understand exactly what you’re trying to do.
In a checkbox tree field, there are 2 important parameters related to selection:
a “treesourceurl”, which is there the <tree> and <node> xml comes from
a set of “choices”, which is in the <PSXEntry> format.
All of the ids in the tree MUST be in the choices, or the values will be removed when a validation failure happens.
There is insufficient informationin the “choices” xml, so you cannot make the tree from the choices, but there is enough information in the tree to make the choices.
You can use XSLT to turn a tree into choices, if that’s what you’re trying to do.
It’s also possible to create a tree from a set of database queries (again, using XSLT), but this will require a highly computational stylesheet. If you’ve read Michael Kay’s book, this is slightly less complicated than his “knight’s tour” example (and so not for the faint of heart).
Tell me more about where the data comes from, and I can give you more suggestions about how to turn it into the 2 formats.
I created 2 internal querys. One for the “choices” (lookup dtd) and one for the “treesourceurl” (with a xslt to format my xml). My problem is that I am unable to pass a parameter to the “treesourceurl” query. I nead to pass the user “sys_lang” to that query. When I’m calling the tree_src_url with a literal like “…/hec_Support/prof_tree” it work fine but then I have to hard code the locale in my query. I’m trying to pass the locale of the user in the parameter using the sys_MakeIntLink function with paramName1 = sys_lang paramValue1 = “User/SessionObject/sys_lang” and then it does not work. My “choices” query is working that way to and I did not have any difficulty with it.
I added a link to an existing application and set the first parameter name to “sys_lang”. For the value, I selected “UserContext” (NOT “Literal”) and then “User/SessionObject/sys_lang”.
Here’s the resulting fragment from the control XML…
All of the ids in the tree MUST be in the choices, or the values will be removed when a validation failure happens.
I thought the choices XML file only contained those items that the user has selected. If it meant to contain all id then how is this presented in the file?
I have a checkboxtree control which renders and saves OK but if validation fails then the users selection is lost.
It is meant to contain all of the possible choices, not just the selected choices.
The selected choices are the “values” of the field, represented as a delimited list. This is passed to the checkboxtree applet through a different parameter.
If a “hardcode” parameter doesn’t work, then other functions you might add won’t work either. Are you using the standard Applet? What version (and patch level) is this?
Also, is it the “locale” of the user you are trying to match or the locale of the content item you are editing?
so the tree_src_url should point to an xml file or application resource to generate the structured XML
the choices tab (retrieve from xml application) should point to an application that lists all the items in the structured XML but conform to the sys_Lookup DTD
This is passed to the checkboxtree applet through a different parameter.
Where is this set?
Sorry to be asking these question but the technical ref manual is not clear on the checkboxtree control.
Hi,
Yes I’m using the standar Applet. We are on Rx 6.5.2 [13195]. I’m trying to pass the user locale.
I’m now using the function “sys_MakeAbsLink” to call my application for the “tree_src_url” parameter. The sys_lang is now passing. It’s always work with IE but sometime with Firefox it is asking my to login
so the tree_src_url should point to an xml file or application resource to generate the structured XML
the choices tab (retrieve from xml application) should point to an application that lists all the items in the structured XML but conform to the sys_Lookup DTD
Where is this set?
[/QUOTE]
Your assumptions are correct. The XSL template for the checkboxtree control computes the selected values and passes them to the applet as the “selectedItems” parameter.
You can look at the control definition in /Rhythmyx/sys_resources/stylesheets/sys_Templates.xsl for more details.
The default function is “sys_MakeIntLink”. When I’m using this one with parameter, it does not work. The checkBoxTree is always in error. I change the function to “sys_MakeAbsLink” still with the same parameter and it finally work.
I tested with passing the sessionid to the “sys_MakeAbsLink” function and it did not change anything. Sometime it work with Firefox and sometime it is asking my to reconnect.
sys_MakeIntLink makes an “internal link”. This link always starts with “http://127.0.0.1:…” which means it will only work when the server and the browser are on the same machine. This is almost certainly NOT what you want to do. (BTW, Internal Links include the session id)
sys_MakeAbsLink makes an “absolute link”. This link always starts with “http://<host>:<port>…” (where <host> and <port> are determined from the original request). This link should work, but I’ve not used it with the checkboxtree Applet.
There is a third possibility: use the “sys_MakeLink” function. MakeLink doesn’t re-write the URL, it just uses whatever base you supply. In this case, I’d recommend something that starts with “…/” or perhaps “/Rhythmyx”.
As with MakeAbsLink, you have to select “user defined function” rather than “link” when adding the parameter.
Thanks for the info. I tested it and it work fine now with “sys_MakeLink”. I’m passing the sys_lang and pssessionid parameters and it work with IE and Firefox without asking to reconnect.
Hi Dave,
If I’m trying to create a dynamic 3-level checkbox tree from the database, how would the DTD look like. Supposed I copied sys_CheckboxTree.dtd to sys_Checkbox3Level.dtd. I have the backend view working to be mapped to the DTD.