Hi all, I have a menu tree with three levels, MENU_TREE_ROOT, MENU_TREE_LEVEL1, MENU_TREE_LEVEL2. I am using api_datasource.setdefaultquery to filter the query based on user role in my postinitilization procedure. My tree definition datasource is the MENU_TREE_ROOT menu as under: tree name="TREE1" displayColumn="NAME" nodeKeyColumn="ID" dataSource="TREE_ROOT" nodeStateColumn="NODESTATE"> The problem is my setdefaultquery command does not work for the MENU_TREE_ROOT level. But works with the other two levels. However, if I put the same filtering in the datasource definition itself directly at design time it works. Am I doing some mistakes somewhere? Kindly help. George. |
Hi George, I guess you are calling your postinitilization procedure in the postInitialize event of your panel containing the tree. The postInitialize event of a panel fires just after the initialization of all the objects existing in this panel is completed, including the datasource of tree (TREE_ROOT). If the queryOnInitialize attribute of the TREE_ROOT datasource is set to Y, this datasource will be queried when it's initialized, which means that it will be queried before the postInitialize event of the panel, therefore also before your To achieve your request, you can set queryOnInitialize attribute of the TREE_ROOT datasource to N and then execute this datasource in your postinitilization procedure using You can set the queryOnInitialize attribute of a datasource through the "Query On Initialize" checkBox existing in the datasource edit dialog. Hope this helps, Hi Ibrahim, Following your advice I removed "Query On Initialize" checkBox for all the three queries and added api_datasource.executeQuery. Result: The root which had the original problem started to work correctly,but lost bold fontstyle. At the same time the other two queries stopped functioning. Therefor, I re-check marked all the three queries for "Query On Initialize". Then I added the api_datasource.executeQuery for the first query only. And everything works fine now. The only problem is I lost my BOLD fontstyle for the ROOT query while the other two queries are BOLD and working. George
(29 Mar '13, 15:30)
George
Hi George, You have to execute each datasource that is set as "Query On Initialize" = "N" using api_datasource.executeQuery API. Since you are currently executing only the root, it's normal that the other two queries stop functioning. In your case, you can still uncheck the "Query On Initialize" checkBox for the root and keep checked for the other two queries. I guess you are using Regards,
(30 Mar '13, 08:46)
Ibrahim Sand... ♦♦
|
Hi George, During my tests, I noticed that you can also use
Hope this helps, Hi Ibarahim, My tree was perfectly working after testing with the changes I mentioned above except for the fontstyle. I was using the command (select ..., 'Bold' as fontStyle from ..) as part of the query itself. Now, I changed populate method to api_treenode.populatechildren('panelName.TREE1', '') as suggested and fontstyle is working fine. Now, there is no problem with my trees. Thank you very much. George.
(30 Mar '13, 09:50)
George
|