I have a set of radio buttons that I use to select the value of a field that I use for filtering a list of tiddlers. This all works fine. The only thing I don’t like about this approach is when my Wiki is refreshed or freshly loaded, none of the radio buttons are selected so there is no filter output. Is it possible to have the filter output all values for this particular field if there is no radio button selected? Also, can I have a radio button setup to select all values of the field?
Perhaps the quickest answer is to use the select widget instead. By definition radio is one of the above so unless you make a combined option (all filters) it is not possible.
The select widget has a default option you can set to the value of the field.
The select widget also allows a multiple option so you could combine different filters.
However you want to combine filters. In this example I use existing “filter tiddlers” which you could as well. These tiddlers are normally use in advanced search filter as “canned filters”. Using filter tiddlers, with the same, different or additional tags is a good way to save filters for later reuse.
Thanks very much. I hadn’t thought about the select widget. I will take a look and study that. If I have any further questions, I’ll post another reply.
A couple of more questions. How do I default to multiple values being selected. It may be in your example, but I’m not seeing it if it is. The other question I have is how can I use the select widget without the dirty indicator going red? With the radio buttons, I used a tiddler with $:/temp so it wouldn’t do that. Can I do that with the select widget?
These are probably basic questions that I should be able to answer myself, but I’m having trouble concentrating this morning for various reasons.
My field contains only a single value because the tiddler represents a single operation I need to look at different ways of doing the filter. I’d like to think I know filters fairly well, but I do run across situations that stump me. I think this is one of those.
@HistoryBuff as a result of your questions I have continued to build some tools to help. As is often the case I find myself running down a rabbit hole, an exciting one like Alice.
How do I default to multiple values being selected.
Have the word multiple in the select widget, then normal click, ctrl-click and shift-click operations are used to select more than one.
how can I use the select widget without the dirty indicator going red?
If depends on what tiddler or field you set with the select widget, and what your settings are that define dirty. If $:/temp tiddlers do not trigger the dirty indictor use these. Otherwise the Dirty indicator is a separate issue. But do you really want a temporary non-permanent change?
I am building a solution called custom-filters. It allows to select filters from “filter tiddlers” starting with the inbuilt ones, It also assists you to create new “filter tiddlers”.
These are probably basic questions that I should be able to answer myself, but I’m having trouble concentrating this morning for various reasons.
Feel free to ask more questions, “lean on me” if you need to.
Interestingly, just prior to your latest post, I was able to get something functioning with the radio buttons by adding an “All” button and using a regexp search in the filter.
Works fine, but seems a bit slow. But then, I’ve noticed my whole wiki seems slow lately.