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] Receiving multiple values from HTML

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Receiving multiple values from HTML
 Login/Join
 
Member
posted
I have a launch page having field list. User will have ability to decide what columns to be printed on the report. I have created a double list countrol so user can select the fields he wants on report. When I read the selected paramert it comes with 'OR' e.g. 'FIELD',OR,'FIELD2',OR,'FIELD3'. I used STRREP to replace the OR with space but this parameter is still a string. I want to break it into a row format. Is there any function which can handle this or is there possibility to read them as listbox1,listbox2 ? I want to break this string as similar kind of listbox is provided for user to decide control break for sub-total and its also a multiselect double list box. If we continue with the first example he will select field1 & field2 on which he would want to sort & subtotal the report. I can not use the string generated out of listbox for SUBTOTAL. Anyone has any suggestions?

San

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


7.6.9/7.7
Windows/OS 390
PDF/Excel
 
Posts: 6 | Registered: December 07, 2010Report This Post
Guru
posted Hide Post
 
-SET &INFL = '''FIELD1'' OR ''DLEIF2''';
-SET &OUTFL = STRREP (&INFL.LENGTH, &INFL, 10, ' OR ', 1, ',', &INFL.LENGTH, 'A&INFL.LENGTH');
-SET &STRING = &OUTFL;
-SET &SEARCHCHAR = ',';
-SET &STRING_LEN = &STRING.LENGTH;
-SET &CHARCOUNT = 0;
-SET &IDX = 1;

-REPEAT :EL1 WHILE &IDX LE &STRING_LEN;
-SET &CHARACTER = SUBSTR(&STRING_LEN, &STRING, &IDX,
-                 &IDX, 1, 'A1');
-SET &CHARCOUNT = IF &CHARACTER EQ &SEARCHCHAR THEN &CHARCOUNT + 1
-                 ELSE &CHARCOUNT;
-SET &IDX = &IDX + 1;
-:EL1

-SET &NUMELEMS = &CHARCOUNT+1;

-REPEAT EL2 FOR &CNTR FROM 1 TO &NUMELEMS
-SET &FIELDVAL&CNTR.EVAL = GETTOK(&OUTFL, &OUTFL.LENGTH, &CNTR, ',', 10, ' ');
-RUN
-EL2

-TYPE &FIELDVAL1
-TYPE &FIELDVAL2


-EXIT


This might be something you are looking at...


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
<FreSte>
posted
Hi,

If I understood the question correctly, you want to use 1 object for 2 different things.

1 = As field selector
2 = Wheater or not to subtotal on that field


I have created a double-list-control + added an extra 3rd listbox (id=listbox3)
I also added a click-event on the "select-to" listbox.
That event will call the javascript-function (see below).

The function is changing the color of the clicked-item into red or default.
If the color of the item is red, that item is added in the 3rd listbox and you
can use that 3rd listbox as the columns for subtotals.
(... and of course, this function must also be called after removing an item from
the "select-to" listbox or if the order is changed)

After all is tested, you can hide that 3rd listbox and for the user it is clear
to see which columns will be subtotaled (the red-coloured).


Hope this is what you need,

-Fred-


function customselect1_selectto_onclick(ctrl) {
	// --- Toggle color of element in listbox
	var _objColumns = document.getElementById(ctrl.id);
	var _index     = _objColumns.selectedIndex;
	var _color     = _objColumns[_index].style.color;
	var _newcolor = (_color == "") ? "red" : "";
	_objColumns[_index].style.color = _newcolor;

	// --- Delete all elements from temp-listbox
	var _objForSubtotal = document.getElementById("listbox3");
	_objForSubtotal.length = null;

	// --- Add elements who's color == red to 3rd listbox for subtotaling
	var j = 0;
	for (var i=0; i < _objColumns.length; i++) {
		if (_objColumns[i].style.color == "red") {
			_objForSubtotal.length = j+1;
			_objForSubtotal[j].value = _objColumns[i].value;
			_objForSubtotal[j].text = _objColumns[i].text;
			j++;
		}
	}
}

This message has been edited. Last edited by: <FreSte>,
 
Report This Post
Expert
posted Hide Post
Are you aware that you do not have to have one field per line in WebFOCUS.

e.g.
TABLE FILE CAR
PRINT COUNTRY CAR MODEL BODYTYPE
END


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
Gold member
posted Hide Post
FYI ...

On the "parameters" tab of the HTML composer, when you select your listbox1 control, check the checkbox for "Send display value".

This will pass the following variables:

&listbox1 = field1 OR field2 OR field3
&listbox1_TEXT = field1, field2, field3

You could use the latter and put it in the loop RamKumar suggested above.


WF 7.6.10, Windows, PDF, Excel
 
Posts: 75 | Location: Dallas, TX | Registered: February 12, 2004Report This Post
Master
posted Hide Post
Hai Mary,

I tried that option "Send display value" but still it send field1 OR field2 OR field3..?!
Can you post a simple example with CAR file if possible..

Thanks


8.1.05
HTML,PDF,EXL2K, Active, All
 
Posts: 484 | Registered: February 03, 2009Report This Post
Expert
posted Hide Post
Have you considered using "QUOTEDSTRING". Is that apropos for this situation?
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Gold member
posted Hide Post
Output:
&listbox1 = 'AUDI' OR 'BMW' OR 'DATSUN'
&listbox1_TEXT = AUDI, BMW, DATSUN

HTML:

Created an HTML page with one listbox set to send multiple entries.
Parameter page attached the paramter (below from the report) to the listbox.
Embedded the Car.mas selecting the Car field.
Checked the "Send display value".

Would have added the html code here; but it seemed to large and not all of it showed in the display window.


Report:
-* File demo1.fex
-DEFAULTS &listbox1 = FOC_NONE

-TYPE &|listbox1 = &listbox1
-TYPE &|listbox1_TEXT = &listbox1_TEXT

-EXIT

This message has been edited. Last edited by: Mary Watermann,


WF 7.6.10, Windows, PDF, Excel
 
Posts: 75 | Location: Dallas, TX | Registered: February 12, 2004Report This Post
Master
posted Hide Post
quote:
Originally posted by Mary Watermann:
Output:
&listbox1 = 'AUDI' OR 'BMW' OR 'DATSUN'
&listbox1_TEXT = AUDI, BMW, DATSUN

HTML:

Created an HTML page with one listbox set to send multiple entries.
Parameter page attached the paramter (below from the report) to the listbox.
Embedded the Car.mas selecting the Car field.
Checked the "Send display value".

Would have added the html code here; but it seemed to large and not all of it showed in the display window.


Report:
-* File demo1.fex
-DEFAULTS &listbox1 = FOC_NONE

-TYPE &|listbox1 = &listbox1
-TYPE &|listbox1_TEXT = &listbox1_TEXT

-EXIT


thanks mary. i used &listbox1_text and i got display values separated by comma instead of actual values. this is a good one. but this doesn't help if we have field names selection from listbox. because as display we give meaningful names but for values we actually put a field name. so what i think is we thake the value and use dialog manager commands in the code to make modifications to the data.


8.1.05
HTML,PDF,EXL2K, Active, All
 
Posts: 484 | Registered: February 03, 2009Report 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] Receiving multiple values from HTML

Copyright © 1996-2020 Information Builders