[TW5] Debug Help: Widget Refresh

68 views
Skip to first unread message

Roma Hicks

unread,
Apr 7, 2015, 10:42:42 PM4/7/15
to tiddly...@googlegroups.com
Hi.

What I am attempting to do is set a field after the user has entered the title of a tiddler that was just created.
  1. User presses modified $button widget.
  2. When prompted, enters new tiddler's title.
  3. Tiddler is created and stored.
  4. The tiddler that holds the widget has it's value set to the new tiddler's title.
  5. Related widgets update and refresh. (This is the breakdown)
The block that adds this behaviour is a very simple setText call.

This code mechanically sets everything correctly, it is just the redraw of the $select widget that does not happen.  Actually, it does redraw but does not set the matching value for the field.  If you close/edit the tiddler it redraws it shows the correct value.

This seems to be a problem with widget outside the normal "content space".  As the same widgets placed in the body of the tiddler behave correctly.  You can play with an example here; the example is a partial implementation of creating a new Project.

I would appreciate any time someone took to look at this mess.  
Debug help or tips.





Jeremy Ruston

unread,
Apr 9, 2015, 2:29:23 PM4/9/15
to TiddlyWikiDev
Hi Roma

> I would appreciate any time someone took to look at this mess.  

Very happy to help if I can. Please could you list the exact actions that are needed to reproduce the problem? Your code looks fine; I think this may be a problem with the select widget.

One minor point is that I'd advise against calling the widget "action". All the widgets live in a global namespace, and "action" is quite a generic word. Given that it's gsd specific, perhaps call it "gsd-action"?

Best wishes

Jeremy.


--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/1fb23f05-fda7-4845-8acc-f72cd36f2ac3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Roma Hicks

unread,
Apr 9, 2015, 4:44:58 PM4/9/15
to tiddly...@googlegroups.com, jeremy...@gmail.com
The $action name definitely needs changing, it is a vestige of its original design, until I made the widget more generic keep forgetting to write it down though.

Okay, just tried something that changes the issue a bit.  I just set a delay between the add tiddler and setting the field.  It worked as expected.  Is adding a tiddler async?  I briefly thought about that originally but didn't test until now.

Jeremy Ruston

unread,
Apr 9, 2015, 4:51:23 PM4/9/15
to Roma Hicks, TiddlyWikiDev
> Okay, just tried something that changes the issue a bit.  I just set a delay between the add tiddler and setting the field.  It worked as expected.  Is adding a tiddler async?  I briefly thought about that originally but didn't test until now.

No, when you call addTiddler() the tiddler is changed immediately. The part that is asynchronous is the refresh cycle: it is triggered via setTimeout() arranged so that multiple tiddler store modifications will trigger a single refresh cycle.

I suspect that it is a refresh issue with the select widget, but I'd like to be able to reproduce it so that I can investigate.

Best wishes

Jeremy.


Roma Hicks

unread,
Apr 9, 2015, 5:10:51 PM4/9/15
to tiddly...@googlegroups.com, roma...@gmail.com, jeremy...@gmail.com
So what code do you need from me?  Sorry if I am being dense.

An example can be found at http://gsd5-playground.tiddlyspot.com
To see the issue:
  • Go to: http://gsd5-playground.tiddlyspot.com/#Mockup%20Example
  • Click the "Add Project" button in the "Blue-Box"
  • Enter desired name in popup.
    • The $select widget updates to display the new tiddler in the list but not the value of the field, "gsd_project" in this case.
    • "gsd_project" is set, checking via info tab
  • Close the tiddler.
  • Reopen the tiddler.
    • The $select widget now displays the correct value.

I will add some tiddlers so building and testing will be easier for you on branch issue58.  I will let you know when I get this done, probably not until early morning for you.

Roma Hicks

unread,
Apr 9, 2015, 7:35:52 PM4/9/15
to tiddly...@googlegroups.com, roma...@gmail.com, jeremy...@gmail.com
Jeremy,

I pushed the code in question, and some pre-defined tiddlers to assist in testing to my repo.  You can find the code on branch "issue58".
The directions to build against TW5 is on the readme; the only build scripts I current have are Bash scripts.
Let me know if you have any questions.

Thank you very much for you help!

Jeremy Ruston

unread,
Apr 12, 2015, 10:24:17 AM4/12/15
to Roma Hicks, TiddlyWikiDev
Hi Roma

In which tiddler would I find the source of the offending <$select> widget?

mGSD is looking good by the way,

Best wishes

Jeremy.

Reply all
Reply to author
Forward
0 new messages