.NET MAUI Dynamic Tab page - .net-maui

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
}

Related

Not allowed to load local resource when opening chrome:// UI page from a chrome extension

I have a MV2 Chrome extension that on the popup page I added a "Shortcut" link so that user can access chrome://extensions/shortcuts by clicking it.
However, after upgrading to MV3, the link doesn't work.
Should I simply remove this feature?
You can resolve this issue by opening the page programmatically.
add some suitable selector to the link (popup html):
Configure Commands
add an event listener to open the shortcuts page (in popup script):
// get the DOM node
const link = document.getElementById("commands-link");
// add click event handler that opens the shortcuts page
link.addEventListener('click', () => chrome.tabs.create({
url: "chrome://extensions/configureCommands"
}));

Using the Existing Redirection to an External URL

How do you use redirection on Acumatica mobile xml or msdl to redirect to an external link?
All I could find is If an action on an Acumatica ERP form provides redirection to an external URL, you can map the action to use it in the mobile app. To do this, you need no additional attributes in the action object. However, the redirect attribute of the tag must be set to True, as shown in the following example.
Thanks
There may be other ways, but from the new T410 course for MSDL in 2018R2, you need to do a couple of steps. (Got this at Acumatica Summit 2018 Web Services course - Lesson 6 in the training guide which should be available soon if not already.)
First, define a new toolbar button on the form for your external link
(This example is for the SO303000 screen)
public PXAction<AR.ARInvoice> TestURL;
[PXButton(CommitChanges=true)]
[PXUIField(DisplayName = "TestURL")]
protected void testURL(){
throw new PXRedirectToUrlException(
"http://www.acumatica.com",
"Redirect:http://www.acumatica.com"
)
}
After publishing your project, go back to the Customization Project in the Mobile Application section to map the button. Add this to the commands section of the page as shown in the following example.
add container "InvoiceSummary" {
add field …
add recordAction "TestURL" {
behavior = Void
redirect = True
}
}
Not sure if this answered your question as you pretty much had the MSDL code listed, so maybe it is a matter of where you placed your code within the mobile definition? In the training class, we placed it inside the container where we wanted the link which then appears on the menu on the mobile app when viewing that container.

share point office 365 Get global navigation setting value in javascript file

We have developed an internal portal with multiple subsites using sharepoint office 365. We created our own page layouts/masterpage for the sites and most of the things like menu's, page body and page logos are customized(unique for all sites/subsites).
Each page has a header logo and a url assigned to that logo(logo describes site or subsite name). We have written a javascript file to load these logo and url and calling on the masterpage. Now the problem is these logo and link should load based on Global navigation
Example:
If the site is using the same navigation items as the parent site?
Yes - pull logo and link from site above
No - pull logo and link according to site name
if i get the GlobalNavigation setting value then i can do this in javscript file. Is there a way to get this GlobalNavigation setting value in javascipt file? I googled on this but didn't get enough information.
Thanks in advance,
Amarnath
--------UPDATED-------
I am using the below code but getting error "sp.runtime.js:2 Uncaught Error: The property or field 'Source' has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested"
used code
var ctx = SP.ClientContext.get_current();
var web = ctx.get_web();
//Navigation Provider Settings for Current Web.
var webNavSettings = new SP.Publishing.Navigation.WebNavigationSettings(ctx, web);
//Global Navigation (Top Navigation Bar)
var navigation = webNavSettings.get_globalNavigation();
navigation.set_source(1);
webNavSettings.update();
ctx.executeQueryAsync(onSuccess, onFailure);

Need to have an aspx page with a Feature in SharePoint 2010

I have added a custom button to the server ribbon in SharePoint (I have used a feature with Farm scope, so that the button is visible throughout the various site collections).
For the elements of the feature, I have added a CustomUIExtension through which I want to load an aspx page on the click of the button.
<CommandUIHandler
Command="Test_Button"
CommandAction="javascript:
function demoCallback(dialogResult, returnValue)
{
SP.UI.Notify.addNotification('Operation Successful!');
SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
}
var options = {
url: '/_layouts/CustomPage.aspx',
tite: 'Custom Page',
dialogReturnValueCallback: demoCallback };
SP.UI.ModalDialog.showModalDialog(options);"
/>
I have added the CustomPage.aspx and its corresponding code behind class to the 14 hive (inside 14/TEMPLATE/LAYOUTS). However when I install the feature and click the button, I get an error saying "Cannot load CustomPage".
I understand that I haven't deployed the assembly, but shouldn't the aspx page be compiled Just In Time?
I guess your .aspx file is looking for the assembly (.dll) and not the .cs from which it is inheriting currently in the .aspx file.
Please put your assembly in the bin folder of your application and remove the inherits tage from your .aspx page

Sharepoint 2007: Adding a link to left nav bar?

I have a document library in a sub site. How do I add a link to that library into the root site's left navigation bar?
Dynamic or static links are fine.
Assuming you mean the Quick Launch (which is the left-side navigation shown in most non-application pages), then click "Site Actions", and choose "Site Settings". Under "Look and Feel", pick "Quick Launch". You can add the sub site's document library as a heading of its own, or as a link underneath any heading (it really doesn't matter too much outside of design perspective). This method is best for static links, of course.
The Quick Launch is not restricted to the current site: you can link any external URL you have. The document library of the subsite, basically, is treated as an external URL to the root site. Just make sure you use the full URL, then there's no chance for failure.
This should do it, if you want to do it programmatically:
using (SPSite site = new SPSite("http://localhost"))
{
using (SPWeb web = site.OpenWeb())
{
var navigationNode = new SPNavigationNode("stackoverflow","http://www.stackoverflow.com", true);
web.Navigation.QuickLaunch.AddAsLast(navigationNode);
web.Update();
}
}

Resources