[tw] Re: [TW5] Conditional content based on filter results

2016-05-09 Thread Mat
@Tobias

+[limit[1]]
>

If you could put up a solution on tb5 it would be appreciated!

<:-)

-- 
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/b9098cee-3bd8-40e7-9cf6-a3fbb763c6da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] Conditional content based on filter results

2016-05-08 Thread Tobias Beer
Hi Eric,
 

> To conditionalize output based the empty/non-empty state of the filter 
> results, use the *emptyMessage* param in the $list widget.
>

Thanks for your feedback. There remains an issue though.
The user can input any filter that may or may not yield matches.
If there are any matches, I want to display a single button,
followed by a list of all matches.

I guess I will have to use a variable and a helper macro to append a

+[limit[1]]

to the filter string being tested so as to check (once) if there are any 
results.

Best wishes,

Tobias.

-- 
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/deb341ca-1a05-4d2c-b988-e6206c66b825%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] Conditional content based on filter results

2016-05-08 Thread Mat
Reminds of #2202 Add preMessage parameter to ListWidget 


<:-)

-- 
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/c1620829-888f-4b59-9611-b78df018e026%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] Conditional content based on filter results

2016-05-08 Thread Eric Shulman
On Sunday, May 8, 2016 at 2:01:07 AM UTC-7, Tobias Beer wrote:
>
> Hope I didn't get too rusty since March.
>
> I am struggling to formulate a filter logic for batch operations 
> 
> that allows to specify a filter whereas when the filter yields...
>
>- results => shows a button to delete all those tiddlers
>- no results => does not show a button since there are not tiddlers to 
>be deleted
>
> The filter is specified by the user in an input field.
> Feels like a filter to model this conditional logic isn't quite there yet, 
> is it?
>  
> <$list filter="[foo[bar]is[emptyList]]">
> <$button>foo
> 
>
> What I am *not* looking for is to just
> see if some value in a tiddler field is empty or not 
> ,
> although I am not sure that that would exist either (in a simple solution).
>

To conditionalize output based the empty/non-empty state of the filter 
results, use the *emptyMessage* param in the $list widget.

To make things more readable, I tend to put the output rendering code into 
separate macros, thus:

\define showitem() <$button>{{!!title}}
\define showempty() no items
\define filter() [foo[bar]]
<$list filter=<> emptyMessage=<>> <> 

enjoy,
-e

P.S. welcome back

-- 
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/9ac6a08d-9bb0-4571-885c-caf43dc17bc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.