Hi David I wrote a number of widgets some time ago (before the introduction of Action Widgets) where parameters are passed up through a stack of widgets (stacked button widgets.) These may be found here. <http://gwiz.tiddlyspot.com/>
This mechanism is, however, cumbersome when compared with the Action Widget mechanism -- I would stick with Action Widgets for this functionality. You might also be interested in the example at the bottom of the 'keep Operator examples' tiddler, from the ActionListops widget wiki <http://listops.tiddlyspot.com/>. This makes use of a couple of additional filters, the cycle[] filter and the keep[] filter which aren't yet in the core. In this case, the buttons search the listed tiddlers for the first item matching a list of items in a reference list, then exchange this item for the next item in the reference list i.e. if the tiddler were 'tagged' with "red green blue", and the reference list were "red yellow orange green blue", the first click of the button would leave the tiddler tagged with "yellow", the second click with "orange", and the third click with "green". This is similar to your intended functionality. regards On Friday, 19 August 2016 15:30:21 UTC+2, David Someone wrote: > > Hi all, could I kindly ask for some help in adding fieldmangler / > action-sendmessage as a child widget to buttons? > > I've made a copy of buttons.js and I'm trying to put action-sendmessage in > the body of the code as a child widget. It's not firing the message up the > chain, however other child widgets are working. > > Example: > > If I do this in a tiddler: > > <$button> > Button! > <$fieldmangler> > <$action-sendmessage $message="tm-add-tag" $param="MyTag"/> > <$text text="chTxt"/> > </$fieldmangler> > </$button> > > I get a button which includes the child text widget: > > [Button!chTxt] > > and clicking it does add "MyTag" to the tiddler. > > However, if I modify the button widget itself (button2.js) to add these > same child widgets: > > var chWidgetsArray = []; > chWidgetsArray.push( > { type: "fieldmangler", > children: [ > { type: "action-sendmessage", message: "tm-add-tag", param: > "MyTag" }, > { type: "text", text: "chTxt" } > ] > } > ); > this.makeChildWidgets(chWidgetsArray); > > I get the right button (including the child text widget): > > [button!chTxt] > > but clicking it does not add the tag. > > I've futzed around by changing *message:* to *$message:*, by putting > either variation in an *attributes:* element, no luck. > > I've even commented out the line in buttons2.js that says "We don't > propagate messages etc." > > Any ideas what I'm doing wrong? > > Many thanks! > David. > -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikidev+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywikidev@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywikidev. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/4e36c6a5-1de3-42bd-9bb9-d66d80b4289f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.