UITabBarDelegate or UITabBarControllerDelegate? - uitabbarcontroller

I need to receive a message whenever a user touches a Tab Bar item (even if it corresponds to the currently displayed view). I'm uncertain as to whether to use the UITabBarDelete protocol, which provides:
- (void)tabBar:didSelectItem:
Description:
Sent to the delegate when the user selects a tab bar item.
OR, from the UITabBarControllerDelegate:
- (void)tabBarController:didSelectViewController:
Description:
Tells the delegate that the user selected an item in the tab bar.
Seems like either one could be used. In my case, I need to reload/reinitialize the view associated with true current Tab Button.
Thanks for any guidance.

You can use either.
in this case:
- (void)tabBar:didSelectItem:
you'll have to access the corresponding view controller from the viewControllers array.
whereas, in this case:
- (void)tabBarController:didSelectViewController:
you'll get it as an argument.

Related

Set active tab when navigating from one tab to another by button click

I have been struggling with this for a while now. I'm trying to navigate to one tab (let's say Home) to another (let's say About). I'm able to navigate that either the page get's added to nav stack, but then it's not changing active tab. That, or then we use select to set the active tab, which means that I lose the navigation stack. Here's the latter option code:
export class HomePage implements OnInit {
tab: Tabs;
constructor(public navCtrl: NavController) {
this.tab = this.navCtrl.parent;
}
navigate() {
this.tab.select(1);
}
But this means that as mentioned, I lose the nav stack and can't use the back button that would show if I use push. That brings us to the other option, when I use .push():
this.navCtrl.push(About)
The active tab won't change, but still shows Home as the active tab, even though we are successfully navigated to About tab.
So what I wish for, is to have both the 'Back' button and the active tab (About) selected when I'm clicking the button to go to About from Home. Here's a demo with the push option, as you can see the active tab does not change: https://plnkr.co/edit/6KIL8mxfTMCsvACpiD1K?p=preview
PS. I looked at this question, but it wasn't useful to me: Changing tabs dynamically in Ionic 2
I'm using Ionic 3
I don't think this is how the tabs component is intended to work. With tabbed navigation you kind of have n navigation stacks (where n is the number of different tabs you have) which means if you .push() a new page on the nav-stack you push it on the stack of the currently selected tab.
Switching to another tab kind of is the same as starting with a new root, you start with the initial page ([root]="yourFirstPage") and can then add new pages to this particular nav-stack (and you can pop them off the nav-stack with a back button).
In you particular example you are trying to .push() the About page on the stack of the Home page and expect the NavController to know that you intended to switch to another stack and to push a new page to the new stack.
One solution to your problem could be to always remember the previous tab when you use .select() and display back button manually in the navbar which uses .select(previousTab) on click.
I hope that makes things clearer for you.
It's the default behaviour to act like this. When you select a tab it clears the nav stack and set the root to another page. When you push your about page when in home page you're pushing a new page in your home nav stack, this is why it doesn't change and shoudn't change.
The reason to use tabs is that you can segment and divide stuff in they correct categories. When updating a product you don't whant the user the see, for example, billing information in the same stack of products since it doesn't belongs to that category.
The .select() method (whose you've implemented in your home.page.ts) is the closest you can have from beeing able to select a tab without clicking in a specific tab.
What you can do is simply remove about from beeing a tab and push it in home OR remove the button to go from the home to about page, since there's already a tab for this.
In any case what you want to do is an error that Ionic team removed the possibilities from people doing.
Hope this helps you.

Creating secondary menu bar under the first one ORACLE APEX

Can anyone tell me if there is a way to create a secondary menu under the first one?
So another menu bar under 'Home, Team/People' and above 'Home' Title
Yes, but you don't create them as a Menu. In APEX (At least with theme 42) you have to choose Side Navigation or Top Navigation (not both).
What I've done is define my side menu then I added items to the Navigation list (in my case I have no need for submenus on the Nav. Bar) and the end result is that I have items to click on on left and top.
Yes, you can. So, you can have only one menu list, which is for the application in general, but what you could do is add a region on page 0 which represents a list.
I'm assuming you're familiar with APEX development, then you can follow these steps:
Fist you need to have the page 0(a.k.a global page) in your application. So, create it if there's not.
In page 0, create a new region.
Set the following region's attributes:
Type: List;
Position: Page Navigation;
Template: none (- Select -).
In source tab, select which list do you want to display there.

How to expose standard back button in view controller navigation?

I need users to be able to navigate a data hierarchy (master level, detail level) and to create new master and detail objects accordingly. Both master and detail use arrays for their model and TableViews for presentation
The navigation flow for this uses 2 navigation and table controllers like below. The + of the master and detail TableViews create new objects, the forstTableCell navigates to the second TableView using a segue:
While the screenshot shows "Done" right now even when removing that ButtonItem the slot remains empty.
I would like to show the standard back button instead: "< Middlewares" in this case. In the tests I've only been able to get the back button when navigating to a normal ViewController, but not to another NavigationController. Is it possible to have it between Navigation Controllers, too?
Simply remove the second navigation controller. If you use a push segue, your second view controller will still have the navigation bar. As long as you don't use a modal segue all view controllers that are pushed will have a navigation bar.
So your storyboard will look like this:
You will then automatically have a back button. If you want to change the text of it, go to your navigation item of your first view controller and change the back title accordingly as shown in this screenshot
You certainly want to have a title in your second view controller (something like "Add [whatever you want to add]". So simply drag & drop a UINavigationItem on your second view controller then you can also add UIBarButton items in your Interface builder
Controlling the look/feel of the Navigation Bar Buttons
You can achieve the behavior you want by opening the Document Outline and find the existing Done button. If you have a UIBarButtonItem type, you can simply change the type to Custom in the Inspector. Next add a regular button within the UIBarButtonItem (just bring the Navigation bar for the target controller into the zoomed in view of the storyboard/xib). This will allow you to drag a button onto the navigation bar.
Once you have a standard button you can add an image with the back arrow. Then add supporting code to use the pop behavior on the Navigation bar. Since you can have only one root navigation controller, you may want to remove the second UINavigationController and add a UINavigationItem from the objects library and then subsequently add the buttons, titles of your choice. This configuration will allow you to leverage all of the push and pop methods available, while retaining full control of the look/feel/behavior of the navigation stack.
More on customizing the look/feel/behavior of the UINavigation Stack can be found at: Navigation API Docs

same dynamic action for multiple buttons APEX 5.0

I have a apex report page where there are multiple submit buttons for each region of charts display. Each submit button is supposed to have same dynamic actions- the dynamic action is supposed to run if user does not selects any data so an error message will pop up and this dynamic action I want to work for all the buttons, so instead of adding dynamic action which is common for every button , I want to define it somewhere in the code so that it can be called during click of any button.
How this can be done?
What you can do is assign the same CSS class to all the buttons you want your dynamic action to fire on. Let's say you assign a class .mybutton to all the buttons in your chart regions.
Second create your dynamic action.
Event: Click
Selection Type: jQuery Selector
jQuery Selector: .mybutton
Define the condition if you need to. Go on with Action etc.
So now your dynamic action will be fired whenever the user clicks on a button with the .mybutton class.
If you need to identify each button by ID when clicked and your action is Execute JavaScript Code, you can use thisTriggeringElement.id.
For the particular Dynamic Action, in Condition region, under Condition Type you can select Request is contained within Expression 1 and give your request(button request) in Expression 1

Ember.js adding and removing views from the DOM?

I am looking into ember.js, after working with SproutCore 1 previously. I am looking for some examples on how to add and remove views from the DOM as the user navigates the application.
For instance, I have an application that contains a set of cases and each case has a workflow. There are also administration pages, etc.
When the user starts up the app, a dashboard-like user interface is shown. From here the user is able to search or click on a case in order to bring up that case. At this point I want to do the following:
I want to remove the GUI for the Dashboard, and i want to show the GUI for the case - which is a complex GUI in itself with its own set of navigation rules etc.
Also, within the case I want to add and remove portions of the GUI as the user navigates and manipulates the case.
When the user clicks on the "Dashboard" link, I want the current GUI to be removed, and the dashboard to be added again.
As this will be a somewhat large application I am not sure if toggling the isVisible parameter is sufficient, or if other measures needs to be taken in order to not overload the user's browser.
Is there a guide, or an example that shows how to do this ?
WARNING: OUTDATED ANSWER
A view inherits from Ember.View which means it gets some key methods. append(), which appends to body, appendTo(arg) which takes an argument and remove().
The argument is a jQuery style selector of where to insert the element in the DOM.
// my view
App.PartsView = Ember.View.extend({
...
});
// create/insert my view
App.partsView = App.PartsView.create();
App.partsView.appendTo('#partcontainer');
In my code I have a <div id="partcontainer"></div>.
// remove from DOM
App.partsView.remove();
The documentation has a good part on Building a View Hierarchy and later a section on Ember.ContainerView depending on whether you want to do it all programatically or not.