Dear Tobias,

Thank you for kindly taking the time to review this issue. I have quite 
literally spent the last 4-5 hours trying to get around this issue... in 
the process I learned a lot about customizing TW5, but ultimately felt 
defeated as I couldn't reason my way through the macro documentation to a 
solution.

I'm going to upgrade to the pre-release, and try out your recommendations 
tomorrow.

Your help is much appreciated

On Tuesday, 10 November 2015 00:18:56 UTC-8, Tobias Beer wrote:
>
> Hi aaron,
>
> There are a few issues here.
>
>    1. make sure not to confuse the terms widget and tiddler, i.e. there 
>    are no "draft widgets" in the sense you described it
>    2. you can't use the ViewWidget <http://tiddlywiki.com/#ViewWidget> in 
>    a macro like that
>       - the documentation would probably benefit from mentioning that
>       - 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>
>          - and to wrap your create button with all that to make the 
>          variable available to its scope
>       3. some examples for the SelectWidget 
>    <http://tiddlywiki.com/#SelectWidget> on tiddlywiki.com specify state 
>    tiddlers that are not system tiddlers, a pattern you adopted
>       - 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
>    4. there's a bug in the current release 5.1.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 thus 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
>
> Eventually, when all this is fixed and released, the SelectWidget 
> <http://tiddlywiki.com/#SelectWidget> documentation should show examples 
> of how to actually use a selected option, e.g. in a macro as you do, rather 
> than just show how it all writes some selected state to some state tiddler 
> and how we can display that somewhere else.
>
> 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/decc87a0-e17d-4f45-8755-47de8ce4a507%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to