As fred points out  <$action-setfield tags="tag1"/> is to set the whole 
tags field to tag1, obliterating any other contents.

Since tags can hold more than one tagname or title you must treat it as a 
list and use the actions designed for tags or use the listop actions. 
Unless of course you want "obliteration" of the tags field.

Regards
Tones

On Monday, 26 July 2021 at 11:55:21 UTC+10 [email protected] wrote:

> Hi Mohammad, can you expand a bit about the list you want to see? is this 
> just when you click the button?
> One issue is that the setfield will replace the example1 tag 
> with tag1. Did you mean to show the list only after the change happened, or 
> did you mean to *add *tag1 to the tiddlers that also have example1?
> If you want to add a tag, you would be better off using the <$action-listops 
> $tags="tag1"/> instead of <$action-setfield tags="tag1"/>
> This will get you part way there...
>
> <$button>refresh list and add tag 1
> <!-- clear the field -->
> <$action-listops $field="myfield" $filter="[[]]"/>
> <!-- populate the field -->
> <$list filter="[tag[example1]] [tag[example2]] [tag[example3]]" 
> variable="lister">
> <$action-listops $field="myfield" $subfilter="[enlist<lister>]"/>
> </$list>
> <!-- add tag1 -->
> <$list filter="[tag[example1]]">
> <$action-listops $tags="tag1"/>
> </$list>
> </$button>
>
> <!-- display the field -->
> <$list filter="[list[!!myfield]]">
>
> </$list>
>
>
>
> On Sunday, 25 July 2021 at 20:28:30 UTC-4 [email protected] wrote:
>
>>
>> Hi ,
>>
>> is it possible to assign an action to a button that would affect some but 
>> not all tiddlers listed in a filter 
>>
>> so for example, i want to add "tag1" to all tiddlers tagged with 
>> "example1"
>>
>> <$button> add tag 1
>> <$list filter="[tag[example1]]" >
>> <$action-setfield tags="tag1"/>
>> </$list>
>> </$button>
>>
>> but i also want to see all tiddlers tagged with  "example1", "example2" 
>> and  "example3"..
>>
>> i can modify the filter to add all tiddlers tagged with "example1" , 
>> "example2", "example3",  ... but then if i click the button the action will 
>> affect all tiddlers , so is there way to set an action against some 
>> tiddlers meeting a  certain criteria while keeping other tiddlers that 
>> don't  not matching the criteria on display?
>>
>

-- 
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/61de3786-e880-4481-8d6f-ce98bff62344n%40googlegroups.com.

Reply via email to