I would do it using three template sections, something like this.

/$selectBegin
<select size="1" name="WF_SiteID">
/$selectOption
 <option value="/%WF_Site_A%/">/%WF_Site_B%/</option>
/$selectEnd
</select>


Then in the program I would do something like this.

/Free
 WrtSection('selectBegin');
 Read file;
 Dow not%eof(file);
  SetVarVal('WF_Site_A':fileField1);
  SetVarVal('WF_Site_B':fileField2);
  WrtSection('selectOption');
  Read file;
 EndDo;
 WrtSection('selectEnd');
/End-Free

Joe Lee

>>> carolla@xxxxxxxxx 10/28/2004 09:57:18 >>>
I am trying to populate a <select> list with <option> values.  Within
the HTML template, I have the following:

<select size="1" name="WF_SiteID">
     /%WF_Sites%/
</select>

Inside the pgm, I set up a VARYING variable, and I am populating it
with each selection item using a DS:

D OptLn           DS                  Qualified
D  Chunk1                       15A   Inz('<option value="')
D  Site                          3A   Inz(*Blanks)
D  Chunk2                        2A   Inz('">')
D  SiteS                         3A   Inz(*Blanks)
D  Chunk4                        9A   Inz('</option>')

Each record in the file populates the two site fields in the DS, and
the DS gets added to the VARYING variable.

I then use UpdHTMLVar with the VARYING variable:

CallP updHTMLvar('WF_SITES':SelectOpts:InitHTMLVars);

The problem is that apparently, there is a max of 999 on a variable
length that gets sent to the web server.  The statement that replaces
the /%WF_Sites%/ variable always gets cut at 999.

Other solutions I have thought of:
  -Create 100 or so separate variables in the template, and within
the RPG, use a horrendously large select op to pin each successive
record into one of the templates (yukkk)
  -Use some other CGIDEV2 proc.

Has anybody else run into this?


-- 
"Enter any 11-digit prime number to continue..."
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx 
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l 
or email: RPG400-L-request@xxxxxxxxxxxx 
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.