follow up report:
Hi Matabele, your x-maketid widget, combined with Eric's suggestion (in
another thread) of macrocall turned out to be exactly what I needed:
<$button>
<$x-maketid $title="50m Freestyle" date=<<now YYYY-0MM-0DD>> tags="races"
text="\define event(what,when) <<races event:'$what$ $when$'>>
<$macrocall $name='event' what=<<currentTiddler>> when={{!!date}}/>"/>
new 50m Freestyle Race
</$button>
That allowed me to have a button that makes a tiddler with the race name
and this race table (macro):
\define races(event:"event")
[[$event$]]
<table>
<$list filter="[tag[swimmers]sort[title]]">
<tr><td><$link><$view field="title"/></$link></td><td><$edit-text tiddler=
'$event$' field={{!!title}}/></td></tr>
</$list>
</table>
\end
where I can input the results without the refresh problem seeing as the
tiddler being written to isn't the one that's newly opened (in view mode,
not edit mode (yay!))
On Tuesday, November 10, 2015 at 10:59:50 AM UTC-7, Matabele wrote:
>
> Hi Tobias
>
> The primary problem addressed by the $x-maketid widget is to do with the
> title of the new tiddler. A new tiddler requires a unique name, and this
> name gets generated only during the process of creating the new tiddler (by
> appending either a date/time stamp or an integer.)
>
> It is therefore impossible to write a button such as this with reliable
> results:
>
> <$button>
> <$action-sendmessage $message="tm-new-tiddler" title="My New Tiddler"/>
> <$action-setfield tiddler="My New Tiddler" field1="one" field2="two" .../>
> Create New Tiddler
> </$button>
>
> -- as the title of the new tiddler may not be 'My New Tiddler' (but may be
> something like 'My New Tiddler 1'.)
>
> It is therefore necessary to set all of the values for the new tiddler
> either within the widget itself or via other widgets stacked around this
> widget which 'know' the title of the new tiddler. The $x-maketid widget
> gives multiple options for setting the title, tags and other field values
> and, where this proves insufficient, passes the name of the newly created
> tiddler via the parameter to a message to one or more $x-setrefs widgets,
> stacked around the $x-maketid widget.
>
> The $x-maketid widget also allows for a new tiddler to be opened in edit
> mode (as for the tm-new-tiddler message), or created in the background (as
> for using an $action-setfield or set TextReference), or for navigating to
> the new tiddler in view mode.
>
> The $x-maketid widget also provides for appending a date/time stamp to the
> title (in any specified format), for journal type tiddlers.
>
> The $tags attribute of the widget allows for a subfilter to be applied to
> the list of tags copied from the template -- allowing tags to be
> added/removed/replaced etc.
>
> These features together, allow for multiple similar tiddlers to be created
> reliably with successive clicks of the same button. This was a feature I
> required when populating folders for my version of GTD -- in this case, I
> wished to create a number of tiddlers in succession, the titles for which
> were contained in a list (in a data index.)
>
> Any other desired functionality can be easily added via additional
> attributes -- something that would be more difficult with the
> 'tm-new-tiddler' method.
>
> In general, I also find the action widget method more straightforward and
> more easily understood than methods based around widget messaging.
>
> regards
>
> On Tuesday, 10 November 2015 19:24:58 UTC+2, Tobias Beer wrote:
>>
>> Hi Matabele,
>>
>> As Jeremy says:
>>
>>
>>> I think people have successfully used the action-setfield widget to
>>> create new tiddlers silently. Not of course as flexible as Matabele’s
>>> widget.
>>>
>>
>> Could you perhaps provide a quick overview of some of the features of or
>> implementations based on your maketid action widget you would find most
>> prominently missing as compared to using the core action-setfield?
>>
>> 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/d776e49b-c431-42f3-a023-8e5632f1bbf9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.