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     [SOLVED] comma separated multiple values in an EditBox

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] comma separated multiple values in an EditBox
 Login/Join
 
Member
posted
I have an HTML launch page,
one of the Fields in the launch page is ID_Number.
There are too many IDs to display in the Listbox. So, users can run a report on a particular ID number or multiple IDs by entering them in the EditBox.

I have a Filter in the report for the ID_Number column.
What logical relation, compare type and Compare Value should I enter to make it work?

Thanks,

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8.08
Windows, All Outputs
 
Posts: 7 | Registered: September 17, 2014Report This Post
Expert
posted Hide Post
How many ID_Numbers would the user need to enter? What is "Too Many to enter"?
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Member
posted Hide Post
Hi Doug,
It could vary from 1 to as many as the user wants. It probably will not be more than 10 but it depends on the user. There are about 10,000 IDs and I don't want a listbox of 10,000 IDs.
For example: I want the user to be enter the IDs in the text box in this format:

ID_1, ID_2, ID3 ..


WebFOCUS 8.08
Windows, All Outputs
 
Posts: 7 | Registered: September 17, 2014Report This Post
Expert
posted Hide Post
If they are just numbers, then you could use WHERE ID_Number IN (&ID_Number).

You will have to add checked to make sure this doesn't cause the fex to error though.


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
Member
posted Hide Post
They are characters.
I want something like this:
WHERE ID_NUMBER EQ 'ID_01', OR 'ID_02' OR 'ID_03'...


WebFOCUS 8.08
Windows, All Outputs
 
Posts: 7 | Registered: September 17, 2014Report This Post
Virtuoso
posted Hide Post
You can do it as Waz mentioned even if it's characters. You don't need to test with OR using that technic.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
Hi

There are a number of ways that you can do this but it will require some javaScript code. I built a IntelliSence like set of controls that can allow the user to search ids and then save the selection and do another search and save the selection. I have a presentation that I could share with you. Open a tech support case and ask for Barry.

Thanks Barry


WebFOCUS 8103, Windows, App Studio
 
Posts: 80 | Location: NYC | Registered: November 13, 2008Report This Post
Guru
posted Hide Post
Going off of what Waz said. Need to have an agreement with the users on how many items they can enter and the format.
  
-SET &ECHO = 'ALL';

-DEFAULT &INPUT = 'England , FRANCE , W germany, italy'
-DEFAULTH &ITEM = ''
-DEFAULTH &ITEM_LIST = ''


-REPEAT LP_LIST FOR &N FROM 1 TO 10;
-SET &ITEM = GETTOK('&INPUT.EVAL', &INPUT.LENGTH, &N, ',', 10, 'A&INPUT.LENGTH');
-SET &ITEM = UPCASE(&ITEM.LENGTH, '&ITEM.EVAL', 'A&ITEM.LENGTH');
-SET &ITEM = TRUNCATE(&ITEM);
-SET &ITEM = TRIM('B', '&ITEM.EVAL', &ITEM.LENGTH, ' ', 1, 'A&ITEM.LENGTH');
-IF &ITEM EQ '' THEN GOTO LP_LIST ;
 
-SET &ITEM_LIST = IF &N EQ 1 THEN '''' || &ITEM ||  '''' ELSE &ITEM_LIST || ',' || '''' || &ITEM ||  ''''  ;

-LP_LIST

-TYPE ITEM_LIST = &ITEM_LIST

TABLE FILE CAR
SUM
   DEALER_COST
   RETAIL_COST

BY COUNTRY
BY CAR
BY MODEL
WHERE COUNTRY IN (&ITEM_LIST)
END
-RUN


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Virtuoso
posted Hide Post
Assuming that the input is alpha, one can use a bunch of functions to replace the comma with a quote-comma-quote sequence. There shouldn't be any spaces around the commas in the input unless the value has a leading or trailing space!
  
-* File ccer01.fex
-SET &ECHO = 'ALL';
-*
-DEFAULT &INPUT = 'ENGLAND,FRANCE,W GERMANY,ITALY'
-SET &ILEN=&INPUT.LENGTH;
-SET &STRLEN=ARGLEN(&ILEN,STRIP(&ILEN, &INPUT, ',', 'A&ILEN.EVAL'), 'I3');
-SET &CC=&ILEN - &STRLEN;
-SET &QLEN=&STRLEN + 3 * &CC;
-SET &ITEM_LIST = STRREP(&ILEN, &INPUT, 1, ',', 3, ''',''', &QLEN, 'A&QLEN.EVAL');
-TYPE ITEM_LIST = &ITEM_LIST
-*
TABLE FILE CAR
SUM
   DEALER_COST
   RETAIL_COST
BY COUNTRY
BY CAR
WHERE COUNTRY IN ('&ITEM_LIST');
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Member
posted Hide Post
Thank you!
This issue is resolved.
I was able to speak with Barry and get his solution by using Javascript.
It wasn't exactly what I was looking for but it works.


WebFOCUS 8.08
Windows, All Outputs
 
Posts: 7 | Registered: September 17, 2014Report This Post
Expert
posted Hide Post
Please edit your first post in this thread and add [SOLVED] or [CLOSED] to the title


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
Master
posted Hide Post
Don't do that !

I've done similar things before...
...and found out WebFocus had a out-of-the-box solution.

Only thing you have to do is make the input type "Text area" ( not an "Text box" ).

This will allow you to set the property "Multiple" to "Multiple".
And you can set the property "Multiple: Add quotes" to "Yes".

This will make the HTML convert the entered values to exactly what you want.

A,B,C -> "A" OR "B" OR "C"

and you can even use line-feeds or semicolon as seperator.


....and yes, I wish I knew this before I started adding quotes myself.

....and why doesn't type "input box" support this?



G'luck.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Guru
posted Hide Post
Good One


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Member
posted Hide Post
Thanks Dave! I will give it a try.


WebFOCUS 8.08
Windows, All Outputs
 
Posts: 7 | Registered: September 17, 2014Report This Post
Gold member
posted Hide Post
quote:
Originally posted by Dave:
Don't do that !

I've done similar things before...
...and found out WebFocus had a out-of-the-box solution.

Only thing you have to do is make the input type "Text area" ( not an "Text box" ).

This will allow you to set the property "Multiple" to "Multiple".
And you can set the property "Multiple: Add quotes" to "Yes".

This will make the HTML convert the entered values to exactly what you want.

A,B,C -> "A" OR "B" OR "C"

and you can even use line-feeds or semicolon as seperator.


....and yes, I wish I knew this before I started adding quotes myself.

....and why doesn't type "input box" support this?



G'luck.


I really had to use javascript to process input content in Textarea, As my request was to put in an address field which can have commas in it.


In Focus since 2008
WebFOCUS 8.2.0.1
Windows 7 - IE,Chrome,Firefox
Excel, PDF, HTML, AHTML, XML
JavaScript, jQuery, D3.js, Highcharts
 
Posts: 79 | Location: New York | Registered: February 04, 2010Report This Post
Master
posted Hide Post
Roll Eyes

Yes... then you're doomed :-)

unfortunatly you can not indicate what seperator to use.

Although when entering
This is an address, with a comma;
And this is another one, with comma;

actually results in:
'This is an address,with a comma' OR 'And this is another one,with comma'


G'luck


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report 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     [SOLVED] comma separated multiple values in an EditBox

Copyright © 1996-2020 Information Builders