Re: [tw] Re: [TW5] How to default SelectWidget to the first entry in a list?

2017-09-08 Thread Dave

I figured it out -  If you do this:

\define s.test.result(mytestname,myresult:"neg")

if the value passed to it is empty, it sets the value to whatever you 
provide after the ":"


That solves my problem, but I don't know if its helpful for the OP (i.e. 
when the list is actually changing from one instance to another)


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/09a6f4aa-fab5-4e8c-84ac-aa988644dfe1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: [TW5] How to default SelectWidget to the first entry in a list?

2017-08-27 Thread Dave
So in this example (see attached), how would you have the macro set that 
initial default value if there is no existing value already there?

Would there have to be a javascript if then statement within 
the <$select> tags?

On Monday, February 27, 2017 at 12:36:56 PM UTC-7, Jeremy Ruston wrote:
>
> Hi Jeff
>
> Hi guys:  thanks for the suggestions.  However, it seems to be not quite 
> so simple.  Simply setting the default selection in the widget doesn't seem 
> to actually activate that selection.  I assume I have to actually update 
> the text of the state tiddler being used by the widget so it activates that 
> selection.
>
>
> The description of the “default” attribute of the select widget is subtle:
>
> > Default value to be used if the tiddler, field or index specifies a 
> missing value
>
> So, what the attribute does is provide the value to be displayed by the 
> select widget if the tiddler/field/index is missing.
>
> > I would love to just say, whichever is the first entry in the list, 
> select that by default.  
>
> Setting the select widget to a particular value is accomplished by 
> assigning that value to the tiddler field/index that is bound to the 
> widget. So, you’d need to explicitly assign the right value to that 
> field/index in order to select the default that you want.
>
> Best wishes
>
> Jeremy
>
>
>
>
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5893ed43-5440-4610-badd-a6a30308f4ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: [TW5] How to default SelectWidget to the first entry in a list?

2017-02-27 Thread Jeremy Ruston
Hi Jeff

> Hi guys:  thanks for the suggestions.  However, it seems to be not quite so 
> simple.  Simply setting the default selection in the widget doesn't seem to 
> actually activate that selection.  I assume I have to actually update the 
> text of the state tiddler being used by the widget so it activates that 
> selection.

The description of the “default” attribute of the select widget is subtle:

> Default value to be used if the tiddler, field or index specifies a missing 
> value

So, what the attribute does is provide the value to be displayed by the select 
widget if the tiddler/field/index is missing.

> I would love to just say, whichever is the first entry in the list, select 
> that by default.  

Setting the select widget to a particular value is accomplished by assigning 
that value to the tiddler field/index that is bound to the widget. So, you’d 
need to explicitly assign the right value to that field/index in order to 
select the default that you want.

Best wishes

Jeremy




> 
> -- 
> 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 tiddlywiki+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to tiddlywiki@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/tiddlywiki 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/8d79de82-1bf5-4526-8d8a-0ebc2a0fa135%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/88DB2FA8-32BA-4967-AF68-3C3672BC7BA6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] How to default SelectWidget to the first entry in a list?

2017-02-27 Thread Jeff Vance

Hi guys:  thanks for the suggestions.  However, it seems to be not quite so 
simple.  Simply setting the default selection in the widget doesn't seem to 
actually activate that selection.  I assume I have to actually update the 
text of the state tiddler being used by the widget so it activates that 
selection.

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8d79de82-1bf5-4526-8d8a-0ebc2a0fa135%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] How to default SelectWidget to the first entry in a list?

2017-02-26 Thread Mat
ah, not that it's real code but it should say default={{!!title}} , i.e 
without quoteation marks.


On Monday, February 27, 2017 at 7:29:55 AM UTC+1, Mat wrote:
>
> No complete answer, but I think this idea might work;
>
> Use the same filter for a wrapping list from which you use only the first 
> element as the default.
>
> 
> 
> 
> 
> 
> 
> 
>
> Never tested.
>
> <:-)
>
>
> On Sunday, February 26, 2017 at 9:31:35 PM UTC+1, Jeff Vance wrote:
>>
>> I have a tiddler with a SelectWidget that runs a filter to get a list of 
>> options.  I want the selection to always default to the very first entry, 
>> which will change over time as new tiddlers are created.  I haven't seen 
>> any examples of how to do this.  I see that I can set a default selection 
>> by name, but in my case the name I want will always change.  Is there a way 
>> to do this that I'm missing? I would love to just say, whichever is the 
>> first entry in the list, select that by default.  
>>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e17630f6-6323-4a6e-bd9f-017d5a6226bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] How to default SelectWidget to the first entry in a list?

2017-02-26 Thread Mat
No complete answer, but I think this idea might work;

Use the same filter for a wrapping list from which you use only the first 
element as the default.









Never tested.

<:-)


On Sunday, February 26, 2017 at 9:31:35 PM UTC+1, Jeff Vance wrote:
>
> I have a tiddler with a SelectWidget that runs a filter to get a list of 
> options.  I want the selection to always default to the very first entry, 
> which will change over time as new tiddlers are created.  I haven't seen 
> any examples of how to do this.  I see that I can set a default selection 
> by name, but in my case the name I want will always change.  Is there a way 
> to do this that I'm missing? I would love to just say, whichever is the 
> first entry in the list, select that by default.  
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2cb31f26-fe40-49a9-80e9-2c768d3f699c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.