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 Summit 2007 HTML Lab Follow up

Read-Only Read-Only Topic
Go
Search
Notify
Tools
MAINTAIN Summit 2007 HTML Lab Follow up
 Login/Join
 
Master
posted
In the "Enhancing Maintain HTMLTables with HTML" Lab, there were 3 topics that required follow up. I am
putting the code for all 3 techniques in this forum. Please let me know if you have any questions or comments. Remember to set the Content Type of the field in the HTMLTable to 1 - HTML.

I. Radio Button Code

The code to include a Radio Button into the HTMLTable was omitted from the presentation. Here is the code:
  
Compute Stk(i).rbutton/a250 =
      "<input type=radio name=radiox " || I || " value='G'>G " |
      "<input type=radio name=radiox " || I || " value='NR'>NR " |
      "<input type=radio name=radiox " || I || " value='PG'>PG " |
      "<input type=radio name=radiox " || I || " value='PG13'>PG13 " |
      "<input type=radio name=radiox " || I || " value='R'>R " 
  Compute I=I+1;
Endrepeat

And you can preset the item you want by using the word CHECKED:
 
"<input type=radio name=radiox " || I || " value='NR' CHECKED>NR "

II. Dynamic List Boxes

The following code not only creates List Boxes, but populates them dynamically. The example uses the car file
and displays all cars by country:
 
MAINTAIN FILE car

$$Declarations

Case Top
for all next country into stk
compute stk.slist/a200;
compute i/i2=1;
compute j/i2=1;
compute q/a1 = "'";
repeat stk.foccount
  reposition country
  stack clear stk2
  for all next country car into stk2(2)
     where country eq stk(i).country;
  compute stk(i).slist = "<select name=list " || i || ">" 
  compute j=1;
  repeat stk2.foccount
  	   compute stk(i).slist = stk(i).slist ||
		 " <option value= " || q || stk2[j).car || q || ">" || stk2(j).car || "</option> " 
		compute j=j+1;
  endrepeat
  compute stk(i).slist = stk(i).slist || "	</select>"
  compute i=i+1;
endrepeat
Winform Show Form1; 
EndCase

case showme
compute i=1;
repeat stk.foccount
compute stk(i).sel/a10 = Form1.GetHTMLField('list' || I);
compute i=i+1;
endrepeat
endcase

END

III. Presetting List box values

Thanks to Tony A, we learned that adding 'selected' to the list box value pre-selects an item on a list box.
Tony, I owe you an hour of consulting Smiler. This example checks the value of the database and then dynamically presets this listbox.
 
compute x1/A10='';
compute x2/A10='';
compute x3/A10='';
compute x4/A10='';
compute x5/A10='';
compute x6/A10='';
if stk(i).rating = ' ' then compute x1='selected';
if stk(i).rating = 'G' then compute x2='selected';
if stk(i).rating = 'NR' then compute x3='selected';
if stk(i).rating = 'PG' then compute x4='selected';
if stk(i).rating = 'G13' then compute x5='selected';
if stk(i).rating = 'R' then compute x6='selected';
  Compute Stk(I).lbox/a250 = 
  "<select name=list " || I || ">" |
  "  <option value='  ' " || x1 || ">    </option>    "  |
  "  <option value='G'  " || x2 || "> G</option>    "  |
  "  <option value='NR' " || x3 || "> NR</option>  "  |
  "  <option value='PG' " || x4 || "> PG</option>  "  |
  "  <option value='PG13'" || x5 || ">PG13</option>  "  |
  "  <option value='R'  " || x6 || "> R</option>    "  |
  "  </select>"

Thank you to all of you that attended my sessions and labs. I hope to hear from you soon.

Mark Derwin
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Expert
posted Hide Post
Mark,

Comments eh? Just one to say that I thoroughly enjoyed your presentation and so relevant to a piece I am doing at the moment, thanks so much!

As for the hour, I'll settle for another couple of excellent ppts next summit - it appears that I have got the taste for them!!

T
 
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     MAINTAIN Summit 2007 HTML Lab Follow up

Copyright © 1996-2020 Information Builders