So I came up with an inelegant solution that solves the problem.

To clarify the situation I had, I had a list of tiddlers that would only 
show five at a time, and would scroll using a range widget and a left/right 
button combination.  The range widget scrolls by 1, the left/right buttons 
scroll by five.  The issue I had was the list and buttons were working 
correctly, but the range widget was not updating according to the input of 
the buttons.

The first solution I had was to move the field being modified to another 
tiddler, which I called Scratch_Pad.  This did not work, but it was 
convenient for me for later on.

Second solution I had was to change the default value of the range widget 
to equal Scratch_Pad!!scroll_index, which is the same value the widget and 
the buttons modified.  It worked, but the slider was very difficult to use 
as it would de-select itself every time I moved the slider, requiring me to 
re-click the slider and move it one-by-one every time I wanted to change 
the value.

The solution that finally worked is a bit wonky.  I read in another thread 
that modifying a draft of a tiddler works smoothly for the range widget.  
The problem I had was having the default value of the range widget be the 
same field as the value the range widget was trying to modify.  Here's what 
I did instead:

Set the tiddler the range widget modifies to be Draft of 'Scratch_Pad', 
keeping the field as scroll_index
Set the default it pulls from to be Scratch_Pad!!scroll_index, NOT the draft
Set the value the buttons base their calculations on to Draft of 
'Scratch_Pad'!!scroll_index.  This makes sure the buttons will move the 
value last updated by the range widget.
When the buttons calculate the new values, make sure they update the 
scroll_index fields in both the Scratch_Pad AND Draft of 'Scratch_Pad' 
tiddlers to update the range widget's position and make sure the value it 
next calculates is accurate
Base the horizontal list's position on the Draft of 'Scratch_Pad' value.

On Thursday, October 10, 2019 at 7:10:40 PM UTC-5, David Allen wrote:
>
> Right now I have a range widget that controls a scroll_index field.  It 
> increments by 1.  I also have two buttons that increment and decrement the 
> same scroll_index by 5.  Problem is, when I use the buttons, the range 
> widget does not update to reflect the modified scroll_index value, and I'd 
> like it to do so.  Is there a way to force the range widget to reflect the 
> scroll_index value?
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/840e4f1b-55e2-4151-8eb5-376bb9199c0d%40googlegroups.com.

Reply via email to