Hi TwWizards

I'm trying to create a select box where I can select a group and title 
based on tags. Group should become the field name and the "title" should 
become the field value...

I've been trying different approaches - which led to solutions for other 
use cases - this last one is still a little to difficult for me.

This* is how far I've got - as you can see I hardcoded the fieldname (wrote 
it into the macrocall).
What I really want is to be able to set the "master tag for Group headers" 
in the macro call. (In this case it is a tiddler tagged with "groupitem") - 
and when I choose a "sub list tiddler title" from that group item (in this 
case it is "probability" -  then I want the "FieldName" to change so it 
becomes the group header title.

[*]
\define sfmsa(GroupItem:"groupitem" FieldName:"probability")
<$select tiddler=<<currentTiddler>> field='$FieldName$'>
<$list filter='[tag[$GroupItem$]]'>
<optgroup label={{!!title}}>
<$list filter='[all[current]tagging[]]'>
<option value={{!!title}}><$view field='title'></option>
</$list>
</optgroup>
</$list>
</$select>
\end

Grouped: <<sfmsa>>

The use case is that I want to automatically set the fieldname to which a 
field value is written (<<currentTiddler>>) - as a result of which group a 
choosen tiddler (title) belongs to...

I'm not sure that you (or anybody else for that matter ...) - can follow my 
thoughts just by looking at the macro text. You might understand it better 
if you checkout my playground <http://playground.tiddlyspot.com/> - it is 
the tiddler $:/SelectFieldMacroSemiAdvanced 
<http://playground.tiddlyspot.com/#%24%3A%2FSelectFieldMacroSemiAdvanced> which 
holds the code.

The attached screenshot shows that I'm able to select a title from another 
group than the hardcoded one ("probability")... It would be very nice if 
the fielname would change to reflect the group header...:

<https://lh3.googleusercontent.com/-8QUBomdGpy0/VVXXfHsTjFI/AAAAAAAAG0o/UCSe0hKrc2s/s1600/selectdemo.png>
 
Cheers Måns Mårtensson

-- 
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/ed8b4b1e-3586-416d-83d8-0ee44d2342b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to