Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Closed]Populate listbox vertically

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Closed]Populate listbox vertically
 Login/Join
 
Gold member
posted
Hi,

I use the following code to read values from text file and trying to populate them to the listbox. The values are getting added but horizontally as a single value. I need them to be displayed vertically as multiple values.

animals.txt contains the following value
Lion
Tiger
Elephant

--- My Code ----------------------------

SET HOLDLIST=PRINTONLY
FILEDEF TRY DISK ab63221/animals.txt
TABLE FILE TRY
PRINT ANIMAL
ON TABLE SAVE AS ANIMALLIST
END
-RUN


-HTMLFORM BEGIN

Have rest of my HTML code which is not getting displayed in this post

!IBI.FIL.ANIMALLIST;

-HTMLFORM END
----------------------------------------------------------

Thanks,
Ramya
Webfocus 8105, HTML, Javascript

This message has been edited. Last edited by: Ramya,
 
Posts: 73 | Registered: January 02, 2012Report This Post
Platinum Member
posted Hide Post
Ramya,

This very basic know of HTML, Perhaps HTML help might be your wanting?

W3Schools HTML

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
 
Posts: 106 | Registered: April 06, 2009Report This Post
Master
posted Hide Post
Here is an example with the CAR file:

TABLE FILE IBISAMP/CAR
PRINT
    CAR
WHERE RECORDLIMIT EQ 3
ON TABLE HOLD AS CARJSON FORMAT JSON
END

-HTMLFORM BEGIN
<script type="text/javascript">
function build_listbox() {
	var cars = !IBI.FIL.CARJSON;

// "cars" variable now contains this JSON object:
//
//   {
//     "records" : [
//        { "CAR" : "JAGUAR" },
//        { "CAR" : "JENSEN" },
//        { "CAR" : "TRIUMPH" }
//      ]
//   }

	var listbox = document.getElementById("listbox1");

	for (i = 0; i < cars.records.length; i++) {
		var option = document.createElement("option");
		option.text = cars.records[i].CAR;
		option.value = cars.records[i].CAR;
		listbox.add(option);
	}
}
</script>
<body onload="build_listbox()">
<select id="listbox1"></select>
</body>
-HTMLFORM END


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Expert
posted Hide Post
You probably need to account for the CR/LF in the text file before loading it...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Gold member
posted Hide Post
Thanks All,

I got it done. Simple things never strike when we are into the work.

Regards,
Ramya
Webfocus 8105
HTML,Javascript


WebFocus 7702
HTML
 
Posts: 73 | Registered: January 02, 2012Report This Post
Expert
posted Hide Post
So, What's was your solution, the "Simple things never strike when we are into the work."?
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Gold member
posted Hide Post
Doug,

I have used Squatch's method for displaying them vertically

Thanks,
Ramya
WebFocus 8105,HTML,Javascript
 
Posts: 73 | Registered: January 02, 2012Report This Post
Expert
posted Hide Post
Thanks for you feedback Ramya...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Closed]Populate listbox vertically

Copyright © 1996-2020 Information Builders