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     Maintain and List Boxes

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Maintain and List Boxes
 Login/Join
 
Member
posted
Hello, everyone. I'm just starting to get my feet wet with Maintain and have numerous questions. So far, this forum has been able to answer many -- thank you all!

I have come across something I'm trying to accomplish that should surely be quite simple, but I've yet to find the solution.

I've got a table with around 400 records that I'm using to populate a series of nested list boxes. For example: In ListBox1 when you click on one of the three "Error Types", it then populates ListBox2 with the "Error ID" from the table that relates to the ListBox1 selection. Then when a result in ListBox2 is selected, I load the corresponding "Error Description" records into ListBox3. This process repeats until the user is able to finally drill down to a unique "Error Root Cause" in ListBox4. (Hopefully that made sense). I'm currently populating my stacks with WF procedures and the "EXEC procedure INTO stack" command.

What I'm looking to do is prior to loading these stacks with the data from the source table, I'd like to first load a record into the stack that reads "---" so it'll appear at the top of List Boxes by default indicating to the user to select their choice. Wihtout this "dummy" entry, by default the first record in the stack is highlighted and may cause some confusion to the user as they didn't select it.

I know I can add the "---" entries to the source database but I'd like to stay away from that as it would require additional table maintenance. I also think I could add the "---" to the .fex that's generating the results but, to me, it makes more sense to put it in the actual Maintain procedure.

Any help/hints would be appreciated.

Thanks,
Kelly


Kelly
WF 7.6.6, Win 2K3 SP2, Tomcat
 
Posts: 19 | Location: SLC, UT | Registered: January 19, 2007Report This Post
Master
posted Hide Post
Hi Kelly
This is very easy to do. What you want to do is start populating the stack at row 2 instead of row 1. However, there is an issue with the code, so we have to be a little creative. Here is the code:

INFER FIELDS INTO ERRORTYPESTK1 -* Real Stack
INFER FIELDS INTO ERRORTYPESTK2 -* Temp Stack
STACK CLEAR ERRORTYPESTK1 ERRORTYPESTK2 -* clear the stacks
EXEC TABLE INTO ERRORTYPESTK2 -* Get the data
STACK COPY FROM ERRORTYPESTK2 INTO ERRORTYPESTK1(2) -* Copy the data from temp stack into row 2 of real stack
COMPUTE ERRORTYPESTK1(1).FIELD1 = '---'; -* Compute place holder

That's is. Load all the data into a temp stack and then copy it into the real stack starting at row 2. Then you can compute anything you want into row 1 of the real stack. The only thing you can't do it load the data directly from the EXEC into stk(2). That would be the easiest way, but it blows up. Sorry. I hope this helps.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Platinum Member
posted Hide Post
Kelly,

Here is another way to do it if you don't want to have duplicate stacks:

Add an item to the top of a stack:

-** Increment the stack item count/
Compute stkExample.Foccount = stkExample.Foccount + 1 ;

-** Shift all the existing items down one, to make room for the new item
Repeat (stkExample.Foccount - 1) Cnt = stkExample.Foccount;
Compute stkExample(Cnt).Fieldname = stkExample(Cnt-1).Fieldname
Endrepeat Cnt=Cnt-1;

-** Setup default field value for the new item
Compute stkExample(1).Fieldname = 'Whatever' ;


I have a number of stack manipulation code examples Here for my reference but anyone else can use them too


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
 
Posts: 165 | Location: Detroit Metro | Registered: September 17, 2003Report This Post
Virtuoso
posted Hide Post
Or, as a 3rd way:

In the exec procedure, e.g. carstack, use rank:
TABLE FILE CAR
RANKED BY COUNTRY
ON TABLE PCHOLD
END

then in the maintain:

.
.
stack1.rank/i7;
stack1.country/a10;
.
.
EXEC carstack into Stack1;
x/i9=stack1.foccount+1
stack1(x).rank=0;
stack1(x).country='----------';
stack sort stack1 by rank;
.
.

then use country in a list box.
(always use the x computed value, not foccount+1 in its place, as reference to foccount increases its value)


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Member
posted Hide Post
Thank you all for the excellent suggestions. I've got it working perfectly.

Dave, that's great to see your personal site w/Maintain code. I've already bookmarked it.


Kelly
WF 7.6.6, Win 2K3 SP2, Tomcat
 
Posts: 19 | Location: SLC, UT | Registered: January 19, 2007Report 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     Maintain and List Boxes

Copyright © 1996-2020 Information Builders