Hi Jeremy!

Yes! I tend to be a bit of a nuisance from time to time.

Am Dienstag, 3. Dezember 2013 08:39:28 UTC+1 schrieb Jeremy Ruston:
>
>
> The question simply is: Do you consider it proper tiddlywiki code, putting 
>> the values into the HTML and taking them from there.
>>
>
> No, it's not the right way to do it. You shouldn't need to store any state 
> in the DOM.
>

I don't store *state* in the HTML.

 

> As I think I posted elsewhere, the key to understanding how TW5 works 
> internally is to realise that the refresh mechanism requires that any 
> region of the DOM can be regenerated at any time.
>

No problem for my implementation. Refresh it whenever you like.

 

> This means that the entire state of the UI must reside in the tiddlers, 
> and not in the DOM.
>

So it does.

 

> It also determines the standard UI flow:
>
> * An event handler on a widget is triggered
>

I thought, the event handler is located in the widget object but triggered 
by an HTML event.

 

> * The event handler can manipulate the DOM nodes directly created by the 
> widget, and/or modify the state of the tiddler store
>

So mine does. But it retrieves static information from the DOM nodes as I 
do not see another way at the moment.

 

> * The core then issues a store change event which triggers the refresh 
> cycle
>

That's whatI implemented.

 

> * Each widget in the tree then gets a chance to refresh itself to reflect 
> the changes in the store if they need to
>

Okay.


>From a technical perspective, TW5 is a fairly classic MVC architecture, 
> with strict separation of concerns. The model is the tiddler store, the 
> view is a rendering tree (such as the one created 
> from $:/core/ui/PageMacros in startup.js), and the controller is the TW5 
> core code itself.
>

The only problem is the fact, that the HTML could be rerendered while the 
handler is running because I can't find my "other" radio buttons then.But 
the underlying problem I have is, and you haven't offered a solution yet: 
How can I find, when <$tagselect> is parsed all the other <$tagselects> 
which are already parsed or might be parsed? I think that's not possible. 
But maybe there is a way for the widgets eventhandler to find in the tree 
of widget objects, all those residing in the same tiddler, being a 
tagselect object and sharing the same group name. If that's possible, I'd 
love to use that and not rely on the DOM to get my (static!) tag values. 

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to