Focal Point
[CLOSED] Reset the value of the tree control

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1487087776

August 12, 2015, 09:35 AM
Anton
[CLOSED] Reset the value of the tree control
Hello everyone,

Please give an advice.

I have 4 tree controls that logically are connected to one dropdown box. Depending on the value that is selected in the dropdown box one of the 4 tree controls is shown. And the previous control value that was selected should be reset to FOC_NONE or the top hierarchy element.

i used the following code

var defaultValues_HIER = new Array();
defaultValues_HIER.push('FOC_NONE');


//Begin function lst_org_unit_type_onblur
function lst_org_unit_type_onblur(ctrl) {
if(lst_org_unit_type.value == 'TREXC_CRTR') {
treecontrol1.style.visibility ="visible";
treecontrol2.style.visibility ="hidden";IbComposer_setCurrentSelection('treecontrol2',defaultValues_HIER , true);
treecontrol3.style.visibility ="hidden";IbComposer_setCurrentSelection('treecontrol3',defaultValues_HIER , true);
treecontrol4.style.visibility ="hidden";IbComposer_setCurrentSelection('treecontrol4',defaultValues_HIER , true);}

if(lst_org_unit_type.value == 'TREXCU_RCS') {
treecontrol2.style.visibility ="visible";
treecontrol1.style.visibility ="hidden";IbComposer_setCurrentSelection('treecontrol1',defaultValues_HIER , true);
treecontrol3.style.visibility ="hidden";IbComposer_setCurrentSelection('treecontrol3',defaultValues_HIER , true);
treecontrol4.style.visibility ="hidden";IbComposer_setCurrentSelection('treecontrol4',defaultValues_HIER , true);}

if(lst_org_unit_type.value == 'RCVRYRESP') {
treecontrol3.style.visibility ="visible";
treecontrol1.style.visibility ="hidden";IbComposer_setCurrentSelection('treecontrol1',defaultValues_HIER , true);
treecontrol2.style.visibility ="hidden";IbComposer_setCurrentSelection('treecontrol2',defaultValues_HIER , true);
treecontrol4.style.visibility ="hidden";IbComposer_setCurrentSelection('treecontrol4',defaultValues_HIER , true);}

if(lst_org_unit_type.value == 'ABSRPRQ') {
treecontrol4.style.visibility ="visible";
treecontrol1.style.visibility ="hidden";IbComposer_setCurrentSelection('treecontrol1',defaultValues_HIER , true);
treecontrol2.style.visibility ="hidden";IbComposer_setCurrentSelection('treecontrol2',defaultValues_HIER , true);
treecontrol3.style.visibility ="hidden";IbComposer_setCurrentSelection('treecontrol3',defaultValues_HIER , true);}
}
//End function lst_org_unit_type_onblur

after changing the the lst_org_unit_type control the dispalyed tree control have all checkboxes DE selected, BUT when i run the report the old value are still send to the procedure.

May be you can suggest me some other way of resetting the selected values in tree control?

treecontorol1.value = 'FOC_NONE' and parent.parent.IbComposer_setCurrentSelection('treecontorol1', 'FOC_NONE') did not work.

Thank you,
Anton

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8.0.08
Windows, All Outputs
August 13, 2015, 02:03 PM
MattC
Here is what I use for my tree controls

 
    IbComposer_setCurrentSelection('att_tree', 0, false);

 


This will not collapse the tree control, but it will deselect anything checked.


WebFOCUS 8.1.05
August 14, 2015, 05:00 AM
Anton
Thank you for your advice. But this did not help.
The function did remove the checked in checkbox, but did still pass the parameter to the source. May be it is the issue with hiding the trees or my 'bad' js. But thank you anyway.


WebFOCUS 8.0.08
Windows, All Outputs