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     Sorting Listbox That Is Second In A Chain

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Sorting Listbox That Is Second In A Chain
 Login/Join
 
Guru
posted
Hi all,

I am creating a launch page with two listboxes that are chained together. The first in the chain is a REGION list and the second in the chain is a COUNTRY list.

Now, if I dynamically populate these listboxes by pointing them to the MS SQL Data Source I get a blank in the list because the columns they reference contain NULL values. Despite the blanks, each listbox is populated in it's own alphabetical order and the chaining works. So you might see the lists looking like...
(Sorry if the formatting doesn't look right. I tried to line these up Red Face)
REGION -- COUNTRY
China -- Argentina
Emerging Markets -- Australia
Europe -- Austria
Japan & Korea -- Belarus
... -- ...
and so on -- and so on

To eliminate the NULL values I created a procedure that selects the data for the lists. That looks like this...
  
SET ASNAMES = ON
TABLE FILE LOOKUPS
PRINT DST.SALES_REGION
DST.SALES_CNTRY
BY SALES_REGION
BY SALES_CNTRY
WHERE SALES_REGION NE '';
WHERE SALES_CNTRY NE '';
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE PCHOLD FORMAT XML
END


While this has eliminated the blanks I now have a different problem. The COUNTRY list is sorted according to it's grouping within REGION values. So now the lists look like this...
REGION -- COUNTRY
China -- China (belongs to China Region)
Emerging Markets -- Australia (belongs to Emerging Markets Region)
Europe -- Botswana (belongs to Emerging Markets Region)
Japan & Korea -- India (belongs to Emerging Markets Region)
North America -- ... (skipping a bunch of list items to demonstrate the point)
Other -- Austria (belongs to the Europe Region)
South America -- Belarus (belongs to the Europe Region)
... -- Belgium (belongs to the Europe Region)
and so on -- and so on

This obviously is not user-friendly if I want to select a specific COUNTRY. Especially if I don't know what REGION it belongs to. Now I have to 'search' through the COUNTRY listbox instead of jump to the starting letter(s) of the specific country.

So, my question is this - is it possible to either 1) eliminate the blank when the parameter is populated directly from the MS SQL Data Source or 2) change the sort order of the COUNTRY listbox after it has retrieved its values?

P.S. - The issue of the blank item in the listbox does not seem to happen if the data source is FOCUS but I'm not 100% sure of that. It seems like the issue is only when I use MS SQL Data Sources.

Thanks for any light you can shed on this!

Best Regards,

Dan


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
 
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007Report This Post
Expert
posted Hide Post
Dan,

1. Yes, try adding a predicate that omits null values

2. Within Javascript, yes. However I would control it before it gets there because it's a lot easier.

Treat each fex for each combo differently. Something like -

-* Region fex
TABLE FILE LOOKUPS
  SUM FST.SALES_REGION
   BY SALES_REGION
WHERE SALES_REGION NE ''
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE PCHOLD FORMAT XML
END

-* Country fex
-DEFAULT &Region = 'FOC_NONE'
-* This variable will be the NAME attribute of your first combo
TABLE FILE LOOKUPS
  SUM FST.SALES_CNTRY
   BY SALES_CNTRY
WHERE SALES_REGION EQ '&Region'
WHERE SALES_CNTRY  NE ''
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE PCHOLD FORMAT XML
END

and you should be cookin'

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Guru
posted Hide Post
Tony,

Very clever. I did not realize you could pass a variable to a lookup procedure like that.

I'm still having a challenge. When I change the NAME attribute to the first listbox to &Region the PARAMETER for the control becomes Unassigned. If I set the parameter back to the Region field then the NAME attribute is reset. Seems like it wants to be one way or the other but not both. When it is unassigned I get 'An Element Is Missing An Argument'.

By populating the listboxes with separate procedures I also get this behavior: When the REGION listbox has ALL selected I see the COUNTRY list. As soon as I select a specific REGION, the COUNTRY list goes blank.

Thanks again,

Dan


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
 
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007Report This Post
Expert
posted Hide Post
Dan,

When you have ALL selected in Region, the value of FOC_NONE is passed to the subsequent retreivals in the chain, so the where clause becomes WHERE SALES_REGION EQ 'FOC_NONE' which is effectively ignored in the execution so you get all country values.

When you select a region value then that should be passed. The question is what value is being passed?

If you run the first fex interactively you should get two values for each XML node. Check that these are correct and then substitute one for the &Region value in the subsequent fex to see what is returned. My guess is that you have some values in there that are not valid?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Guru
posted Hide Post
Tony,

On their own, your lookup procedures are working perfectly. Just to be sure there wasn't an issue with any of the &Region values I ran the second one and pasted in each Region value from the first. Each time I got the proper response.

At least I've narrowed it down to the HTML Launch Page and the chaining. I'll play with the listbox controls and see if I can figure out why it won't work. Perhaps some characters (single quotes or something) are added to the value when it is passed to &Region.

Stay tuned...

Dan


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
 
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007Report This Post
Expert
posted Hide Post
Dan,

One way I check for what parameter value is being passed, is to run a standard fex that I have permanently set up called "showvars.fex". All this fex contains is "-? &". I change the launched fex and then just make the selection in the first combo in the chain, and run the report. The output will show me what value is being passed throughout the chaining. Compare this to the output of just running the combo population fex and the value should be the same. If it isn't then ...........

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Silver Member
posted Hide Post
Tony

I understand from your note that we can easily debug dropdown procedures , I mean what values are passing to the other dropdown.

Could you please tell what the "showvars.fex" contains...so that i can debug

Thanks,
Saikumar.


WebFOCUS 8103 Appstudio, Dev Studio MRE
Client Windows 7, Serveron Unix.
Excel, PDF, HTML,AHTML
 
Posts: 38 | Registered: January 24, 2008Report This Post
Gold member
posted Hide Post
Are you doing this in Dev Studio HTML Layout Painter? If you are, you can set the sort...however there is a bug where the second and subsequent sorts in a chain (like in your case) will still sort eroneousely (ie. sort within region). This will be fixed in HF 4 or ask them for the ibirls3.js file - refer to case 60532021...

I have it and it works great.


WF 8.2.01M
8.2.01M Reporting Server
Windows 2012 Srvr R2
PDF,Excel, HTML
Graphs - a lot of graphs
 
Posts: 60 | Location: Atlanta, GA | Registered: October 30, 2003Report This Post
Expert
posted Hide Post
Saikumar,
The contents are given in my previous post -
quote:
"showvars.fex". All this fex contains is "-? &".

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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     Sorting Listbox That Is Second In A Chain

Copyright © 1996-2020 Information Builders