Error in macro <<tabs>>

20 views
Skip to first unread message

tigger6333

unread,
Jan 20, 2008, 9:26:27 PM1/20/08
to TiddlyWiki
I have a tiddler conataining the following code:

<<tabs ListOfTabs
"School" School "ListSchool"
"Home" Home "ListHome"
"Done" Done "ListDone"
>>

It gives the following text in a red box:
Error in macro <<tabs>>

Which when I click on it reveals:
Error while executing macro <<tabs>>:
TypeError: s has no properties

I am unable to see what the problem is.
Is anyone able to help me decipher this message?

Cheers
a grateful beginner
Tigger

tigger6333

unread,
Jan 20, 2008, 9:53:10 PM1/20/08
to TiddlyWiki
Further information:

I made just 1 tab. It still got the error.
The tab called the ListSchool tiddler.
Inside this tiddler I had
<<newJournal 'YYYY.MM.DD (hh.mm.ss)' label:"Adding School" focus:title
tag:SchoolList >>

When I deleted this, the error message disappeared. If I put in just
text instead of the above code, the tab works fine with no error
message.

I have no idea what is happening.
Does anyone else?

Cheers
Tigger

Eric Shulman

unread,
Jan 20, 2008, 9:56:50 PM1/20/08
to TiddlyWiki, ho...@unamesa.org, elsd...@gmail.com
> Error while executing macro <<tabs>>:
> TypeError: s has no properties
> I am unable to see what the problem is.
> Is anyone able to help me decipher this message?

You really need to provide a bit more basic info to get the ball
rolling:

* What version of TiddlyWiki are you using and where did you get it?
* What plugins (if any) have you installed?
* What browser and system are you using?
* Does the problem happen on other systems or browsers?
* Describe exact step-by-step methods (or code examples) to reproduce
the problem.
* Reduce the problem to the smallest number of variables: try things
in an EMPTY TiddlyWiki... does it still break?
* Otherwise, start adding in plugins, one at a time, until something
breaks (assuming the problem is caused by a plugin).
* Whenever possible, put your document online somewhere so others can
debug the actual problem without needing to recreate it themselves.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios


tigger6333

unread,
Jan 20, 2008, 11:06:39 PM1/20/08
to TiddlyWiki
ok...sorry for not including this information at first.

1) TiddlyWiki version 2.3 downloaded as empty.html from http://www.tiddlywiki.com/
2) Installed plugins:checkBoxplugin, forEachTiddlerplugin
3) Running FireFox 2.0.0.11 on winXP SP2 laptop.
4) This happens on my wife's desktop xp machine, and in IE
5) Reloaded into an empty tiddlywiki, the problem happens ( But this
time a different message! Maybe the
newer version of empty.html affected this? The new message is
<<forEachTiddler ...>>: TypeError: t.tags.find is not a function
so this looks like a syntactical error on my part?
6)The file can be found online at http://members.bbnet.com.au/~kwright/toDoLink.html

I will continue to investigate what I have done wrong. Thanks for the
tips so far.
I appreciate you helping me to learn.

Cheers
Tigger

Eric Shulman

unread,
Jan 21, 2008, 2:28:09 AM1/21/08
to TiddlyWiki
> 2) Installed plugins:checkBoxplugin, forEachTiddlerplugin
> http://members.bbnet.com.au/~kwright/toDoLink.html

The versions of both the plugins you've installed are incredibly out-
of-date!!

Your copy of CheckboxPlugin is v2.1.3 (2006.05.04), while the current
version is v2.4.0 (2008.01.05). In the intervening 18 months (!!),
there were lots of plugin code changes... some of which were needed to
maintain compatibility with updated core code.

Get the current version here:
http://www.TiddlyTools.com/#CheckboxPlugin

Your copy of ForEachTidderPlugin is v1.0.6 (2006.09.16), while the
current version is v1.0.8 (2007.04.12). Although not updated as
recently as CheckboxPlugin, the version you have installed is still
nearly 7 months out-of-date.

Get the current version here:
http://tiddlywiki.abego-software.de/#ForEachTiddlerPlugin

HTH,

tigger6333

unread,
Jan 21, 2008, 5:07:41 AM1/21/08
to TiddlyWiki
Thanks for the advice.
I upgraded those plugins, made some slight adjustments to the
script ( thanks to TiddlypackingList)
and it worked!! BUT...

After I saved it and reloaded the page, the checkBox was then broken.
This was after it was working fine.
I have uploaded the latest toDoList tiddly to
http://members.bbnet.com.au/~kwright/toDoLink.html
and would appreciate any ideas as to why it would suddenly stop
working, displaying instead of
a checkbox, this text "21.1.2008 (18.50.54):ok)]" where the checkbox
should be (and was before!)

Thanks from
A hopeful Tigger

Eric Shulman

unread,
Jan 21, 2008, 5:52:33 AM1/21/08
to TiddlyWiki
> I upgraded those plugins, made some slight adjustments to the
> script ( thanks to TiddlypackingList)
> and it worked!! BUT...

... and I notice you added another OLD version of one of my plugins!

Please get the correct, up-to-date version of:
http://www.TiddlyTools.com/#InlineJavascriptPlugin

Sometimes changes in the TW core require matching adjustments in the
plugin code. As a general rule to ensure compatibility, you should
always install the latest version of a plugin from that plugin's
official distribution site (e.g., TiddlyTools, Lewcid, Abego, etc.).

> After I saved it and reloaded the page, the checkBox was then broken.
> This was after it was working fine.

I'm not sure why it was "working fine" before. As written, it should
never have worked. This is because you are using a tiddler title that
contains "(" and ")" and the syntax for the checkbox already uses
parentheses itself as delimiters around the 'target', e.g.:
[x(title:tag)]
Your tiddler titles result in invalid 'nested' use of parentheses:
[x(title with (parentheses) in it:tagname)]

Fortunately, CheckboxPlugin offers an alternative *macro* syntax that
doesn't use the parens as delimiters:
<<checkbox [[title:tag]]>>
which will properly process:
<<checkbox [[title with (parens) in it:tagname]]>>

Try this in your document:

Change [[SchoolList]] (and the other *List tiddlers), so that this
line:
write '"|[X("+tiddler.title+":ok)]|[["+tiddler.title+"]]...
reads:
write '"|<<checkbox [["+tiddler.title+":ok]]$))|[["+tiddler.title
+"]]...

tigger6333

unread,
Jan 21, 2008, 6:22:09 AM1/21/08
to TiddlyWiki

> ... and I notice you added another OLD version of one of my plugins!
>

<sheepish grin> Yes. I am definitely on a very steep learning curve.


> Try this in your document:
> write '"|<<checkbox [["+tiddler.title+":ok]]$))|[["+tiddler.title
> +"]]...

Have done and yes, it is working nicely!
Thanks oh great javascripting tiddly guru!!!

http://members.bbnet.com.au/~kwright/toDoLink.html
now contains the working version, with appropriate plugins.

I am now working on how to get the tabs to refresh once the checkbox
is clicked,
because at the moment the tab needs to be closed then reopened for any
changes to take effect.

Once again, thanks for the super advice/help.
Cheers
Tigger

Eric Shulman

unread,
Jan 21, 2008, 7:19:48 AM1/21/08
to TiddlyWiki
> I am now working on how to get the tabs to refresh once the checkbox
> is clicked,
> because at the moment the tab needs to be closed then reopened for any
> changes to take effect.

Try just clicking on that tab's *label* again. This causes the tab
*contents* to be re-rendered.

or... try this script:
http://www.TiddlyTools.com/#RefreshTiddler
Usage:
<<tiddler RefreshTiddler>>
which can be used to embed a "refresh" command link directly in the
tiddler, so that you can click to manually refresh the display

or, this script:
http://www.TiddlyTools.com/#AutoRefresh
Usage:
<<tiddler AutoRefresh with: force>>
embed the above line in the tiddler containing the tabs. Whenever ANY
tiddler is changed in the document, the tabbed tiddler's display is
automatically refreshed, ensuring that it will always be in sync with
any underlying tiddler content derived from other tiddlers.

tigger6333

unread,
Jan 21, 2008, 6:31:07 PM1/21/08
to TiddlyWiki
Thanks Eric. Some great advice.
Clicking the tabs label again does refresh the tab correctly. But
this
appears to be counter intuitive. Once the checkbox is clicked the item
should move to the
correct tab with no more user input. this also applies to your second
suggestion
of adding a button.

Your third suggestion is the most suitable but I can't get it to work.
I imported the autoRefresh script from http://www.tiddlytools.com
and added the <<tiddler AutoRefresh with: force>> to the end of
the tabs making tiddler. Then I reload the Tiddlywiki to ensure the
autoRefresh has been loaded. Then I click a checkbox. What should
happen is the item is moved to a new tab (which it does if I click on
the
actual tab) but it appears the autoRefresh does not do what it
is supposed to.

Thanks from a puzzled but grateful
Tigger

Eric Shulman

unread,
Jan 21, 2008, 7:36:58 PM1/21/08
to TiddlyWiki
> Your third suggestion is the most suitable but I can't get it to work.
> I imported the autoRefresh script fromhttp://www.tiddlytools.com
> and added the <<tiddler AutoRefresh with: force>> to the end of
> the tabs making tiddler. Then I reload the Tiddlywiki to ensure the
> autoRefresh has been loaded. Then I click a checkbox. What should
> happen is the item is moved to a new tab (which it does if I click on
> the
> actual tab) but it appears the autoRefresh does not do what it
> is supposed to.

Ah! ... for reasons too subtle to go into here, the *macro* form of
the checkbox syntax does not automatically refresh the "container" in
which the checkbox is rendered.

Try this in your *List scripts:

write '"|<<checkbox [["+tiddler.title+":ok]] ""
"this.refresh.container=true"$))|[["+tiddler.title+"]]...

This will add an 'init' handler to the checkbox macro that forces the
refresh logic to be invoked whenever the checkbox is clicked. With
this flag set, you shouldn't need to use the AutoRefresh script at
all... CheckboxPlugin should do the refresh all by itself!

HTH,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

tigger6333

unread,
Jan 21, 2008, 8:28:12 PM1/21/08
to TiddlyWiki
Done!!
I decided it was probably a better move to not have things relocate to
new tabs automatically incase the user
changes their mind. so instead I have used your <<tiddler
refreshTiddler>> idea and used it's
modifiers to adjust the text shown on the screen. This results in a
"button" that is more
informative to the user.

Results so far are shown at
http://members.bbnet.com.au/~kwright/toDoLink.html

I am enjoying the learning experience. As I have never used javascript
before and only had basic exposure to html css
it is satisfying to gradually achieve my aim. However, I wouldn't be
able to do it without the patient support
of this group, and in particular Eric. Thankyou, thankyou, thankyou to
one and all.

Cheers
tigger

On Jan 22, 8:31 am, tigger6333 <tigger6...@gmail.com> wrote:
> Thanks Eric. Some great advice.
> Clicking the tabs label again does refresh the tab correctly. But
> this
> appears to be counter intuitive. Once the checkbox is clicked the item
> should move to the
> correct tab with no more user input. this also applies to your second
> suggestion
> of adding a button.
>
> Your third suggestion is the most suitable but I can't get it to work.
> I imported the autoRefresh script fromhttp://www.tiddlytools.com
Reply all
Reply to author
Forward
0 new messages