Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] comma separated multiple values in an EditBox
Go
New
Search
Notify
Tools
Reply
  
[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, 2014Reply With QuoteReport This Post
Expert
posted Hide Post
How many ID_Numbers would the user need to enter? What is "Too Many to enter"?
 
Posts: 2976 | Location: Middle Tennessee [8204M Gen48 in Test&Prod] | Registered: February 23, 2005Reply With QuoteReport 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, 2014Reply With QuoteReport 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.05OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6104 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport 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, 2014Reply With QuoteReport 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.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2161 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport 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: 82 | Location: NYC | Registered: November 13, 2008Reply With QuoteReport 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, 2008Reply With QuoteReport 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: 1932 | Location: Tel Aviv, Israel | Registered: March 23, 2006Reply With QuoteReport 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, 2014Reply With QuoteReport 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.05OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6104 | Location: Land of the Darug people, Terra Australis Incognita | Registered: October 31, 2006Reply With QuoteReport 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: 669 | Location: Veghel, The Netherlands | Registered: February 16, 2010Reply With QuoteReport This Post
Guru
posted Hide Post
Good One


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 405 | Location: India | Registered: June 13, 2013Reply With QuoteReport 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, 2014Reply With QuoteReport 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: 80 | Location: New York | Registered: February 04, 2010Reply With QuoteReport 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: 669 | Location: Veghel, The Netherlands | Registered: February 16, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

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-2018 Information Builders, leaders in enterprise business intelligence.