Edit-text but not real time

I have the need to enter in text using the edit-text widget, but i don’t want it to update the procedures that are based on it until I hit a button. So, for example, it would be like typing in search terms into a field, but not doing the search until I press the search button.

Is this possible in TW?

G’day,

Setup the text widget so the value goes into the field of some temporary tiddler.

Setup the button with an action that copies the value from that temporary tiddler to whatever tiddler is referenced by your filter.

This tiddler does something similar, using the value from the edit text field to create a tiddler when the button is pushed.

That does seem to work, except I’m running a transclude macro right after this and it seems like the transclude macro isn’t picking up the new fields. If I do the search again without changing anything, then the new fields are used.

<$button class="rounded border border-gray-300 border-solid px-2 py-1">
    <$action-setfield keyword={{$:/temp/keyword}}/>
    <$action-setfield category={{$:/temp/category}}/>
    <$transclude $variable="getjson" url={{!!keyword}} category={{!!category}}/>
    Search Icons
</$button>

It will get the last value of keyword and category, run the transclude stuff and display the results. If I click on the button again, then it will display the correct results.

Put your $action-setfield widgets inside an action=... parameter of the $button. This will defer fetching the temp values until the button is actually pressed. Like this:

<$button class="rounded border border-gray-300 border-solid px-2 py-1"
    actions="<$action-setfield keyword={{$:/temp/keyword}} category={{$:/temp/category}}/>">
    <$transclude $variable="getjson" url={{!!keyword}} category={{!!category}}/>
    Search Icons
</$button>

Note also that the keyword and category values can both be set using a single $action-setfield widget.

-e

That is very helpful, thanks.

BTW, I gotta be more careful with the $action-setfield widget. I just wiped out my whole tiddler…dang. When I rewrite it I’ll try and implement both your suggestions. :slight_smile: