Hi Stephan

>
> As you already told me before Hangout #20, you know about this loose of
> focus. Memorizing the field and refocussing after tiddler refresh won't
> help, I fear. When a test input receives focus, usually the content gets
> selected, if I'm not mistaken. So when you type a character, before the
> next one, the text will be selected and the next character will delete that
> selected part.
>

As Vincent notes, we can in fact remember the text selection in order to
restore it correctly. It's fiddly, but do-able. The tricky part is tracking
widget nodes across refresh cycles, because of the way that DOM nodes can
get recreated as part of the refresh cycle.

My idea would be, at least for my use case, to not update anything until
> the "done" button is pressed.
>

In effect that is how TW5 already works. Edits happen live to the draft of
the tiddler, and then clicking done copies the draft over the original. So,
the actual edit isn't performed until you click done. We update the draft
live so that it can be synced to the server/localstorage for backup.


> I'd like to explore that idea but I have no clue about any JavaScript API
> offered by TW5 or whether there is any. I need to know how to retrieve and
> store the field values.
>

There's quite a lot of dev documentation on five.tiddlywiki.com, and a
great deal of comments in the code.


> I also like to know whether or not the change of a class in my posted
> example can, for this case, be assumed safe? As long as the tiddler I'm
> editing does not get refreshed, I don't see, at the moment, a problem.
>

The tiddler you're editing could get refreshed because of, say, an
unrelated change in the content of the story list. It's pretty fundamental
to TW5 that DOM nodes are dynamically created. It's just the same as modern
frameworks like Angular.


> Another idea, how I thought I could achieve what I want, was something
> like this: I need to create some Form Tiddler which defines the layout and
> fields which are editable. This Form Tiddler then serves as the View and
> Edit template at the same time. It should be possible to create a tiddler
> with this Form Tiddler as its template. Clicking the EDIT button should
> then simply offer to change the fields.
>

I'll reply separately to your later message about this part.

Best wishes

Jeremy


>
> I hope I could explain what I mean!?
>



-- 
Jeremy Ruston
mailto:[email protected]

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

Reply via email to