How to toggle visibility action bar tab navigation? - android-actionbar

I use Action Bar Sherlock library.
In SherlockFragmentActivity, Make tabs and pager (Swipe + Tab)
actionBar.addTab(actionBar.newTab().setText("tab1").setTabListener(this));
actionBar.addTab(actionBar.newTab().setText("tab2").setTabListener(this));
actionBar.addTab(actionBar.newTab().setText("tab3").setTabListener(this));
When paging. I change tab.
When tab selected, I change page.
(These works fine.)
And make button to toggle visiblity.
actionBar.setNavigationMode(NAVIGATION_MODE_TABS); // this force tab index = 0
//or
actionBar.setNavigationMode(NAVIGATION_MODE_DEFAULT);
But Setting navigation mode to NAVIGATION_MODE_TABS,
make tab index = 0 not current tab(pager) index

Try storing current tab index to an integer before you call actionBar.setNavigationMode(NAVIGATION_MODE_TABS);
int index=actionBar.getSelectedNavigationItem();
actionBar.setNavigationMode(NAVIGATION_MODE_DEFAULT);
actionBar.setNavigationMode(NAVIGATION_MODE_DEFAULT);
actionBar.setSelectedNavigationItem(index);

Related

Oracle Apex Checkbox Group, disable item option

It is possible to disable one option of checkbox group? I have created an P100_CREATE_PT item and disable one option using JavaScript:
const nodeList = document.querySelector("#P100_CREATE_PT_0");
if(nodeList) {
nodeList.disabled = 'disabled';
nodeList.checked = true;
}
But there is one problem: after page submit Checkbox Group item is null (undefined), but if disabled option is not set - item is not null, is okay. Where is problem?
In details: I have P100_CREATE_PT Checkbox Group Item with 3 options. In block JavaScript: Execute when Page Loads, I'm running JavaScript code, when page is loaded, first Checkbox Group option been disabled and checked - that what I need. When page submitted using button, Procesing runs the code: APEX_ERROR.ADD_ERROR(p_message => :P110_CREATE_PT, p_display_location => APEX_ERROR.C_INLINE_IN_NOTIFICATION); and showing error message with empty value (P100_CREATE_PT). And there doesn't matter how many options selected. If option is not disabled, P100_CREATE_PT value been not null.
I can confirm that this doesn't work if the disabled value is the first checkbox. On page submit it does not set the value of the checkbox.
However the value is sent correctly in an on-change dynamic action.
So a workaround is to set a hidden item on change of the checkbox and use that in the page submit.

How to get value from a bar chart on oracle apex when clicking a specific bar?

I have a bar chart on an oracle-apex page, I want to get the value from a bar when I click on it.
How can this be done?
You can create a new Modal Page with one Item to receive the value.
On you Barchart page go to Series -> Link -> select Redirect Page in This aplication-> and choose the target.
In the Link Builder set Page field as your Modal Page Number and Set Items filed name = item in your modal page to receive the value

Use a button to navigate to a different tab

My app has four tabs. The root view controller of the first tab (index zero) is where the log in page pops up as a modalviewcontroller, but a view controller in the fourth tab (index three) is where the log out button is. Is there a way to programmatically set it so that when the logout button is pushed the app transitions to the tab at index zero? I initially tried a push transition, but that made the root view controller of index zero instead show up as a view controller in index three.
If you want to programmatically change the tab, just call
[self.tabBarController setSelectedIndex:index];
In your case create the selector, which will be assigned to the logout button event.
- (IBAction) didClickLogoutButton:(id)sender {
// do some work to log out the user...
[self.tabBarController setSelectedIndex:0];
}
Hope this is what you meant.

how to resign .i.e remove the badge value from the tabba from other tab bar

Can any one help me in this:
I have three tabs, the first is message tab, the last is home tab.
If i tap button in home view, it should take me to 'message' tab. This is working fine.
But when i have a badge value in 'message' tab , badge value is not removed when the tab is shifted to 'messages'.
Thanks in advance.
When you set the value on a UITabBarItem like this;
[tabBarItem setBadgeValue:#"2"];
You can remove it like this;
[tabBarItem setBadgeValue:nil];
P.S: Please consider adding more tags (such as ios, iphone, cocoa-touch, etc) to your future posts.

CHtmlView class and focus

I am having Dialog Box Application written in MFC.
Dialog is having 3 child controls on it.
2 Buttons (Button 1 & Button 2) and a HTML Control (Class derived from CHtmlView)
HTML Control has been navigated to a HTML page having 2 checkboxes (Check Box 1 & Check Box 2).
Control Z-Order for focus should be like:
Button 1
Button 2
HTML Control then again Button 1
When focus goes to HTML Control. I want it to set to Check Box 1 & then after pressing tab it will be set to Check Box 2.
But When I press tab while the focus in on Check Box 2, I want it to set to Button 1.
i.e.
I want focus cycle like : Button 1 -> Button 2 -> Check Box 1 in HTML Control -> Check Box 2 in HTML Control -> then again Button 1
Problem:
When the focus is set to HTML Control, it doesn't get set to Check Box 1 and after pressing tab while focus is on Check Box 2 focus doesn't
come back to Button 1.
Let me know if question is not descriptive enough, I will simplify it more.
Appreciate your time.
I can't test it but you may try to add the WS_EX_CONTROLPARENT style to the HTML control.
int OnInitDialog(...)
{
HWND html = GetDlgItem(dialog, ID_HTML);
DWORD ex_style = GetWindowLong(html, GWL_EXSTYLE);
SetWindowLong(html, GWL_EXSTYLE, ex_tyle | WS_EX_CONTROLPARENT);
return 0;
}
I hope it works.