> please have a look at thishttp://classrecords.tiddlyspot.com/#Test01.
> This tiddler is populated by fields dynamically created by a script in
> its aTestEditTemplate. these fields are supposed to be displaying
> their values here in the view mode, as defined by the
> aTestViewTemplate. But for some reason the value is not being
> displayed, although the fields and their values are there.
In [[aTestEditTemplate]] you wrote:
<span macro='tiddler ViewStudentsPerformance'></span>
where [[ViewStudentsPerformance]] contains an inline script that
generates the output.
As a simple test, I did this:
* create a tiddler [[AA]] containing just:
<<view title>>
* displays: AA
* create another tiddler, [[BB]] containing:
<<tiddler AA>>
* displays: AA
ah hah! When transcluded, it appears that the core's <<view>> macro
always refers to fields in the *originating* tiddler, rather than the
*containing* tiddler.
Although this might seem like a core bug, it's too risky to change the
behavior of this essential core function at this late date, as any
change in how this macro currently works could potentially have a
disasterous impact on existing uses.
Fortunately, there is an alternative to using <<view>> that *does*
have the ability to reference fields in *any* specified tiddler:
http://www.TiddlyTools.com/#WikifyPlugin
For your purposes, you would output something like:
<<wikify [[%0]] h...@fieldname>>
where 'here' is a literal keyword that invokes
story.findContainingTiddler() to find the current *containing*
tiddler, and 'fieldname' is whatever field you want to show.
Thus, in the script in ViewStudentsPerformance, you would write:
out.push('|'+enrolled[i].title+'|<<wikify [[%0]] @marks'+enrolled
[i].title+'>>|<<wikify [[%0]] @grade'+enrolled[i].title+'>>|');
enjoy,
-e
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---