I have created a RootViewController class. In this class, i have events listening for user logging success and then present view controller to login page. It works fine when the application starts because i put RootViewController class to windows.RootViewController property, The issue is - i have a logout button as a bar item on the next page after successfully login. When i click on logout button, i dismiss the current view controller and then try to present the RootViewController again so that RootViewController class can present the login screen back again to the user. But, when i touch the logout button then just white blank screen shows up instead of login page. On the console, it outputs the below warning messages. I just want to add that it was working fine in iOS 7.0 but after updating Xamarin to iOS 8.0 then i start having this issue.
Warning: Attempt to present on whose view is not in the window hierarchy!
I solved this issue. My code for redirecting to login page in the RootViewController has to be in the ViewWillAppear Method. Earlier, I only had this in the ViewDidLoad method. Then, I figured out that ViewDidLoad execute only once in the app load but ViewWillAppear work on evey
Related
I am having issue to implement dynamic tab page in .NET MAUI project. Can we add tabs into Navigation page at runtime to open Webpage. I am trying to implement functionality model like Chrome or Edge to open web URLs in separate tab.
Can we add tabs into Navigation page at runtime to open Webpage
What does the webpage mean? At first, if you want to add a new tab into the TabbedPage when the user operates in the child page, you can use the the following code in the child page:
var tabbedpage = this.Parent as TabbedPage;
tabbedpage.Children.Add(new ChildPage());
And then if the ChildPage just have a webview in it and you want to add a new tab when the webview navigates to a new url. You can add a Navigating event to the webview and pass the url to the child page.
Update
You can create a construction method which has a parameter for the ChildPage, such as:
public ChildPage(string url)
{
//use the url here
}
If we press login, and do log in process successful then login button remove from Navbar and Log out button displayed but problem is that when we press log out then log out working successfully but after pressing logout still logout is there in Navbar instead of showing Login (If we refresh then working properly)
not sure what code have you written just follow below approach:
First create a state(default value false) as shown below:
let [authenticated, setauthenticated]= React.useState(false);
when your user successfully logged in then just update that state to true as shown below:
setauthenticated(true)
In JSX just check if the user is authenticated the show them Logout component otherwise signup/login according to your requirement
{authenticated ? <Logout/> : <Signup/> }
I'm using the Debut theme on my Shopify site and have an issue with the hamburger menu button not working. It will work once but when I navigate to a new page nothing happens when I press the button again. When the page loads the following message is shown on the console for theme.js:
TypeError: $.debounce is not a function. (In '$.debounce(50, function() {
styleDropdowns($(selectors.siteNavHasDropdown));
positionFullWidthDropdowns();
})', '$.debounce' is undefined)
If I manually empty caches through the browser and reload the page the error no longer appears in the console and the button works again. However, once I navigate away from the page the issue returns.
Any help would be greatly appreciated.
Check to see if you have your JS files included on all pages
I am using Flutter for developing a website. Everything is working fine with Flutter except when it comes to reloading the page. When I press the refresh button in the browser, the whole web app gets reloaded.
For example, if I have navigated to four pages from the initial page, when I press the refresh button from the fourth page, the initial page gets loaded and I'll have to manually browse all the way to the fourth page again.
Is there any way to load the currently active page in Flutter?
Or you can just use this as it refreshes the whole window natively
import 'dart:html' as html;
html.window.location.reload();
Check out navigation with named routes as it maps URLs seamlessly when using Flutter Web.
EDIT : If you want URL parameters (like an id, a token...), check out this article.
Use Navigator to push to the same page. .ie.
If CurrentPage() is your page that needs to be refreshed then use:
Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => CurrentPage()));
This will reload the page.
import 'dart:html' as html;
html.window.location.reload();
as this is not allowed according to
https://dart-lang.github.io/linter/lints/avoid_web_libraries_in_flutter.html
this is how i have resolved my issue:
import this package
https://pub.dev/packages/universal_html/install
import whereever you want to use
import 'package:universal_html/html.dart' as html;
and you can use it like this
html.window.location.reload();
I'm working on Rails(3.1.3) with Netzke(0.7.3).
I very new for Cucumber.
add_account_for_user.feature
Feature: Add Account For User Feature
In order to add login account
As an Administrator
I want to add login account for other role
Scenario: Adding Login Account
When I login as an Administrator
Then I should be on admin page
When I click on 'Administration' button at right upper of page
Then I should see 'Administrator Management'
And I should see 'Add' button in Administrator Management toolbar
When I click on 'Add' button
Then I wait 10 seconds # for check what happen
The problem is at When I click on 'Add' button step.
It pass but not working correctly. (It should fire event onAddInForm)
It's hanging in loading and do not show new windows panel.
my_steps.rb
Then /^(?:|I )click on '(\w*)'(?:|.*)$/ do |label|
click_link_or_button(label)
step "wait for the response from sever"
end
When /^(?:|I )wait for (?:.*)$/ do
page.driver.browser.execute_script(<<-JS)
JS
end
Found the solution!!
The solution is try to collect Component that you use. and then call that action directly.
When /I press 'Add' button in the '(\w*)' grid$/ do |grid_name|
page.driver.browser.execute_script <<-JS
var containerComp = Ext.getCmp("main_container");
var grid = containerComp.down("#"+"#{grid_name.underscore}_grid");
grid.onAddInForm();
JS
end
But I still don't understand why it not call onAddInForm after click.