Question
Is it possible to expand variables in a
WebForm? The intended use is that I want users to be able
to select from dynamically generated lists when starting a topic. One example is the list of offices
which should appear as a pull down menu in
WebForms for equipment. At present, the list of Offices
would have to be updated in
TWikiRegistration and in each equipment
WebForm (while
OfficeLocations is easily modified to generate lists dynamically).
Here is what I have tried (
OFFICELIST and
TestOfficeList are essentially the search results as
variable and file, respectively):
| *Name* | *Type* | *Size* | *Values* | *Tooltip message* |
| DnsName | text | 25 | | DNS domain name(s) |
| Location1 | select | 1 | (Other: specify), %OFFICELIST% | usual/permanent location of equipment |
| Location2 | select | 1 | (Other: specify), %INCLUDE{"TestOfficeList"}% | usual/permanent location of equipment |
| Location3 | select | 1 | (Other: specify) %SEARCH{ "^Office" web="Main" scope="topic" regex="on" nosearch="on" nototal="on" format=", Main.$topic"}% | usual/permanent location of equipment |
In the view of the form itself, Location1 and Location2 show up correctly, while Location3 is not rendered
inside the table. When generating a topic using this form, all pulldown menus show the raw table entry
(i.e., macros are not expanded). Any comments/ideas?
Environment
| TWiki version: |
Feb 2003 |
| TWiki plugins: |
DefaultPlugin, CalendarPlugin, GnuSkinPlugin, InterwikiPlugin, TWikiDrawPlugin |
| Server OS: |
SuSE 8.2 |
| Web server: |
Apache 1.3.27 |
| Perl version: |
5.8.0 |
| Client OS: |
Redhat 7.2 |
| Web Browser: |
Mozilla 1.1 |
--
NilsBluemer - 10 Sep 2003
Answer
I had this very same issue and the answer is located in
HandleCommonTagsInFormDef. This details a very minor (two lines) code change to the FORMS.PM perl code. I just made it (we are running 01Feb2003) and it works as advertised (so far.)
--
SteveRJones - 12 Sep 2003