Hello myst..
As you've discovered, you can't insert a widget into the middle of a
filter. What you need to do is capture the index information you want
outside the <$list>, possibly via a <$set> widget, and then use value
inside of the <$list>. The following data and tiddler seems to work for me
--
With data set $:/Data/testme :
hind: 3
hind1: A
hind2: B
hind3: X
hind4: D
and tiddler testme:
\define mymacro(field)
<$set name="rows" value={{$:/Data/$(currentTiddler)$##$field$}}>
<$list filter="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 +[addprefix[$field$]]
+[first<rows>]" variable="idx">
$(currentTiddler)$
<tr><td>
<$edit-text tiddler="$:/Data/$(currentTiddler)$" index=<<idx>> tag=
"input" />
</td></tr>
</$list>
</$set>
\end
<<mymacro "hind">>
Good luck,
Mark
On Wednesday, June 7, 2017 at 4:05:51 PM UTC-7, [email protected] wrote:
>
> I have a table of text-edit fields. and a variable that determines the #
> of rows.
> All data is stored in a data tiddler. on first view, some indexes won't
> exist yet, so i can't do any fancy [indexes] filtering.
>
>
>
> <$list filter="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 +[addprefix[$field$]]
> +[first[<$transclude tiddler="$:/Data/$(currentTiddler)$"
> index="$field$"/>]]" variable="idx">
> <tr><td>
> <$edit-text tiddler="$:/Data/$(currentTiddler)$" index=<<idx>>
> tag="input" />
> </td></tr>
> </$list>
>
> What ends up rendering for me is:
> (field == 'hind' which has a value of '6')
> <$list filter="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 +[addprefix[hind]]
> +[first[6]]" variable="idx">
>
> but i clearly should not be seeing the tag, it should be getting rendered.
>
> as a result, <<idx>> renders once and contains the json string contentds
> of the Data tiddler.
>
>
> Is there a better way to do this? Am i missing something?
>
>
--
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/e96f269a-ac3d-4c92-b8f2-7d8d4c4695be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.