Hi Mans
The set and setTo attributes of the button and maketid widgets have
'currentTiddler' as the default target. The setfield widget has
'currentTiddler' as the default target only in the absence of a parameter
to the calling 'tw-set-field' message and in the absence of a value for the
tiddler attribute.
Using the test code -- the setfield widget will target 'Target Two' (the
message parameter) whilst the button widget will target 'Target One'
('currentTiddler'.) The set and setTo attributes of the maketid widget
function the same way as those of the button widget -- adopting the
'currentTiddler' as the target. Neither the maketid nor the setfield widget
change the value of the 'currentTiddler' -- the target must be specified by
way of the calling event parameter or with the tiddler attribute (which
overrides the calling event param.)
<$tiddler tiddler="Target One">
<$setfield set="!!text" setTo="this is the text from the setfield widget">
<$button set="!!text" setTo="this is the text from the button widget"
message="tw-set-field" param="Target Two">Test</$button>
</$setfield></$tiddler>
Hope this clarifies.
regards
On Saturday, May 31, 2014 10:26:16 AM UTC+2, Måns wrote:
>
> Hi Matabele
>
>
>> Exercise caution when using the 'set=' and 'setTo=' attributes of the
>> <$button> and <$maketid> widgets in the same way as in the <$setfield>
>> widgets. The former do not target the value for the target propagated with
>> the 'param=' attribute by default, and in some circumstances will,
>> therefore, target a different tiddler.
>>
>
> Ok.
> Can you give me an example when it won't target the current tiddler or the
> tiddler being created?
>
> Cheers Måns Mårtensson
>
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.