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] Sending display values as another amper variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Sending display values as another amper variable
 Login/Join
 
Silver Member
posted
Has anyone used JavaScript perhaps, or another method, to send multiple (or single) display values as a second amper variable?

Example: a department list, set up in a double list box as a filter for a report.
We are displaying the department names, but returning the department values. However, suppose I would like the department names to include in the report as a header for example. ("Selections were Human Resources, Finance, IT....")

This could be done by cycling through the multiple returned values and joining them back with the code table, but I was thinking it might be possible to get the display values (even in a comma separated string would be adequate) and fire them in as an amper as well?

This message has been edited. Last edited by: Keith MacDonald,


WebFOCUS & DataMigrator 7.7.03M
Windows 2003, Windows 2008 x64
 
Posts: 35 | Registered: May 11, 2011Report This Post
Silver Member
posted Hide Post
As a note, I've had return values be concatenated to display values....ie
'003_Human Resources' and used GETTOK, but this might be a little more complex because it's a multi-select...


WebFOCUS & DataMigrator 7.7.03M
Windows 2003, Windows 2008 x64
 
Posts: 35 | Registered: May 11, 2011Report This Post
Virtuoso
posted Hide Post
sure you can do this
but remember the send amper values has its limitations

So what I would do is send only the code and translate it in the receiving fex
then put the result in a decode




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
I've done this in to different ways in the past.

1. Have two list boxes, one hidden with the names, and javascript attached to the change event of the visible one, that sets the selected attribute.

2. Have a hidden input field, and javascript that populates all the values on the change event firing.

As long as the other object is in the form,they will be passed through as an/multiple amper variable(s)


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Guru
posted Hide Post
Hi Kieth,

Here is one way of doing that...

 
<html>
<script>
function alertmsg()
{
 var selObj = document.getElementById('s1');
 var i; 
 var count = 0; 
 var selectedArray = new Array();
 for (i=0; i<selObj.options.length; i++) 
 {
   if (selObj.options[i].selected){ 
    selectedArray[count] = selObj.options[i].text; 
   count++; 
  }	  
 } 
  document.getElementById('h1').value = selectedArray ;
  alert(selectedArray);
}
</script>
<select multiple id='s1'>
<option value=1>1</option>
<option value=2>22</option>
<option value=3>333</option>
</select>
<input type="hidden" value = "" id = 'h1'/>
<button onClick = 'alertmsg();'/>
</html>


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Report This Post
Guru
posted Hide Post
Kieth, You can access the &h1 variable for the display text delimited by commas. You can split with GETTOK and use them as needed.

If the List is not going to be of multiple selection, then the Loop can be avoided, and value/text can be got through SelectedIndex.

Waz, This might be bit simple in case avoiding the hidden list box.


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Report This Post
Silver Member
posted Hide Post
I have created a bit of re-usable code that one could either copy and paste, or -INCLUDE.
Just do the sets (that are commented first)

-*-SET &lookuptable = 
-*-SET &codefield = 
-*-SET &namefield = 
-*-SET &codefilter = 



TABLE FILE &lookuptable
SUM
     &namefield NOPRINT
BY &namefield
WHERE &codefield EQ &codefilter;
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS code2name
END

-RUN
-SET &names_output = '';
-REPEAT LOOP FOR &i FROM 1 TO &LINES
-READ code2name NOCLOSE &line.A50.
-SET &line = EDIT(&line,'$99999999999999999999999999999999999999999999999999');
-SET &line = TRUNCATE(&line);
-SET &comma = IF &i LT &LINES THEN ', ' ELSE '';
-SET &names_output = &names_output | &line |  &comma ;
-LOOP
 


WebFOCUS & DataMigrator 7.7.03M
Windows 2003, Windows 2008 x64
 
Posts: 35 | Registered: May 11, 2011Report This Post
Silver Member
posted Hide Post
Thanks to a couple of IBI folks for their assistance creating this Smiler


WebFOCUS & DataMigrator 7.7.03M
Windows 2003, Windows 2008 x64
 
Posts: 35 | Registered: May 11, 2011Report This Post
Guru
posted Hide Post
quote:
department list, set up in a double list box as a filter for a report.
We are displaying the department names, but returning the department values. However, suppose I would like the department names to include in the report as a header for example.


Hi Kieth, Could you please explain, How the code matched your requirement ? We wrongly diserned, you needed something with Javascipt...


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Report This Post
Silver Member
posted Hide Post
Hi Ramkumar,

I didn't absolutely require it to be a JS solution, but just one that would get me the items I needed. Thanks for the assistance!


WebFOCUS & DataMigrator 7.7.03M
Windows 2003, Windows 2008 x64
 
Posts: 35 | Registered: May 11, 2011Report 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] Sending display values as another amper variable

Copyright © 1996-2020 Information Builders