Help with actions on select please

66 views
Skip to first unread message

TonyM

unread,
Mar 23, 2020, 6:35:49 AM3/23/20
to TiddlyWiki
Hi Folks,

I am using a select widget to set an input mode select-input and I would like the result of this selection to result in actions based on the option taken, ie set the input field

\define set-input-actions()
<$list filter="[{!!selected-input}match[allobject]]">
   <$action-setfield $field="input" $value="[!is[system]object-type{!!selected-object}]"/>
</$list>
<$list filter="[{!!selected-input}match[object]]">
   <$action-setfield $field="input" $value="[!is[system]object-type{!!selected-object}]"/>
</$list>
<$list filter="[{!!selected-input}match[list]]">
   <$action-setfield $field="input" $value="[!is[system]object-type{!!selected-list}]"/>
</$list>
<$list filter="[{!!selected-input}match[lists]]">
   <$action-setfield $field="input" $value="{{!!selected-lists}}"/>
</$list>
<$list filter="[{!!selected-input}match[filter]]">
   <$action-setfield $field="input" $value="{{!!selected-filter}}"/>
</$list>
\end

\define select-input()
<$select field=selected-input actions=<<set-input-actions>> >
<option value="allobject">All Instances of Object</option>
<option value="objects">Selected Objects</option>
<option value="list" >Use "a" list</option>
<option value="lists" >Input List{s}</option>
<option value="filter" >Input Filter</option>
</$select>
\end

<<select-input>>

Unfortunately the input field is never set. Are my conditions in the actions too much? or have I done something else wrong.

It is hard debugging actions because they are so invisible.

Any help appreciated
Tony

 

Xavier Cazin

unread,
Mar 23, 2020, 6:52:53 AM3/23/20
to tiddl...@googlegroups.com
Hi Tony,

The currentTiddler on which you rely in your <$action-setfield> widgets is changed by the <$list> widget. So I guess you need to set explicitly either the $tiddler attribute in your <$action-setfield>s or the variable attribute in the <$list>s.

Cheers,

-- Xavier.


--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/9e7283ea-3eec-4049-ba86-7e4a4d0c27e1%40googlegroups.com.

TonyM

unread,
Mar 23, 2020, 6:01:33 PM3/23/20
to TiddlyWiki
Xavier,

Thanks for spotting that. "A rookie error" as they say. I am grateful to have a community and for your help, because sometimes we j"ust cant see whats in our face".

I have added "variable=nul>" at the end of every list and it seems to work (further testing required).

Thanks a lot
Tony


On Monday, March 23, 2020 at 9:52:53 PM UTC+11, Xavier Cazin wrote:
Hi Tony,

The currentTiddler on which you rely in your <$action-setfield> widgets is changed by the <$list> widget. So I guess you need to set explicitly either the $tiddler attribute in your <$action-setfield>s or the variable attribute in the <$list>s.

Cheers,

-- Xavier.


To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.

TonyM

unread,
Mar 23, 2020, 7:51:17 PM3/23/20
to TiddlyWiki
Can an admin please mark this complete

I also volunteer for admin access.

Regards
Tony
Reply all
Reply to author
Forward
0 new messages