Sorry it's taken me a while to respond. I've posted an unrelated question 
regarding the same code here: 
https://groups.google.com/forum/?hl=en&fromgroups#!topic/tiddlywiki/RSecD3M6Vio,
 
so the code that solved this should be visible there.

On Tuesday, October 15, 2019 at 3:36:32 PM UTC-5, Jeremy Ruston wrote:
>
> Hi David
>
> Please could you post the code you referred to in your original post? I 
> have a feeling that the draft thing might be a red herring, and that this 
> may be about avoiding refresh cycles that destroy and recreate the range 
> widget while it is being used (which is a version of a classic TW5 gotcha: 
> that one cannot use an edit widget to edit a field of the tiddler in which 
> the edit widget appears).
>
> Best wishes
>
> Jeremy
>
> On 15 Oct 2019, at 19:42, David Allen <dvainw...@gmail.com <javascript:>> 
> wrote:
>
> 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 tiddl...@googlegroups.com <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/840e4f1b-55e2-4151-8eb5-376bb9199c0d%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywiki/840e4f1b-55e2-4151-8eb5-376bb9199c0d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>

-- 
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/563d25e5-d2d5-469b-97a0-3e42590550f0%40googlegroups.com.

Reply via email to