mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #929] Add a way to serialize form content and status to/from JSON ? #677
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#677
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @X-Ryl669 on GitHub (Dec 20, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/929
If would be very useful if it was possible to serialize a form to/from JSON (so one could build a form from a simple JSON stream) at runtime.
Also, when the form is "submitted" it would be great if it was possible to serialize the content of each FormItem's value to a JSON stream too.
The underlying idea would be to use tview in conjunction with lua (for example in a plugin) to build a form to ask something to the user and be able to react when it's changed.
@X-Ryl669 commented on GitHub (Dec 22, 2023):
Thanks for the link to huh.
TBH, I was looking at some widget collection derived from tcell to integrate in micro's editor. My idea was to be able to trigger a dialog in Lua (micro implements a Lua based plugin system). Building the interface in Lua is too low level (and it doesn't solve the event loop issue). So the logical solution would be to have a Go-based dynamic form creation (to be implemented in micro's Go level) and that the form description and value would be serialized to/from Lua.
I guess it's not too specific a feature, since building forms by hand is painful for everyone, every change implies rebuilding (which is slow). A dynamic form sounds like a must-have for ease of development, IMHO.
I understand it might not be the goal of this project, it's a feature request (hence the question mark at the end of the issue's title).
BTW, I'm not a Go developer, so yes it may sounds like a "do this for me" request, simple because I can't do it by myself efficiently.