I've created a ViewTemplate that adds a table of editable metadata to any tiddler with the tag "Book". Here is a simplified example:
<$list filter=[all[current]tag[book]]>
|Book title|<$edit-text field=book-title />|
|Author|<$edit-text field=author />|
</$list>
Now I intend to set the title of these tiddlers to something like {!!book-title} - {!!author}. But I'd rather not do it manually, so I thought maybe I could use an action widget to automatically set the title as the fields are being edited:
\define actions()
<$action-setfield tiddler=<<currentTiddler>> title={{{ [{!!book-title}addsuffix[ - ]addsuffix{!!author}] }}}/>
\end
<$list filter=[all[current]tag[book]]>
|Book title|<$edit-text field=book-title inputActions=<<actions>> />|
|Author|<$edit-text field=author inputActions=<<actions>> />|
</$list>
Anyway you more enlightened folks will immediately see that this won't work, because the action-widget will create a new tiddler rather than edit the title of the current one.
So I'm wondering if there are any clever workarounds here? (I would also be happy with a button to set the title based on fields, but this approach seems to suffer from the same problem.)
Thanks in advance for your help.