Brilliant!  Always learning something new.  Never heard about the $:/temp 
thing before.
Thanks,
Matt

On Thursday, September 3, 2015 at 5:19:34 PM UTC-4, Eric Shulman wrote:
>
> On Thursday, September 3, 2015 at 12:52:02 PM UTC-7, Matthew Lauber wrote:
>>
>> Hey All, I've got a unusual request.  I've created a list filter 
>> 'shuffle' that randomizes the order of a list.  Each time it's rendered the 
>> list changes.  Combining this with a 'first' I can get a random subset of 
>> the list (think choosing 10 random character names).  But unfortunately, I 
>> haven't been able to come up with a fully satisfactory way to refresh the 
>> list.  Ideally, I'd like to be able to click a button and repaint the 
>> tiddler, without it being treated as if the data changed (because it 
>> hasn't)  I've gotten a button working with the following code, but every 
>> time it's clicked, the tiddlywiki thinks it needs to be saved.  Can anyone 
>> think of a better way to handle things?
>>
>> <$button>
>> <$action-sendmessage $message="tm-edit-tiddler" />
>> <$action-sendmessage $message="tm-cancel-tiddler" $param="Draft of 
>> 'Names'" />
>> Refresh
>> </$button>
>>
>
> One way to force a refresh of some content is to make it dependent on a 
> tiddler value by wrapping it inside a <$set>...</$set>, like this:
> <$set name="trigger" value={{$:/temp/trigger}}>
>    *** your content here ***
> </$set>
>
> Then, write a button that changes the $:/temp/trigger value, like this:
> <$button>
> <$action-setfield $tiddler="$:/temp/trigger" $value=<<now "0hh:0mm:0ss">
> >/>
> refresh trigger
> </$button>
>
> By setting the trigger text to the current time, the value of the trigger 
> changes each time you press the button.  This, in turn, triggers the 
> refresh of the dependent content.  Note that, by using $:/temp/... to store 
> the trigger, it will avoid marking the document as "dirty" (in need of 
> saving).
>
> enjoy,
> -e
> Eric Shulman
> ELS Design Studios
> TiddlyTools - "Small Tools for Big Ideas!"
> InsideTiddlyWiki: The Missing Manuals
>
> YOUR DONATIONS ARE VERY IMPORTANT!
> HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
>    http://TiddlyTools.github.com/fundraising.html#MakeADonation
>
> Professional TiddlyWiki Consulting Services...
> Analysis, Design, and Custom Solutions:
>    http://www.TiddlyTools.com/#Contact
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/ed3cde10-dae2-4755-b35e-e10d547c9735%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to