Jeremy,
One more point:
When the result of filter in the set widget is tiddlers with space in the
name like *My Tiddler*, the list widget return* [[My Tiddler]]* this cause
the code breaks. Note to [[]] in the result.
Based on your explanation I used the following syntax
\define nextItem(parent)
<$set
filter=*{{{** [tag[$parent$]after{!!temp}]}}}*
name=NewIndex
emptyValue='[tag[$parent$]first[]]'
>
<$action-setfield
$tiddler={{!!title}}
temp=<<NewIndex>>
/>
</$set>
\end
*No it works!* I mean the new code works even when the filter return [[My
Tiddler]]?
Is it the correct way?
/Mohammad
On Friday, June 29, 2018 at 11:46:26 AM UTC+4:30, Jeremy Ruston wrote:
>
> Hi Mohammad
>
>
> But if I directly set the emptyValue and I have used only one set widget.
> *But
> it does not work!!*
>
> \define nextItem(parent)
> <$set
> filter='[tag[$parent$]after{!!temp}]'
> name=NewIndex
> emptyValue='[tag[$parent$]first[]]'
> >
> <$action-setfield
> $tiddler={{!!title}}
> temp=<<NewIndex>>
> />
> </$set>
> \end
>
>
> <$button actions=<<nextItem "myTag">> >Next</$button>
>
> What is the problem? Why I have to use two set widegets?
>
>
> The problem here is that the emptyValue attribute of the set widget is
> interpreted as a string, not as a filter. So, rather than getting the
> results of the filter you'll get the text of the filter itself.
>
> Things should work if you add the triple braces filtered transcluded
> attribute syntax:
>
> \define nextItem(parent)
> <$set
> filter='[tag[$parent$]after{!!temp}]'
> name=NewIndex
> emptyValue={{{ [tag[$parent$]first[]] }}}
> >
> <$action-setfield
> $tiddler={{!!title}}
> temp=<<NewIndex>>
> />
> </$set>
> \end
>
>
> <$button actions=<<nextItem "myTag">> >Next</$button>
>
>
>
> The triple braces syntax can be used with any attribute: the attribute is
> assigned the first result from evaluating the filter.
>
> Best wishes
>
> Jeremy.
>
>
>
> /Mohammad
>
> --
> 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] <javascript:>.
> To post to this group, send email to [email protected]
> <javascript:>.
> 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/b4d6080c-3bcb-4d9a-a34b-421def0a6d82%40googlegroups.com
>
> <https://groups.google.com/d/msgid/tiddlywiki/b4d6080c-3bcb-4d9a-a34b-421def0a6d82%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
--
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/944ab7fb-c80e-46a4-b9bb-15a0da32b802%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.