Hi aaron,
There are a few issues here.
1. you can't use the view-widget in a macro like that as macros simply
do text-substitution, no (evaluation via) wikification
- what you need to use instead is to get the selected option and save
it into a variable using the SetWidget
<http://tiddlywiki.com/#SetWidget>
2. some examples for the SelectWidget
<http://tiddlywiki.com/#SelectWidget> on tiddlywiki.com specify state
tiddlers that are not system tiddlers
- this is a poor design choice as it pollutes the tiddler space
- any such state should be put either under *$:/temp/some-select*, or
at best: *$:/state/some-select*, never just *some-select*
- so, someone should update those documentation tiddlers
3. there's a bug in 5.0.9 <http://tiddlywiki.com/> where the set widget
won't refresh properly, so changing what's selected won't update any
variable assignments based on that
- this is fixed in 5.1.10-prerelease
<http://tiddlywiki.com/prerelease/>
- which brings me to how your example could / would / should actually
work...
- try the below out with the 5.1.10-prerelease
<http://tiddlywiki.com/prerelease>:
\define the-tags()
foo bar
\end
\define the-title()
$(currentTiddler)$ — $(selected)$
\end
\define create-new(title)
<$button>
<$action-sendmessage $message="tm-new-tiddler"
title=<<the-title>>
tags=<<the-tags>> />
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
{{$:/core/images/new-button}}
</$list>
</$button>
\end
<$select tiddler=<<qualify "$:/temp/select-profile">> default=''>
<$list filter='[tag[HelloThere]sort[title]]'>
<option value=<<currentTiddler>>><$view field='title'/></option>
</$list>
</$select>
<$set name="state" value=<<qualify "$:/temp/select-profile">>>
<$set name="selected" filter="""[<state>get[text]]""">
<<create-new>>
</$set>
</$set>
Trying this out has one more *core* problem which is that we do not have a
way yet to tell a filter to not return a string of "listified" titles but a
plain string. What does that mean? It means that if [<state>get[text]]
returns a title that has spaces in it, it will be returned as *[[the
title]]* instead of just *the title*... which obviously breaks your title
pattern in that you do not want any double square brackets in it.
A solution to the problem is proposed in this issue which it appears
crucial with respect to the usability of the *SelectWidget*:
*#2057 list accessors for variables and text references*
https://github.com/Jermolene/TiddlyWiki5/issues/2057
Best wishes,
— tb
--
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 http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/8a9f5345-34a5-4aa5-b5f0-1cf7e6101fcd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.