How can i open a new route in a new page by clearing the previous homepage link. When i click submit the next page opens below the homepage - vue.js

When i try to open a new route by clicking login button the new page named "hello" opens at the bottom of the login page instead of opening in a new page. How can i fix this?

Related

How to test url of new tab after clicking a link in laravel dusk

I'm testing my website using Laravel Dusk and I want to test a link that open a new tab to check if it goes to the correct URL. My test looks like this;
$this->browse(function (Browser $browser) {
$browser->loginAs(User::find(1))
->visit('/test')
->waitForLocation('/test')
->click('#test-link');
$window = collect($browser->driver->getWindowHandles())->last();
$browser->driver->switchTo()->window($window);
$url = $browser->driver->getCurrentURL();
Assert::assertTrue($url == 'http://foobar.com');
});
The problem here is that the URL that I'm getting is just about:blank. At first, I thought it's because the new tab is still loading but I tried to add a pause(5000) before getting current URL but it still returns about:blank. Why does the new tab doesn't proceed with the URL of the link?

How to handle multiple tabs in cypress

Im coding integration tests in a project with cypress. This is the flow in my projet:
You click at a buy button of a projeto;
When you click, open a new tab in checkout product
Only this, click at a button and open a new tab with the checkout screen. But as we know, cypress dont have suport for multiple tabs, so how can i handle it? What is the way to open this new url in the same tab?
Important to highlight that this button is not wrapped by any a tag, its just a button that when I click has a handleClick that open a new tab and do other stuff. Because of this, none of these https://github.com/cypress-io/cypress-example-recipes/blob/master/examples/testing-dom__tab-handling-links/cypress/integration/tab_handling_anchor_links_spec.js solutions work for me.
I already tried this:
cy.stub(win, "open")
.callsFake((url, target) => {
//#ts-ignore
return win.open.wrappedMethod.call(win, url, "_self");
//#ts-ignore
})
.as("open");
});
but no success.

Vue js 3 pass data beetwen to different pages

I know that vue js is SPA.
But i need 2 different pages.
When you go to main page and you click on chat will open a new window with href traget blank.
Lets call it page A - Home and Page B - Chat.
When you click on showItem on the Page B - Chat it will show the item on page A and will pass some data.
Tab In chrome
http://localhost:8080/chat
...mapGetters("PageA", ["showMessage"]),
Page B - Chat: I have tried VUEX and it didn't work. This code should show alert in page A.
onClickChatShowInPageA() {
this.$store.commit("structures/setShowMessage", true);
}
Page A - Home Page
Tab In chrome http://localhost:8080
showMessage() {
alert("Got it")
},
If you trigger it from the same page it's working great

How to switch Xamarin forms Main Page from Master Details Page to Content Page?

I am working on an Xamarin forms Application. In which on App.cs I check
CrossSecureStorage.Current.HasKey("SessionToken")
then navigate to HomePage() which is a Masterdetailspage and if no security token then I navigate to LoginPage() which is a ContentPage like this
if (CrossSecureStorage.Current.HasKey("SessionToken"))
MainPage = new NavigationPage(new HomePage(true));
else
MainPage = new NavigationPage(new LoginPage(this));
then when user clicked login button I set main page to HomePage() like this
MainPage = new NavigationPage(new HomePage(true));
and when user clicked logout button I set main page to login again like this
CrossSecureStorage.Current.DeleteKey("SessionToken");
MainPage = new NavigationPage(new LoginPage(this));
It works fine when user is already logged out. Login and logout both works fine. But if user was already logged in says
CrossSecureStorage.Current.HasKey("SessionToken")
has value then on logout button press app crashes and got this Exception
System.ArgumentException: Handle must be valid.Parameter name: instance
I figure out that if in App.cs I changed HomePage from MasterDetailsPage to a new ContentPage then on button press change MainPage to HomePage then it works fine but I want to directly show homepage to user. (Means if first page assigned to MainPage is a ContentPage then app works fine but if first page is a MasterDetailsPage then app crashes on reassigning MainPage to any Page.)
Please help.
Thanks in Advance.

How can I call liferay struts action from my own portlet?

I define an editPortletURL
PortletURL redirectURL = renderResponse.createRenderURL();
redirectURL.setWindowState(LiferayWindowState.POP_UP);
redirectURL.setParameter("struts_action", "/asset_publisher/add_asset_redirect");
editPortletURL.setParameter("redirect", redirectURL.toString());
editPortletURL.setParameter("originalRedirect", redirectURL.toString());
editPortletURLString = editPortletURL.toString();
editPortletURLString = HttpUtil.addParameter(editPortletURLString, "doAsGroupId", assetRenderer.getGroupId());
editPortletURLString = HttpUtil.addParameter(editPortletURLString, "refererPlid", plid);
I call the edit_article.jsp from my portlet. I will, if I click on "publish" button, I should be forwarded to the jsp page which is pointed to /asset_publisher/add_asset_redirect struts action.
This action is mapped to the add_asset_jsp. This page fires Liferay.fire (closeWindow) event, which should close the popup window und refresh my portlet.
But If I try to do that - I see my portlet in the popup window...
How can I reference/include Liferay action classes into my own portlet?
If you are working in liferay 6.1 then you can simply use the action-hook to achive your requirment. Please check below links
http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/other-hooks
http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/performing-a-custom-acti-4