On Feb 23, 9:58 pm, Dave <[email protected]> wrote:
> Here's what I've got so far (code inside a checkbox using Eric's
> CheckboxPlugin):
>
> [_(tag){}{alert("before
> tag")}{tiddler.set("AnotherTest","newBody","modifier","2013-02-23","onetag
> twotag","2013-02-23","fields","creator")}]
>
> trying to figure out from 
> here:http://tiddlywikidev.tiddlyspace.com/#Tiddler.prototype.set%28%29
>
> but what it does is create a tiddler called AnotherTest with nothing in it
> and no tags, and when I edit the original tiddler that had the above code,
> it turns into the "AnotherTest" tiddler that I was trying to create/modify
> (i.e. I screwed up my TW), but then I can no longer edit it.
>
> am I almost there, or totally off base?

To add a tag:
   store.setTiddlerTag("SomeTitle",true,"someTagValue");
To remove a tag:
   store.setTiddlerTag("SomeTitle",false,"someTagValue");

Each time setTiddlerTag(...) is called, it triggers a "notify" event
for the tiddler that has been changed, which causes re-rendering of
any content that is dependent on that changed tiddler.  If you are
setting/removing multiple tags in one section of programming, you may
want to temporarily block notification of changes so that re-rendering
can be deferred until all the tag changes are completed.

To do this, you can use code like this:
   store.suspendNotifications();
   store.setTiddlerTag(...);
   store.setTiddlerTag(...);
   store.resumeNotifications();
   store.notify("SomeTitle",true);

Note that, after resumeNotifications() is called, you should invoke
store.notify("SomeTitle,true) in order to re-render the current page
display to reflect any differences due to the changed tag values.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
   http://www.TiddlyTools.com/#Donations

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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to