Thanks for the followup Eric, that is all working as expected. A very 
useful macro indeed!

bobj

On Sunday, 27 September 2020 at 08:28:01 UTC+10 Bob Jansen wrote:

> I apologise to the group because I emailed Eric directly instead of going 
> via the group. I attach the details of the conversation below for anyone 
> who is interested in using this very useful macro.
>
> *My initial query:*
>
> I am trying to use your edit-list macro. I can get the pop-up list to 
> display but when I select an item, its value is not stored in the field 
> I specified.
>
> <$macrocall $name="edit-list"
>                         field="exhibition_id"
>                         filter="[tag[Exhibitions]!tag[Index]]" />
>
> No matter what I do, the field, exhibition_id remains blank but the 
> pop-up goes blank a well after making the selection. The field is 
> defined on the tiddler showing the pop-up.
>
> Also, is there a way to display field data in the pop-up rather than 
> just the title?
>
> *Eric's first reply:*
> Although the documentation says that the tiddler param will default to the 
> currrent tiddler, this is not actually working at present.
> Until I can fix this, you can bypass the problem by explicitly including 
> "tiddler=<<currentTiddler>>" as a param.
>
> Also, if you want to display AND return a field value instead of a title, 
> then you can just add "get[fieldname]" to the filter param, where 
> "fieldname" is the field you wish to display and return.  Thus:
>
> <$macrocall $name="edit-list" 
> tiddler=<<currentTiddler>> field="exhibition_id"
>    filter="[tag[Exhibitions]!tag[Index]get[fieldname]]" />
>
> However, if you want to display field values instead of titles, BUT still 
> return the corresponding title as the selected value, use the "listview" 
> param, like this: 
>
> <$macrocall $name="edit-list" tiddler=<<currentTiddler>> 
> field="exhibition_id"
>    listview="{{{ [<value>get[fieldname]] }}}" 
> filter="[tag[Exhibitions]!tag[Index]]" />
>
> Note that the documentation for the edit-list macro currently not 
> finished.  I started to write it a while ago, but got sidetracked with 
> other projects.  Perhaps I can get around to completing it after I fix the 
> problem with the default value for the tiddler param.
>
> *Eric's subsequent followup reply:*
> I've just uploaded a fix for the tiddler param default to 
> <<currentTiddler>>.  You can get a copy of the updated 
> TiddlyTools/Macros/edit-list from
>
> http://tiddlytools.com/filtergenerators.html#TiddlyTools%2FMacros%2Fedit-list
>
> With this fix, you can now omit the "tiddler=<<currentTiddler>>" param and 
> just write:
>
> <$macrocall $name="edit-list" 
> field="exhibition_id"filter="[tag[Exhibitions]!tag[Index]]" />
>
> One important note: when the "target" tiddler for the input field is the 
> <<currentTiddler>>, typing into the text input causes the input to lose 
> focus as each character is typed.
>
> This is a known issue in the TWCore, and since my <<edit-list>> macro uses 
> the TWCore <$edit-text> widget, it behaves the same way.
>
> This caused by the way that the TWCore's "refresh" handler works: whenever 
> the value of a field in a tiddler is changed, the display of that tiddler 
> is automatically refreshed to reflect the updated value.  Thus, when the 
> $edit-text widget (or the <<edit-list>> macro) is displayed in the same 
> tiddler as the field that is being changed, it is also re-rendered, causing 
> it to lose focus.
>
> There are some work-arounds that are discussed here: 
> https://tiddlywiki.com/#EditTextWidget
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0a118acc-031c-4b67-a2b5-f64bf42b3418n%40googlegroups.com.

Reply via email to