Action on tab opening

162 views
Skip to first unread message

Danielo Rodríguez

unread,
Aug 27, 2016, 3:12:25 PM8/27/16
to TiddlyWiki
Hello again,

It's noticeable that I'm around here again, lots of threads about small questions that are almost impossible to find using the group search.

I know this has been discussed sometimes, but it was a while ago and make it is now possible.

What I want is to dispatch a message when a tab it's opened. In an ideal world it would be enough to just put an action widget inside that tab, but something makes me think that it will not work that way.

Any idea?

Thanks!

Tobias Beer

unread,
Aug 27, 2016, 3:56:44 PM8/27/16
to TiddlyWiki
Hi Danielo,
 

What I want is to dispatch a message when a tab it's opened.


Do you mean "call a web-service"?
 

In an ideal world it would be enough to just put an action widget inside that tab, but something makes me think that it will not work that way.


I would think there would have to be a widget to dispatch messages, which can be called e.g. via the button widget. Then there would have to be a way to extend the core tabs macro so that clicking a tab will trigger a set of action widgets, as you can do with a generic tab, some parameter perhaps universally called $action which points to a template defining the actions being run.

Best wishes,

Tobias.

Danielo Rodríguez

unread,
Aug 27, 2016, 4:00:51 PM8/27/16
to TiddlyWiki
Hello Tobias
 
Do you mean "call a web-service"?

No I mean a TW message, like the ones dispatched by the button widget or the action-sendmessage widgets. For example tw-new-tiddler
 

I would think there would have to be a widget to dispatch messages, which can be called e.g. via the button widget. Then there would have to be a way to extend the core tabs macro so that clicking a tab will trigger a set of action widgets, as you can do with a generic tab, some parameter perhaps universally called $action which points to a template defining the actions being run.


Of course a widget would be necessary to dispatch the message. Currently action widgets are limited to be inside of button widgets. It would be ideal if you can add a widget to the body of a tiddler, and when you navigate/open that tiddler (no matter if it is following a link or opening a tab) the action widget is executed. As I said, I think that someone did something of this kind, but I didn't found it.

Regards

PMario

unread,
Aug 27, 2016, 6:17:37 PM8/27/16
to TiddlyWiki
On Saturday, August 27, 2016 at 10:00:51 PM UTC+2, Danielo Rodríguez wrote:
No I mean a TW message, like the ones dispatched by the button widget or the action-sendmessage widgets. For example tw-new-tiddler

The tabs are buttons. So just change the tabs macro and add the action widget. So if someone clicks the tab, the action is activated.
If you want to set some parameters within the tiddler, use text references. ..

just some thoughts. no tests made.

-m

Jan

unread,
Aug 29, 2016, 6:34:23 PM8/29/16
to tiddl...@googlegroups.com
...you could use the Tab-state-tiddler for a reveal-function. That is no modal but at least something.
Greetings Jan
--
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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/348055af-cc91-4c6c-95b0-155785536a36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Danielo Rodríguez

unread,
Aug 30, 2016, 12:06:07 PM8/30/16
to TiddlyWiki


El martes, 30 de agosto de 2016, 0:34:23 (UTC+2), Jan escribió:
...you could use the Tab-state-tiddler for a reveal-function. That is no modal but at least something.
Greetings Jan

Hello Jan.

Thank you for the tip, but what I need is to trigger an action, in this case sending a message 

Mat

unread,
Aug 30, 2016, 4:07:09 PM8/30/16
to TiddlyWiki
On Sunday, August 28, 2016 at 12:17:37 AM UTC+2, PMario wrote:
The tabs are buttons. So just change the tabs macro and add the action widget. So if someone clicks the tab, the action is activated.

I hadn't realized this. Very good to know! Thanks PMario.


<:-)

Danielo Rodríguez

unread,
Aug 31, 2016, 3:22:17 AM8/31/16
to TiddlyWiki
Hello Mat,

thank you for your example.
I ended with something similar for another implementation.

My requirement for what I originally asked here does not allow me to change or override any core macro, so I can't implement my own tabs.

I still thinking we need a widget that acts on loading

Jed Carty

unread,
Sep 7, 2016, 3:26:30 PM9/7/16
to TiddlyWiki
A widget that acts on loading can put you into an infinite loop very easily. I made a plugin that triggers a set of action widgets on a change to the wiki. You can set what happens and what change is listened for. It isn't polished and the documentation is terrible, but here it is.

Danielo Rodríguez

unread,
Sep 7, 2016, 4:16:14 PM9/7/16
to TiddlyWiki
Thanks Jed,

I'll check it out

Reply all
Reply to author
Forward
0 new messages