Hi,

I have some tiddlers tagged 'tracker' and each of those tiddlers has the 
following 4 fields:

tracker_current_value
tracker_target_value
tracker_start_date
tracker_end_date

In a separate 'dashboard' tiddler, I'm listing these tracker tiddlers based 
on their tag, so:

<$list filter="[tag[tracker]] +[sort[name]]">

The 'dashboard' tiddler also has a 'TrackerStatus' macro I wrote that needs 
the 4 fields from the 'tracker' tiddlers as parameters. What I'm trying to 
achieve is perform the calculation using the 'TrackerStatus' macro on 
button click next to each 'tracker' tiddler that's listed.

The result of the calculation should then be stored in a separate data 
tiddler with the name of the individual tracker tiddler as its index and 
the result of the macro calculation as its value.

With the code below, I'm able to correctly populate the data tiddler with 
the indexes (names of tracker tiddlers), however the values are not 
populated properly. I suspect the problem is that the individual 
fields/parameters (<$set name=.. value=..>) are not transcluded before 
being sent to the 'Updated_status' macro for evaluation because they're 
outside of the list filter where the individual 'tracker' tiddlers are 
listed. As a result, the would-be parameters are blank.

The transclusion of the fields works correctly when I embed it <$list 
filter="[tag[tracker]] +[sort[name]]">HERE</$list>.

Is there a way around this? I apologise if that's not clear, English is not 
my first language. I'll be happy to clarify if more info is needed.

Here's my 'dashboard' tiddler:

\define Updated_status()
<<TrackerStatus $(tracker_start_date)$ $(tracker_end_date)$ $(currentVal)$ $
(targetVal)$>>
\end

\define CurrentTiddler()
<<currentTiddler>>
\end

\define Button()
<$button class="button" tooltip="Refresh status">
<$action-setfield $tiddler="_data000" $index=$(CurrentTiddler)$ $value=$(
Updated_status)$/>⥁ Status</$button>
\end

<$set name=currentVal value={{<currentTiddler>!!tracker_current_value}}>
<$set name=targetVal value={{<currentTiddler>!!tracker_target_value}}>
<$set name=tracker_start_date 
value={{<currentTiddler>!!tracker_start_date}}>
<$set name=tracker_end_date value={{<currentTiddler>!!tracker_end_date}}>

<p class="blur_in">
<table style="width:620px">
<$list filter="[tag[tracker]] +[sort[name]]">
<tr>
<td>
<$link to={{!!title}}><$view field="title"/></$link>
<$list filter="[<currentTiddler>!days:modified[-3]]"> @@color:orange;^^probably 
needs updating^^@@</$list>
</td>
<td style="width:75px">
<$edit-text tiddler=<<currentTiddler>> field="tracker_current_value" 
rows="4" class="text-field"/>
</td>
<td>
<div>
<<Button>>
</div>
</td>
<td>
<$list filter='[[_data000]getindex<currentTiddler>]' 
emptyMessage="@@color:#cecece;(no data)@@">
<<currentTiddler>>
</$list>
</td>
</tr>
</$list>
</table>
</p>

Thanks in advance for your suggestions.


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d5bbd2fa-f647-40b7-85fc-5cd97454fa70%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to