# [tw5] Re: Presenting: field value selector

This might be a bit tricky to parse out of context, but this is one of my
macros for a field with a popup with previously used values. It accepts two
parameters, the first a field and the second the filter to use to get the
values.


\define editFieldPicker(field,filter)
<$edit-text tiddler="$(currentTiddler)$" field="$field$" focusPopup="$:/state/sqtc/new-puerh-form-$field$"
class="tc-popup-handle"/><$reveal state="$:/state/sqtc/new-puerh-form-$field$" type="nomatch" text=""
default="">
<div class="tc-block-dropdown">
<$linkcatcher to="$(currentTiddler)$!!$field$" > <div class="tc-dropdown-item"> <$list filter="$filter$">
<$button tag="a" class="tc-btn-invisible" to={{!!title}}><$view
field="caption">{{!!title}}</$view></$button>
</$list> </div> </$linkcatcher>
</div>
</\$reveal>
\end

<<editFieldPicker "sqtc-puerh-recipe"
"""[sqtc-type[puerh]each[sqtc-puerh-recipe]get[sqtc-puerh-recipe]search:title{!!sqtc-puerh-recipe}]"""

>>

On Saturday, June 27, 2020 at 4:36:04 PM UTC+2, Mat wrote:
>
> OGNSYA wrote:
>>
>> I tend to do a lot of field editing from other tiddlers though (for
>> example, using TiddlyTables, directly in the cells).
>> Would love for values to be suggested there as well...
>>
>> Any chance this can be implemented to work in any place where that field
>> can be edited?
>>
>
> Hm. I guess it could be made so that instead of calling the
> EditTextWidget, you called a custom macro that simply contains the
> EditTextWidget but also a call to the fieldvalueselector. But if
> TiddlyTables allows direct editing of cells, I assume this is done by
> calling the EditTextWidget... i.e you'd have to remake TiddlyTables so that
> it instead called this custom macro. Definitely doable but TiddlyTables is
> not my plugin - and you only mention TiddlyTables as one example,
>
> Maybe you should make a gh request that the EditTextWidget can natively
> show used values. There could be some flag in the widget. I think it makes
> sense.
>
> <:-)
>

--
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