[GH-ISSUE #1086] Missing API method to retrieve a page from a Pages set #789

Closed
opened 2026-03-04 01:07:45 +03:00 by kerem · 2 comments
Owner

Originally created by @jsumners-nr on GitHub (Apr 15, 2025).
Original GitHub issue: https://github.com/rivo/tview/issues/1086

There's methods for getting the names of pages, removing pages, and determining if the set contains a specific page, but there isn't a method for retrieving a page by name. This seems like an oversight?

As an example, I have an app (github.com/newrelic/node-log-viewer@8a59279cda) that uses pages for all of the different views of the app. I want to reset a page to its default state after it has been used. Specifically, there's a search page that has an input field and two buttons (search and cancel). After a user issues a search, and then re-opens the search page to perform another search, the previous state will be shown. In my current structure, I believe that I need to be able to retrieve the search page from the set of pages so that I can reset the field value and issue a .SetFocus on it. But I can't do that with the current API. So I think I'm going to have to restructure my app to separate the form from the "page".

(if you want to try that app to see what I mean, there's a sample log file in testdata/v0/ that can be used)

Originally created by @jsumners-nr on GitHub (Apr 15, 2025). Original GitHub issue: https://github.com/rivo/tview/issues/1086 There's methods for getting the names of pages, removing pages, and determining if the set contains a specific page, but there isn't a method for retrieving a page by name. This seems like an oversight? As an example, I have an app (https://github.com/newrelic/node-log-viewer/tree/8a59279cda5f9a81825dbb967068694170816e88) that uses pages for all of the different views of the app. I want to reset a page to its default state after it has been used. Specifically, there's a search page that has an input field and two buttons (search and cancel). After a user issues a search, and then re-opens the search page to perform another search, the previous state will be shown. In my current structure, I believe that I need to be able to retrieve the search page from the set of pages so that I can reset the field value and issue a `.SetFocus` on it. But I can't do that with the current API. So I think I'm going to have to restructure my app to separate the form from the "page". (if you want to try that app to see what I mean, there's a sample log file in `testdata/v0/` that can be used)
kerem closed this issue 2026-03-04 01:07:45 +03:00
Author
Owner

@rivo commented on GitHub (Aug 27, 2025):

See the commit linked above.

This seems like an oversight?

This was just never requested.

<!-- gh-comment-id:3228975164 --> @rivo commented on GitHub (Aug 27, 2025): See the commit linked above. > This seems like an oversight? This was just never requested.
Author
Owner

@jsumners-nr commented on GitHub (Aug 27, 2025):

Excellent. Thank you.

<!-- gh-comment-id:3229062265 --> @jsumners-nr commented on GitHub (Aug 27, 2025): Excellent. Thank you.
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#789
No description provided.