ButtonWidget Ignores all parameters except param and message with message tm-open-window

In my testing, the Button Widget Ignores all parameters except param and message when using message tm-open-window

My guess is that it ignores parameters for other messages as well. Is this expected behaviour ?

I’ve tried multiple $param/param versions of the following, and it refuses to acknowledge the template or the window title:

<$button message="tm-open-window" param="$:/demo/openme" template="$:/demo/openme/template" something="isnt nothing" windowTitle="huh">Open Window
</$button>
1 Like

Instead of using parameters in the $button widget, use a separate $action-sendmessage widget, like this:

<$button>Open Window
<$action-sendmessage $message="tm-open-window" $param="$:/demo/openme"
   template="$:/demo/openme/template" something="isnt nothing" windowTitle="huh" />
</$button>

Note that the $action-sendmessage uses $message and $param instead of message and param.

enjoy,
-e

1 Like

Hi Eric. I’m trying to determine if the parameters should work with the button directly, with an eye towards correcting documentation. The documentation for tm-open-window explicitly mentions using the ButtonWidget, but not the Actionsendmessage widget.

As written, some variation of the button should work with the message, right?

All of the WidgetMessage* tiddlers are written from a JavaScript point of view and that note about the ButtonWidget just seems like it is copied and pasted from elsewhere. To specify the additional parameters you need $action-sendmessage.

I wish we could deprecate the message attribute for the $button widget, to have one standardized way of sending messages from wikitext.

It makes sense with tm-new-tiddler providing additional parameters in the sendMessage widget, but the documentation does not mention this for a generic send message, not does it explain how you access and make use of these additional variables. It is also implied in the ## WidgetMessage: tm-modal

@Mark_S I think the problem with using the additional message parameters (in addition to param) in a button is the possibility of the message parameters conflicting with those used for the button widget.

Perhaps it need not be the case, but as I understand it the message parameter on the button is a convenience to make use of the on click of the button widget to trigger simple messages. Consider a parameter in the button for class, style or tag etc… these need to apply to the button, not the message. Ie the parameters apply to message and button.

In another thread I criticise insufficient documentation for message catcher and even catcher widgets for users and designers. There is assumed knowledge and reading between the lines needed. In fact I think those with deeper HTML/Javascript knowledge can see the sense in these widgets but the tiddlywiki user is left in the dark.

I believe “message catcher and even catcher widgets” may actually provide the method for extended message parameters rather than “overloading” the button widget further. But these need user documentation and examples.

I would go even further and would move the action-widget outside the <$button widget body like this

\define myActions()
<$action-sendmessage $message="tm-open-window" $param="$:/demo/openme"
   template="$:/demo/openme/template" something="isnt nothing" windowTitle="huh" />
\end

<$button actions=<<myActions>> >Open Window</$button>

Which makes it sure, that all parameters that are used in myActions are evaluated on button click. Params inside the button widget are evaluated, when the button is rendered. … Sometimes this can result in strange behaviour. …


The button widget was created as one of the very first widgets in the tiddlywiki5 development cycle. …

It was overloaded with a lot of functions, when they where needed. New parameters where added if needed and so on … In the end it turned out to be a “black box mess”…

That’s why it has so many different and inconsistent parameters. Depending on the functionality needed different parameters have to be assigned and other don’t matter at all.

So from my point of view the button widget is used, for production, as described here.

1 Like