David,

The list widget by default changes the currentTiddler value for each title 
it generates.
In you code you are trying to look at the fields in each of the tiddlers 
the filter finds.

<$list filter="[tag[Task]!tag[Done]]" *variable=currentTiddler*>
<$reveal type="match" state="!!edit_priorities" text="1">
<$edit-text field="priority" size="3" />
</$reveal>
<nobr> <$checkbox tag="Done"/> <$link>{{!!title}}</$link></nobr>
<br/>
</$list>
In bold is what the default is without giving it.

Now if you do not need to use the lists titles inside the list widget use 
another variable
*variable=nul* is what I use if the code does not use the title, however if 
it did it could use 
<<nul>>

A Quick look at your code suggests it is all you need to make it wok
<$list filter="[tag[Task]!tag[Done]]" *variable=nul*>
<$reveal type="match" state="!!edit_priorities" text="1">
<$edit-text field="priority" size="3" />
</$reveal>
<nobr> <$checkbox tag="Done"/> <$link>{{!!title}}</$link></nobr>
<br/>
</$list>

Basically it is a simple convention If I don't use the variable in the list 
statement I call it nul, or If I do use the list result I chose a 
meaningful name lets say list-item
Most widgets then let you specify 
tiddler=<<list-item>>
or in another parameter

By using the variable= the shorthand ways such as 
{{!!fieldname}}
Continue to work.

Did you know if you allow the currentTiddler to change while listing a 
number of tiddlers there are other short cuts
{{||$:/core/ui/Buttons/edit}} will give you an edit button for the current 
tiddler.

Regards
TW Tones




On Saturday, July 11, 2020 at 12:00:52 AM UTC+10, David wrote:
>
> I am looping over some tiddlers with the ListWidget.
>
> I was using the variable attribute, but have removed that to access 
> fields directly (via {{!!fieldname}} type calls, and for best practice 
> reasons, etc.
>
> But I need to know  how to refer to the parent tiddler's field (not the 
> child's) in a reveal's state attribute.
>
> This (the "!!edit_priorities" state, which refers to a field in the 
> parent tiddler) used to work when the filter was using the item variable, 
> but needs some tweaking now, because the "scope" it's in has changed to the 
> child tiddler (I assume).
>
> <$list filter="[tag[Task]!tag[Done]]" >
> <$reveal type="match" state="!!edit_priorities" text="1">
> <$edit-text field="priority" size="3" />
> </$reveal>
> <nobr> <$checkbox tag="Done"/> <$link>{{!!title}}</$link></nobr>
> <br/>
> </$list>
>
> So, in words, what I'm trying to do is list todo tasks that are not tagged 
> as done.  In that tiddler as well is a field, which I use to control the 
> display of the Priority edit boxes.  If I set that field to '1', then I 
> want the reveals to show the edit boxes for each task.
>
> Thank you!
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/46d874be-f3e9-49b3-869c-32e55653520bo%40googlegroups.com.

Reply via email to