Or, to express it a different way from the subject line, how can I create a 
button widget that will:
a) take the current value of a tiddler field;
b) use that current value as a parameter to a macro to calculate a new value; 
and
c) put that new value back into the tiddler field that was read?

WHAT I TRIED:

I've tried various things; my most recent attempt is this:

<$button set=!!test setTo=<$macrocall $name=".js-macro-link" text={{!!test}}/> 
>Test button</$button>

However, the parser can't seem to handle the angle brackets of the macrocall 
widget appearing in the middle of the button widget declaration.  Everything 
after the "/>" that closes the macrocall widget appears as WikiText following a 
blank button.

Before that I tried calling the macro through the standard syntax, and 
discovered that (unless there's some way to do it that I missed) you can't use 
a macro call as an element attribute.

It occurred to me that since a ButtonWidget can contain multiple ActionWidgets, 
that might be the solution - except that there's nothing in the documentation 
guaranteeing an order in which such widgets execute, so assigning the output of 
a macro to a temporary tiddler and then copying it back to the original field 
does not seem to be an option.

PLEASE NOTE:

Please note that I am trying to get an answer to the GENERAL question, not "how 
do I get the same effect as if I was applying this particular macro?"  I am 
sure that there would be a simple way to apply the effect of THIS macro with 
template transclusion, but that does not answer my question, because sooner or 
later I will be using the technique for Javascript macros that do mathematical 
calculations.

DOCUMENTATION SUGGESTION:

A chart which shows the various forms of data sourcing (plain text, 
TextReference, macro output, etc.) in columns and then shows in rows what they 
can and can't be used for (macro parameters, element attributes, etc.) would be 
useful.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c6e201f0-c78e-465a-8677-1f3b423e291d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to