Hi Danielo

>  I didn't explained myself. I mean capture an event, react is some way
and then launch a different one.
> What if I want to react to a navigate event and navigate to that tiddler
too? For example for clear the search field after clicking a link. Maybe
using a button?

That makes sense.

Right now, as you've discovered, widgets that perform actions in response
to user interface input events are fairly restricted in what they can do:

* Emit a message
* Set a tiddler/field/property to a value
* Apply popup processing to a state tiddler
etc

All of the actions at the moment are "canned", without much flexibility. At
the other end of the spectrum, one can always write a JavaScript widget
that performs arbitrary logic. So we need to add some flexibility without
making a mechanism that is more complicated than just dropping down to
JavaScript.

For me, this suggests that any way of encoding action logic that resembles
a conventional program is on the wrong track; people might as well just
write JavaScript.

The present system of canned actions could be made more generic: the
presence of an attribute triggers the instantiation of a canned event
handler (which in some cases is parameterised).

So, one way of handling your initial question would be:

* Refactor <$linkcatcher> widget to be able to catch any message
* Refactor "action attributes" (ie set/setTo, message, navigateTo etc.) so
that they can be applied to all relevant widgets (including the generic
linkcatcher above)

Then your original example might be:

<$eventcatcher catch="tw-navigate" set="$:/search" setTo=""
message="tw-navigate></$eventcatcher>

Best wishes

Jeremy






On Wed, Apr 9, 2014 at 2:37 PM, Danielo Rodríguez <rdani...@gmail.com>wrote:

> Hello Jeremy
>
> I didn't explained myself. I mean capture an event, react is some way and
> then launch a different one.
> What if I want to react to a navigate event and navigate to that tiddler
> too? For example for clear the search field after clicking a link. Maybe
> using a button?
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywiki@googlegroups.com.
> Visit this group at http://groups.google.com/group/tiddlywiki.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jeremy Ruston
mailto:jeremy.rus...@gmail.com

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to