Checkbox issue with Uncheckactions Parameter

87 kali dilihat
Langsung ke pesan pertama yang belum dibaca

Mohammad

belum dibaca,
13 Jul 2019, 00.24.3313/07/19
kepadatiddl...@googlegroups.com

Problem
A checkbox widget is used to switch done/undone state it uses
  • A state tiddler to store states: done / undone
  • A task tiddler to store a pair value/item like test:2019 
  • A done tiddler to store a pair value/item like test:2019
It uses actions and uncheckedactions
  • When the status is done the actions calls a macro to move the item/value to done tiddler
  • When the status is undone the uncheckedactions calls a macro to move item/value to task tiddler
Issue
  • The actions macro/parameter seems to work fine
  • The uncheckedactions fails: It moves item/value to task tiddler but the value is empty!!
To reproduce the issue a set of tiddlers is attached. Also the below wiki can be used to reproduce the issue



Further note
Both macros are used for actions /uncheckedactions are tested separately using buttons and seems they are correct!!


Best regards
Mohammad

check-box-issue.json

Mohammad

belum dibaca,
13 Jul 2019, 14.32.0713/07/19
kepadaTiddlyWiki
Any update?

I learned if I use two separate checkbox widgets one with actions and other with uncheckedactions, the issue has gone!
But why I need to  use two checkboxes while one should do the job!

--Mohammad

Mohammad

belum dibaca,
13 Jul 2019, 14.38.2213/07/19
kepadaTiddlyWiki
Does anybody can tell me what is going wrong hear? Is this an issue with checkbox widget?



On Saturday, July 13, 2019 at 8:54:33 AM UTC+4:30, Mohammad wrote:

Mark S.

belum dibaca,
13 Jul 2019, 15.28.4513/07/19
kepadaTiddlyWiki
Without going over the code in detail, keep in mind that the "action" attribute gets run both when the box is checked AND when it is unchecked. You
may have to wrap your action code in a list or reveal widget to prevent "actions" from occurring during uncheck.

My apologies if you have already allowed for this.

Mohammad

belum dibaca,
13 Jul 2019, 16.15.1813/07/19
kepadaTiddlyWiki
Thanks Mark!
 I did not know this nor in the tiddlywiki.com explained!
But as your comment I used two checkbox one for actions and one for uncheckedactions and now it works.

Thank you Mark!

Best regards
Mohammad

Jeremy Ruston

belum dibaca,
14 Jul 2019, 08.32.1914/07/19
kepadaTiddlyWiki
Hi Mohammad, Mark,

The history here is that in v5.1.14 we added an "actions" attribute to the checkbox widget that specified an action string to be specified whenever the state of the checkbox changed. The same action string is executed regardless of whether the checkbox was checked or unchecked.

Then in v5.1.16 we merged https://github.com/Jermolene/TiddlyWiki5/pull/3182 which added the "uncheckactions" attribute. The difference between the two is that the uncheckactions are only executed if the checkbox is unchecked. The main "actions" attribute is executed before any actions in "uncheckactions", which makes it possible to arrange things so that the "actions" attribute sets things to the checked state while the "uncheckactions" attribute overwrites those changes to set things to the unchecked state.

In retrospect, it would have made more sense to have also added a "checkactions" attribute that was executed only if the checkbox was checked. I'll investigate adding it for v5.1.20.

Best wishes

Jeremy.



--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@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/1d55c7a4-8232-42d8-b487-c5ce27df4a4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

Jeremy Ruston

belum dibaca,
14 Jul 2019, 08.43.1714/07/19
kepadaJeremy Ruston, TiddlyWiki
In retrospect, it would have made more sense to have also added a "checkactions" attribute that was executed only if the checkbox was checked. I'll investigate adding it for v5.1.20.

Mohammad

belum dibaca,
14 Jul 2019, 10.37.1514/07/19
kepadaTiddlyWiki
Hi Jeremy!
Many thanks for you clear explanation. It would be great if a line in the TW documentation is added to clarify this.

--Mohammad

Jeremy Ruston

belum dibaca,
14 Jul 2019, 10.41.4114/07/19
kepadatiddl...@googlegroups.com
Hi Mohammad


On 14 Jul 2019, at 15:37, Mohammad <mohammad...@gmail.com> wrote:

Many thanks for you clear explanation. It would be great if a line in the TW documentation is added to clarify this.

There is indeed a docs update included in that commit that clarifies what’s going on:


Best wishes

Jeremy


Mohammad

belum dibaca,
14 Jul 2019, 10.54.0814/07/19
kepadaTiddlyWiki
Hi again Jeremy,
 I checked the code and it works like a charm!
Yes the documentation update is there.

Many thanks for all your efforts and espcially your prompt actions.

Best wishes
Mohammad

On Sunday, July 14, 2019 at 7:11:41 PM UTC+4:30, Jeremy Ruston wrote:
Hi Mohammad

TonyM

belum dibaca,
15 Jul 2019, 01.51.0915/07/19
kepadaTiddlyWiki
Jeremy,

For what every reason the pre-release version https://tiddlywiki.com/prerelease/#CheckboxWidget

The last example Add tags from tiddlers Features and Encryption

Is not, or is no longer working.

Regards
Tony


On Monday, July 15, 2019 at 12:41:41 AM UTC+10, Jeremy Ruston wrote:
Hi Mohammad
Balas ke semua
Balas ke penulis
Teruskan
0 pesan baru