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]On click of a button load the data in double list control dynamically

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]On click of a button load the data in double list control dynamically
 Login/Join
 
Member
posted
Hello,

I have requirement on click of a button it has to load the data in double list control dynamically from FEX ,similarly have numerous buttons it has happen for all buttons on click .

Any help & suggestion would be great help

e.g. Account Number for the Account Number Button, in the listing will place that value in the Selections Box(i.e double list control ).

TABLEF FILE ACCOUNT
SUM FST.ACCOUNT
BY ACCOUNT
ON TABLE PCHOLD FORMAT XML
END

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


7.6.10
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus
ETL 7.6.10
SQL Server 2000 / 2008
DB2 ,Oracle
 
Posts: 5 | Location: Dallas,TX | Registered: July 09, 2010Report This Post
Guru
posted Hide Post
?


WebFOCUS 8.1.05 / APP Studio
 
Posts: 272 | Location: Brazil | Registered: October 31, 2006Report This Post
Member
posted Hide Post
I am using webfocus 8.1.05 /app studio.


7.6.10
Windows
HTML, PDF, Excel etc
DevStudio/Webfocus/Focus
ETL 7.6.10
SQL Server 2000 / 2008
DB2 ,Oracle
 
Posts: 5 | Location: Dallas,TX | Registered: July 09, 2010Report This Post
Master
posted Hide Post
Here's an example of what you want to do using the CAR table provided by IBI...

I created three FEX files: country.fex, car.fex and model.fex. They are on the data server (EDASERVE) in an application called "BIDEV". They look like this:

-* Generate Country data
TABLE FILE ibisamp/car
PRINT COUNTRY
ON TABLE PCHOLD FORMAT XML
END
-RUN

-* Generate Car data
TABLE FILE ibisamp/car
PRINT CAR
ON TABLE PCHOLD FORMAT XML
END
-RUN

-* Generate Model data
TABLE FILE ibisamp/car
PRINT MODEL
ON TABLE PCHOLD FORMAT XML
END
-RUN


Here is the hyperlink to test the country FEX file (It won't work for you, it's not on the Internet):

http://webfocusdev/ibi_apps/WF...ex=BIDEV/country.fex


It will return this XML to a browser:

<?xml  version="1.0" encoding="UTF-8"?>
<fxf  version="1.0" data="hold">
<report  records="5" lines="5" columns="1" rows="5">
<target  format="" version="" type="" destination="HOLD"/>
<column_desc>
<col  colnum="c0" fieldname="COUNTRY" alias="COUNTRY" datatype="char" width="10" focus_format="A10" description="" accept="" help_message="" title="" property="" reference="" valign="left">
</col>
</column_desc>
<table>
<tr  linetype="data" linenum="1">
<td  colnum="c0">ENGLAND</td>
</tr>
<tr  linetype="data" linenum="2">
<td  colnum="c0">JAPAN</td>
</tr>
<tr  linetype="data" linenum="3">
<td  colnum="c0">ITALY</td>
</tr>
<tr  linetype="data" linenum="4">
<td  colnum="c0">W GERMANY</td>
</tr>
<tr  linetype="data" linenum="5">
<td  colnum="c0">FRANCE</td>
</tr>
</table>
</report>
</fxf>


The other two FEX procedures do the same, just with different data and a slightly different hyperlink.

I have a double listbox named "customselect1" and three push buttons called "country", "car" and "model".

The following JavaScript code should do what you want to do. It uses Ajax to call on hyperlinks to get the XML data after each button is pushed. I put comments in the code that explain further.

// *** Start of the button functionality ***
function country_onclick(event) {
 callServer('country');
}

function car_onclick(event) {
 callServer('car');
}

function model_onclick(event) {
 callServer('model');
}

// Prepare for Ajax calls
var xmlHttp = false;

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
 xmlHttp = new XMLHttpRequest();
}

// Determine which FEX procedure to call, then call it
function callServer(which_button) {
 var url = "/ibi_apps/WFServlet" + "?" + "IBIF_ex=BIDEV/" + which_button + ".fex";
 xmlHttp.open("GET", url, true);
 xmlHttp.onreadystatechange = domupdate;
 xmlHttp.send(null);
}

// Update the double listbox with the new information
function domupdate() {
 if (xmlHttp.readyState == 4) {
  if (xmlHttp.status == 200) {
   var responseXML = xmlHttp.responseXML;
   var i;

   // Remove any existing selections from the left side of the double listbox
   var list_options = document.getElementById("customselect1_selectfrom");
   for (i = 0; i < list_options.length; i++) {
    while (list_options.hasChildNodes()) {
     list_options.removeChild(list_options.firstChild);
    }
   }

   // Remove any existing selections from the right side of the double listbox
   list_options = document.getElementById("customselect1_selectto");
   for (i = 0; i < list_options.length; i++) {
    while (list_options.hasChildNodes()) {
     list_options.removeChild(list_options.firstChild);
    }
   }

   // Add new selections to the left side of the double listbox
   var trs = responseXML.getElementsByTagName("tr");
   for (i = 0; i < trs.length; i++) {
    var tds = trs[i].getElementsByTagName("td");
    var option = document.createElement("option");
    option.text = tds[0].firstChild.nodeValue;
    document.getElementById("customselect1_selectfrom").add(option);
   }
  }
 }
}

This message has been edited. Last edited by: Squatch,


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report 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]On click of a button load the data in double list control dynamically

Copyright © 1996-2020 Information Builders