[GH-ISSUE #929] Add a way to serialize form content and status to/from JSON ? #677

Open
opened 2026-03-04 01:06:58 +03:00 by kerem · 1 comment
Owner

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.

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.
Author
Owner

@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.

<!-- gh-comment-id:1867447884 --> @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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#677
No description provided.