Tab Bar Controller / Segue Issue - uitabbarcontroller

I am working with 4 views using a Tab Bar. The first view has a tableview of rounds of golf. The second view allows the user to enter data for a new round. I have a button on the "Add Round" view that saves the inputted data to Core Data. When the user saves the round I want the view to segue back to the "home screen" where the rounds are displayed. I created a segue called "SavetoHomeSegue" in storyboard.
This is the code I use to switch between the views
[self performSegueWithIdentifier:#"SavetoHomeSegue" sender:self];
[self.tabBarController setSelectedIndex:0];
Here is my issue: When I switch back to the "Home Screen" the tableview now appears for the first tab AND the second tab. Also, it doesn't seem like the "Add Round" view was properly unloaded as I was previously having to manually clear the data inputs in the textfields. How do I transition from one tab to another and properly unload the views? I have posted my views below:
Home Screen View -
Add Round View -

You definitely shouldn't be segueing between tab bar vc's. Just save the data and refresh the other view on viewWillAppear. Call setSelectedViewController when necessary, but never segue between tab bar vc's.

Related

WinUI3 : Incrementally add contents to ListView On scroll

I am working on WinUI 3 desktop application in C++. I was trying to achieve an experience where when we scroll ListView, we will incrementally add rows to the end of the listviews dropdown during runtime.
For example, I might have 100,000 results to fit in a list view, I only want to show a limited number of contents in the list view, then as the user scrolls I'll add more contents to the list view.
I was not able to get any scroll-based events in ListView directly, so I extracted the ScrollViewer from the list view and handled the ViewChanged event. This event was fired when the scroll happened. But I was not able to get how many rows were scrolled or currently which row is been scrolled.
I want to get how many rows are scrolled so that I can insert enough rows to the end of the ListViews Item Source. It would be of great help if you could help me with this.
Thank You

Get parent Paragraph Entity from Referenced View

I have a custom paragraph type - which has 2 fields:
Display Mode,
View to be rendered
I want to let users choose Display Mode in this paragraph, then I will render view based on this Display Mode value.
The problem is, it seems there is no way for me to get this Display Mode value inside view template(views-view-unformatted.html) or hook (HOOK_preprocess_views_view).
Only what I can access is view object, which definitely does not have any parent entity info.
Any idea?

Apex: 22.1.1 - Based on the selection of the radio groups the form must be displayed dynamically

I am a newbie to APEX. I am currently working on radio buttons.. There are radio button groups in my page 1. For example :Radio 1 and Radio 2.Based on the selection of the radio button in these 2 groups , I need to dynamically show a Page items of the region in the same page. For a particular selection of the radio button groups, certain page items will be visible and certain will be hidden.
Also based on the values entered in the page items, on submit,the next page must display all the values which I entered in the region of the page elements.
What should be my approach to this. Please guide.
enter image description here
The way you described it, you'd use dynamic actions (Show / Hide) because they let you "dynamically" (and immediately) manipulate other items on the page.
You could use Server-side conditions as well, but they require page to be submitted first so - I guess that's not what you're after.
Therefore: initially hide all items you don't need (that's the same dynamic action, just set it to fire on initialization, i.e. when page is first rendered), and then show them as radio buttons' values change.
As of your next question: if you navigate to the next page using a button (so its action is to "Redirect to page in this application"), you can set next page's items' to values of items on this page. To do that, use Target - Link builder property (right below "Action").

Picker View data disappears too quickly

Scenario:
Application is tab-based; one tab is a container view having a 'Picker (Data) View'.
Picker View: the Picker is initially loaded with data via #State -> #Binder.
A 'Front Page' (Greetings) View is initially displayed over the Picker View within a ZStack{}.
User Acknowledges the front page which disappears to reveal the Picker View (#2).
Note: Data is received by the Picker per debug check.
The hidden Picker View shows the initial data.
Problem:
The revealed Picker View becomes empty; after dismissing the Front Page/View.
The following is a debug listing via BreakPoint of data:
Observation:
I want to access the data source ASAP to populate the Picker View to avoid having the user wait for the data. Hence the data is initially access prior to revealing the Picker View.
However,
the Picker View apparently gets re-rendered just prior to being displayed.
Note: I see the populated picker page if I comment-out the front-page code.
👉 I've added a boolean filter to avoid calling the Picker with an empty data payload.
Question:
How do I make the data more permanent; that is, stay until it is dismissed?
Do I have to make a concrete copy of a #Binding variable?
Non-SwiftUI fix:
Use a Singleton for the persistent data vector; and hence not influenced by the life of the controlling View:
final class DataSource {
static let shared = DataSource()
var myVar:String = "Hello World"
var countryNames: [String]?
}
This is so simple that it's elegant.
Still, I would like to use combine here, but the data life is too volatile.
I plan to review this paradigm further into my project as I become more proficient in Combine.
If anyone has a SwiftUI/Combine method of accessing, holding/sharing data that doesn't require a Singleton object, please post.

Oracle APEX, create & save (insert) from Interactive Report page to DML Form

Need a help in understand underline logic here. I have created a simple APEX application. First page shows the table details and via a "Create" button "Interactive Search" region, directs to a form page. Now form page consists of "Save" and "Insert" buttons in correct regions. So whole app works. When I press "Create" from 1st page to 2nd, "Save" button is invisible and when I click the edit icon on the table of 1st page, "Create" button is invisible in 2nd. App works accordingly, but could not figure out what setting enable this set-up even though I was able to make it work.
1st Page : Interactive Report Page. 2nd Page : DML Form. Built the app from blank pages.
Could any of you explain how it works?
When you click the Create button on the Interactive Report page, it takes you to the Form page in insert mode, i.e. it allows you to enter a new row into the table. Therefore, the Form page has the Create (and the Cancel) button.
On the other hand, when you click the Edit button on the Interactive Report, it takes you to the same Form page, but this time in edit mode which enables you to modify values (and save those changes with the Apply Changes / Save button), delete that row using the Delete button, or - as previously Cancel current operation.
If you look at Form page's buttons' properties, you'll see that they have Server-side Conditions set which are then used to render (or not) a certain button. For example, if the Form page number is 13 and the primary key column is set to the ID column, then these conditions look like this:
Create: P13_ID IS NULL (i.e. the primary key column value doesn't exist yet, which means that this is a brand new row)
Apply Chanages / Save: P13_ID IS NOT NULL (i.e. the primary key column value exists, which means that row you see was fetched from the database)
Delete: P13_ID IS NOT NULL (the same condition as for the Apply Chanages / Save button)
Cancel: it is always displayed.