[TW5] List widget (noob question)

107 views
Skip to first unread message

Bob Flandard

unread,
Oct 1, 2015, 7:07:21 AM10/1/15
to TiddlyWiki
Hello,

Evolena kindly supplied the following code for adding fields from a list in edit mode

<$list filter="[all[current]tag[some field]]">

field_name_2: <$select field="field_name_2">
<option value=''></option>
<$list filter="[tag[some field]each[field_name_2]get[field_name_2]sort[title]]">
<option>
<$view field="title"/>
</option>
</$select>
</$list>

It works just perfectly, but I'm puzzled by why the inner $list doesn't seem to be terminated by either a "</$list>" or "/>"

Any thoughts?

Thanks, Bob


Evolena

unread,
Oct 1, 2015, 9:08:17 AM10/1/15
to TiddlyWiki
Humm....

In [TW5] Tag dependant fields I provided you with this code:

<$list filter="[all[current]tag[some tag]]">

Field name 1:
<$select field="field_name_1">
<option value=''></option>
<option>
value 1</option>
<option>value 2</option>
<option>
value 3</option>

</$select>


Field name 2:
<$select field="field_name_2">
<option value=''></option>
<$list filter='[...(filter that selects the values)...]'>

<option
><$view field='title'/></option>

</$list>
</$select>


</$list>


And in [TW5] Filter syntax to list all values of a field I provided this snippet:

<$list filter="[tag[some field]each[field_name_2]get[field_name_2]sort[title]]">
<option>
<$view field="title"/>
</option>

</$list>

The closing </$list> is present in the two codes.

Bob Flandard

unread,
Oct 1, 2015, 10:24:04 AM10/1/15
to TiddlyWiki
Hello Evolena,

My fault completely. In my editing I lost a "</$list>". Then later when examining the code to try and understand how it works I was baffled by its absence (mostly because the code works the same without it).

Thanks for confirming that it should be there. I'm glad there isn't some rule that says "you don't need it if..."
It must be that Firefox has been forgiving of my foolishness.

All the best, Bob
Reply all
Reply to author
Forward
0 new messages