Focal Point
[CLOSED]8.1.05 Single Source Tree Control

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

February 01, 2016, 08:20 AM
MattC
[CLOSED]8.1.05 Single Source Tree Control
Can anyone try this in 8.1.05? I have a Single Source Tree Control and just a button with an Onclick event. Just add some static values in the tree control. I am trying to get the values of the selected values of the tree control.

I am not able to get the value using either of these.

 

   //var values = IbComposer_getCurrentSelection('treecontrol1');
var x = document.getElementById("treecontrol1").value;
alert (x);
 


These work fine in my old 8.00.8 DS version, but I am re-creating the page in App Studio. The page created in 8.00.08 runs fine in version 8.1.05, I just can't open it in App Studio 8.1.05, hence to why I am re-creating it.

Please and Thanks

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8.1.05
February 01, 2016, 09:37 AM
Squatch
The "value" property is not there in 8.1.05. The "treecontrol1" is a DIV element, and underneath it are HTML "input" tags of type "radio". Find these elements and you can test the "checked" property in each one. If "checked" is true, then you can read the "value" property that is there as well.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
February 01, 2016, 09:50 AM
Francis Mariani
You probably should be using the so-called API calls -
IbComposer_getCurrentSelection('controlID')
where controlID is the unique identifier of the control from which values are obtained.

This is valid for v8.0.08 and should be good for v8.1.05...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 01, 2016, 09:54 AM
Squatch
If there's an API call that would be much easier. Thanks, Francis!


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
February 01, 2016, 10:09 AM
MattC
Yes I try and use the API calls if all possibly.


Squatch - I do see the "input" tags underneath. I am dynamically populating the control, but I am not clear if I need to get them all?


WebFOCUS 8.1.05
February 01, 2016, 10:17 AM
Squatch
You would need to go through them all and look for the ones where the "checked" property is true.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
February 01, 2016, 11:17 AM
Francis Mariani
IbComposer_getCurrentSelection('controlID')
should return all the selected values.

quote:
The IbComposer_getCurrentSelection function gets the current selected values from a control.



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 01, 2016, 12:57 PM
MattC
quote:
Originally posted by Francis Mariani:
IbComposer_getCurrentSelection('controlID')
should return all the selected values.

quote:
The IbComposer_getCurrentSelection function gets the current selected values from a control.


That is they way it worked in prior versions. Now it appears to not work that way anymore.


WebFOCUS 8.1.05
February 01, 2016, 01:00 PM
MattC
quote:
Originally posted by Squatch:
You would need to go through them all and look for the ones where the "checked" property is true.



Yuck! I would prefer not to have to go this route. If my values are dynamically populated, I would think that these inputs could change, if my data changes.


WebFOCUS 8.1.05
February 01, 2016, 01:27 PM
Squatch
It's actually not that bad. You can use JavaScript's "getElementsByTagName" and loop through all the dynamically generated values, or use JQuery (which is even easier).

I could not get Francis' suggestion to work in my test page.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs