I'm getting a fair amount of use from the Form/Data tiddler combo, but
having a problems when trying to use the data element as a selection
criteria in a forEachTiddler macro. For example:
where 'tiddler.data("facts")=="Y"'
would seem to be the proper syntax ('facts' is a defined field) but
is producing an 'unrecognized token' error.
And how would I specify multiple acceptable values like "Y", "N",
"?" (or the Any condition)?
The easy way to resolve this though help from the group would be to post a
'minimal test case' , a tiddlywiki inwhich the error is reproduced without
the posibility of interference from anything else in the TW.
I have found that forEachTiddler makes the problem more comlex sometimes and
have taken to using inline javascript.
A few people seem to be using DropBox for this. I can recommend it, and if
you follow the link[1] we will both get extra storage - its a referral
promotion
> I'm getting a fair amount of use from the Form/Data tiddler combo, but
> having a problems when trying to use the data element as a selection
> criteria in a forEachTiddler macro. For example:
> where 'tiddler.data("facts")=="Y"'
> would seem to be the proper syntax ('facts' is a defined field) but
> is producing an 'unrecognized token' error.
> And how would I specify multiple acceptable values like "Y", "N",
> "?" (or the Any condition)?
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWiki" group.
> To post to this group, send email to tiddlywiki@googlegroups.com.
> To unsubscribe from this group, send email to
> tiddlywiki+unsubscribe@googlegroups.com<tiddlywiki%2Bunsubscribe@googlegrou ps.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/tiddlywiki?hl=.
Thanks for the offer Alex, I am already a dropbox user myself. I know
the macro works with a 'tiddler.tag.contains' phrase but am trying to
work around the limitations of not being able to assign tags directly
into a data tiddler without editing it (FormTiddler allows creating
and editing tiddlers from 'view').
> work around the limitations of not being able to assign tags directly
> into a data tiddler without editing it (FormTiddler allows creating
> and editing tiddlers from 'view').
If you want to use TW's 'custom tiddler fields' instead of the plugin-
defined <data> format, you might want to check out these plugins:
http://www.TiddlyTools.com/#TextAreaPlugin - adds ctrl-F/ctrl-G search processing to multi-line text inputs
- also adds 'stretch' and 'autosize' to adjust input field size
Eric,
I may have misled you by accident. The 'facts' field is contained in
a JSON-defined data field created by the FormTiddler macro. The whole
application is an addressbook defined using a FormTiddler template and
the 'facts' field is a text field, generally with a Y/N indicator.
For various reasons that are not relevant to this discussion, I am not
able to use a predefined application like twab at this client
location. I currently have a forEachTiddler macro that lists all
tiddlers with a tag 'entry'. I'm trying to copy this macro to define
a list of tiddlers with a field with a specific value. Once this
particular list is working, I intend to define other forEachTiddler
lists for other fields and values; that is why I am looking for a
syntax solution. I would rather not re-architect the application to
use another technology.
Alan
You probably know that you have to specify a tag to make fETs work...
This is one of my fETs collecting emailaddresses from different
tiddlers.
I'm not sure if you are asking how to use "real fields" - as I do in
this example - or if you want to fetch data-fields...
I know I've got a fET (somewhere) fetching datafields as well...
> You probably know that you have to specify a tag to make fETs work...
> This is one of my fETs collecting emailaddresses from different
> tiddlers.
> I'm not sure if you are asking how to use "real fields" - as I do in
> this example - or if you want to fetch data-fields...
> I know I've got a fET (somewhere) fetching datafields as well...
Yet another one - this one evaluating a fieldvalue
<<forEachTiddler where 'tiddler.tags.contains("X") && tiddler.fields
["y"]&& tiddler.fields["z"] && tiddler.fields["z"].contains(q)'
sortBy 'tiddler.title'
write
'(index < 200)? "|!"+(index+1)+" <<toggleTag R [["+tiddler.title+"]]
- \>\>| <<tag "+tiddler.fields["y"]+" \>\> | <<tag "+tiddler.fields
["a"] +" \>\> | [img(3em,auto)["+store.getValue(tiddler,"title")
+"|"+store.getValue(tiddler,"image")+"]["+tiddler.title+"]] |
[["+tiddler.title+"]]|\n" : ""'
begin '"|sortable|k\n"
+"|<<tiddler B\>\>|>|>|>| !<<tag X [[C]] \>\> <<tag Z y \>\> |h\n"
+"|[[D]]| <<tag Y-label Y \>\> | <<tag E-label E \>\> || |h\n"'
end 'count+"Qs\n"' none '"No Qs\n"'>>
Don't know if this helps at all - as Alex put it: "The easy way to
resolve this though help from the group would be to post a 'minimal
test case"..
It's easier to help when you have an example...
Regards Måns Mårtensson
On 19 Nov., 12:56, Måns <humam...@gmail.com> wrote:
> I'm afraid I haven't got any fETs using criterias based upon
> datavalues in the "where-call" - I will look a little further..
> Regards Måns Mårtensson
> On 19 Nov., 12:50, Måns <humam...@gmail.com> wrote:
> > Hi Allan
> > You probably know that you have to specify a tag to make fETs work...
> > This is one of my fETs collecting emailaddresses from different
> > tiddlers.
> > I'm not sure if you are asking how to use "real fields" - as I do in
> > this example - or if you want to fetch data-fields...
> > I know I've got a fET (somewhere) fetching datafields as well...
> work around the limitations of not being able to assign tags directly
> into a data tiddler without editing it (FormTiddler allows creating
> and editing tiddlers from 'view').
Maybe I'm not understanding exactly what you want, but it's possible
to assign tags
from 'view' if you put the tagger macro (http://tw.lewcid.org// #TaggerPlugin) into your form:
<span class='tagger' macro="tagger source:myTags"></span>
Then create the tiddler [[myTags]] and tag it with all the tags you
want to be able to select from.
An even simpler way to do it is with the ToggleTag2 macro that used to
be in MonkeyGTD, but I can't find a copy of that anymore.
To go back to your original question about
where 'tiddler.data("facts")=="Y"'
see if it helps to establish first that the data field exists:
where 'tiddler.data("facts")&&tiddler.data("facts")=="Y"'
To get multiple acceptable values you could use:
'tiddler.data("facts")&&(tiddler.data("facts")=="Y"||tiddler.data
("facts")=="N")'
cmari
On Nov 19, 6:10 am, Måns <humam...@gmail.com> wrote:
> Yet another one - this one evaluating a fieldvalue
> <<forEachTiddler where 'tiddler.tags.contains("X") && tiddler.fields
> ["y"]&& tiddler.fields["z"] && tiddler.fields["z"].contains(q)'
> sortBy 'tiddler.title'
> write
> '(index < 200)? "|!"+(index+1)+" <<toggleTag R [["+tiddler.title+"]]
> - \>\>| <<tag "+tiddler.fields["y"]+" \>\> | <<tag "+tiddler.fields
> ["a"] +" \>\> | [img(3em,auto)["+store.getValue(tiddler,"title")
> +"|"+store.getValue(tiddler,"image")+"]["+tiddler.title+"]] |
> [["+tiddler.title+"]]|\n" : ""'
> begin '"|sortable|k\n"
> +"|<<tiddler B\>\>|>|>|>| !<<tag X [[C]] \>\> <<tag Z y \>\> |h\n"
> +"|[[D]]| <<tag Y-label Y \>\> | <<tag E-label E \>\> || |h\n"'
> end 'count+"Qs\n"' none '"No Qs\n"'>>
> Don't know if this helps at all - as Alex put it: "The easy way to
> resolve this though help from the group would be to post a 'minimal
> test case"..
> It's easier to help when you have an example...
> Regards Måns Mårtensson
> On 19 Nov., 12:56, Måns <humam...@gmail.com> wrote:
> > Here's another fET fetching datafields as well
> > I'm afraid I haven't got any fETs using criterias based upon
> > datavalues in the "where-call" - I will look a little further..
> > Regards Måns Mårtensson
> > On 19 Nov., 12:50, Måns <humam...@gmail.com> wrote:
> > > Hi Allan
> > > You probably know that you have to specify a tag to make fETs work...
> > > This is one of my fETs collecting emailaddresses from different
> > > tiddlers.
> > > I'm not sure if you are asking how to use "real fields" - as I do in
> > > this example - or if you want to fetch data-fields...
> > > I know I've got a fET (somewhere) fetching datafields as well...
Måns said: "You probably know that you have to specify a tag to make
fETs work... "
Actually, I didn't - and that was the key to solving my problem.
THANK YOU.
I added " && tiddler.tags.contains("entry")" to my where clause and
the list works perfectly. I've now defined 3 other lists using the
same information. This was a lesson I won't soon forget.
I'm glad that I could help you - and this proves (to me at least) that
"smalltalk" (this time meaning: saying a little too much) matters..
When there's no "proper MTC" - there's room for a kind of discussion
which teaches things you didn't know you needed to know.
I like this group for that - but the searchfunctions sucks!! - I can't
even find my own postings beyond this month. :-(
Regards Måns Mårtensson
On 20 Nov., 21:28, AlanBCohen <alanbco...@gmail.com> wrote:
> Måns said: "You probably know that you have to specify a tag to make
> fETs work... "
> Actually, I didn't - and that was the key to solving my problem.
> THANK YOU.
> I added " && tiddler.tags.contains("entry")" to my where clause and
> the list works perfectly. I've now defined 3 other lists using the
> same information. This was a lesson I won't soon forget.