-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I dynamically generate options in a list? #183
Comments
I did your option 2... I have a lot of dynamic steps. I wish there was a JIT factory approach. Seems similar to #69. |
For now I ended up refactoring to go back with a single form and a helper function to scroll like this func (m *Model) scrollGroupUp(scrollAmount int) {
for i := 0; i < scrollAmount; i++ {
m.form.NextGroup()
}
} It would be nice to have direct access to the selected group, as well as exporting much more fields from the Form struct |
Hi! We're planning on supporting this is an official capacity. Please follow #69 for updates and discussion. |
Hi, closing this in favour of #69 |
I have code like this
m.appState.AppNames is fetched from some API. If I fetch it async after the form is completed, I have to remake the form to get it to show up. Calling form.Update() does not seem to refresh it. What is the correct way to update values in a form after the form is created?
In other words, lets say I have 4 groups. The first 3 ask the user for inputs. The fourth's list is based on the API response which depends on the items in the first 3 groups. Right now, I would have to remake the form and then call NextGroup to get to the page I was on, or make a second form and switch to that, but then I lose shift+tab functionality.
What I would like to happen is this:
Some alternatives I considered
making the form again and using NextGroup to "scroll" back to the right place. Kind of hacky and loses the form variables that I will have to save externally and also requires me to keep track of positions. Having the page field external would be nice so I can specify which group to switch to
Making a second form and switching model.form to it. This is simpler but loses the shift-tab functionality
The text was updated successfully, but these errors were encountered: