Question
(Please excuse the confusing formatting in my original post.)
On a form, is it possible to have a field that is not directly entered by the user, but rather calculated?
Given a form definition that contains MyField:
| MyField |
label |
1 |
%MYFIELD% |
Whatever |
Now, in the doc that contains the form definition, if I do a
...when I save the form, MyField displays a value of abc.%br%
However, if I look at the raw data, what is actually stored is:
%META:FIELD{name="MyField" title="MyField" value="%MYFIELD%"}%
...that is to say, that Twiki saves the
formula (the variable to inherit from) and not the
actual value.
So the topic containing the form looks nice when viewed,
but if I include it, from a different topic, in a formatted search,
a $formfield(MyField) renders as %MYFIELD%, whereas what I want to show is abc.
Is there some way of doing this?
Environment
--
RalphEllison - 11 Jan 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Hm, I don't have an answer, but a kind of workaround. If you use the
%CALC{$SET(myfield,Some Value)}%
construct instead of
* Set MYFIELD = Some Value
within the topic with the form, containing the label
| MyField | label | 1 | %CALC{$GET(myfield)}% | Whatever | |
you get the actual value
Some Value of the 'variable'
myfield
when using
$formfield(MyField) in a formatted search which result contains that topic with the form.
Or maybe
AttachContentPlugin does what you really need, because IIRC the work-around above can't work in combination with (Set) variable settings.
--
FranzJosefSilli - 16 Jan 2007
Somewhat related:
HowToStoreSearchResultsInAVariable.
--
PeterThoeny - 17 Jan 2007
Closing after more than 30 days. Please reopen with more details if needed...
--
PeterThoeny - 02 Mar 2007