There currently appears to be a bug in Pug/Jade, in which <menuitem> is treated as self-closing, when in reality, they need to be closed. I've submitted the issue to the GitHub repo, and am awaiting a response/fix, but in the meantime, is there a viable alternative?
This is my contextmenu.pug file:
menu#main(type="context", label="")
menu(label="Visit me on...")
menuitem(label="LinkedIn")
menuitem(label="Twitter")
menuitem(label="Github")
menuitem(label="Stack Overflow")
menuitem(label="Email")
menuitem(label="Go Home")
The HTML is rendered as:
<menu id="main" type="context" label="">
<menu label="Visit me on...">
<menuitem label="LinkedIn">
<menuitem label="Twitter">
<menuitem label="Github">
<menuitem label="Stack Overflow">
<menuitem label="Email">
</menu>
<menuitem label="Go Home">
</menu>
Whereas, I would like all the menuitem tags to close with a </menuitem>. Otherwise, this would cause LinkedIn to be the only option that appears under "Visit me on..." The closest example I could find to this was this StackOverflow question, which suggested using plain HTML, and while this works, I am wondering if there is a Pug-only alternative. Is there a setting somewhere that determines which tags are self-closing? Or has there been a better alternative to forcing a closing tag since that question?
In case it matters, I'm using the Express.js framework, and recently updated from Jade (The issue existed before the migration).
GitHub Issue
You can write the menuitems as plaintext:
menu#main(type="context", label="")
menu(label="Visit me on...").
<menuitem label="LinkedIn"></menuitem>
<menuitem label="Twitter"></menuitem>
<menuitem label="Github"></menuitem>
<menuitem label="Stack Overflow"></menuitem>
<menuitem label="Email"></menuitem>
<menuitem label="Go Home"></menuitem>
https://pugjs.org/language/plain-text.html
Related
I have just recently started using .Net MAUI. But now I'm wondering how to use a piece of code, e.g. a self-made navigation bar on all my pages, because it doesn't make sense to write the same code on all 10 pages. I like to know if there is a way to create a component that can be reused like in React or Angular?
PS: This question is not specific to a navigation bar but to the general reuse of code in .NET MAUI.
I have so far watched various videos & articles on this topic, however, it is more about custom controls and did not help me. Most articles corresponded to what was conveyed in this video. I also came across this article, but it didn't help me either.
Thanks for your help :)
First, you can create a new .xaml file named Name.xaml. You can write some codes in it.
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="CusComponents.Name">
<ContentView.Content>
<StackLayout Padding="10">
<Label Text="Name" FontAttributes="Bold" />
<Label Text="First name" />
<Entry x:Name="FirstName" Placeholder="First name" />
<Label Text="Last name" />
<Entry x:Name="LastName" Placeholder="Last name" />
</StackLayout>
</ContentView.Content>
</ContentView>
Second, you can use it in the page you want like this. You need to add an xmlns reference to the top of the XML file– this is like a using statement in a C# file. Using the namespace structure for the sample project, this will be xmlns:custom_components="clr-namespace:CusComponents".
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:custom_components="clr-namespace:CusComponents"
x:Class="CusComponents.MainPage">
<custom_components:Name />
</ContentPage>
Here is the view of the code:
Im running 2016 Standalone Excel (32bit version). I've been building a custom ribbon and so far so good. The documentation is pretty fluid and well written. However, I cant find any way to include menu 'section titles' as seen below:
Specifically referencing section titles like in the picture (i.e., 'Cell size', 'Visibility' etc). I've seen other Add-Ins emulate this, unless they are COM Add-Ins. Here is the documentation I reference: https://msdn.microsoft.com/en-us/library/dd911038(v=office.12).aspx
Is it out of date? I've tried adding 'Menu with Title' to my project but that doesn't even work. I've also tried adding <labelControl /> , and the ribbon doesn't even load when the labelControl is within a Menu.
Additionally, my version of Excel won't even display a <dialogBoxLauncher> so I'm concerned some things just aren't compatabile with my Excel version to begin with. I'm following the documentation easily and everything else has worked just fine. I even have a editBox in the ribbon I use and don't run into any 91 errors with it. So I know it's not me.
Can anyone duplicate this with the provided API? My ribbon is structured with XML, so I've reduced as much error potential as possible, is that my problem? Should there be run-time code implemented specifically for section titles?
Short snippet of my setup
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnRibbonLoad">
<ribbon>
<tabs>
<tab idMso="TabHome">
<group id="GroupTextTools" insertAfterMso="GroupFont" label="Text Tools">
<gallery id="textcase_gallery" label="Case Select" columns="1" size="large" imageMso="WordArtInsertDialogClassic" onAction="TextCase_SwitchCase" >
<item id="textcase_CapsButton" imageMso="TextAllCaps" label="Uppercase" screentip="Changes selected cells to all uppercase" />
<item id="textcase_ProperButton" label="Propercase" imageMso="ChangeCaseDialogClassic" screentip="Changes selected cells to proper case" />
<item id="textcase_LowerButton" label="Lowercase" imageMso="FontSizeDecrease" screentip="Changes selected cells to all small case" />
</gallery>
</group>
</tab>
<tab id="CustomTab" label="*removed*" insertAfterMso= "TabDeveloper">
<!--
GROUP A
-->
<group id="GroupFileOptions" label="File Options">
<button id="fileoptions_CloseButton" label="Close && Reopen" onAction="RunMacro" imageMso="SourceControlCheckIn" size="large" screentip="Saves Document, Closes && Reopens immediately"/>
<menu id="exportingmenu" label="Exporting" imageMso="FileCheckOut" size="large" screentip="Exporting Options">
<menu id="exportmenu_AsRange" label="As Range"> <!-- This is where I would like section Titles to be instead of another menu -->
<button id="exportmenu_range_CSVCButton" label="To CSV w/commas"/>
<button id="exportmenu_range_CSVSButton" label="To CSV w/spaces"/>
<button id="exportmenu_range_PDF" label="To PDF"/>
</menu>
<menu id="exportmenu_AsSheet" label="As Sheet"> <!--Goal is for this to be a section title, where I tried putting a <labelControl> -->
</menu>
</menu>
</group>
<!-- .... -->
</tab>
</tabs>
</ribbon>
</customUI>
After some trial and error, and an involuntary push from David Zemens by troubleshooting my errors, I've found that by cross referencing all the things I've tried with their Parent Elements, the only one that makes logical compiling sense is a <menuSeparator>, which just so happens to have a 'title' attribute. So by setting that you get a beautiful section title as shown:
<menuSeparator id="someID" title="Test title"/>
I managed to put a menu title only on a dynamicMenu via the getContent callback, which means the xml is defined in VBA as a piece of xml string, not in the customUI xml.
Most comprehensive documentation that I found so far on customUI interfaces is on https://msdn.microsoft.com/en-us/library/dd911038(v=office.12).aspx, however the references are pointing only to 2007. This link contains a much more extensive list of controls and options with extra controls for Access as well http://www.accessribbon.de/en/?Access_-_Ribbons:Ribbon_XML___Controls
I got a problem with creating a menu on a page contains tabs (tabgroups). When i insert the menu's code in a simple window, it works fine. But when i insert the same code on a tabgroup, no menu appears when running. I searched about this problem and it seems that the ancien version of SDK not supported menus on a tabgroups.
anyone can help me about this ?
this is my code:
<Alloy>
<TabGroup id="mainTabGroup">
<Tab id="tab3" onClick="getTodoList">
<Window id="readWin">
<Menu id="menu">
<MenuItem id="settingitem" onClick="doAction" title="Settings" showAsAction="Ti.Android.SHOW_AS_ACTION_ALWAYS">
<MenuItem id="calitem" onClick="doAction" title="Calendar" showAsAction="Ti.Android.SHOW_AS_ACTION_NEVER">
<MenuItem id="logitem" onClick="doAction" title="Logout" showAsAction="Ti.Android.SHOW_AS_ACTION_NEVER">
</Menu>
<TableView id="tableView" onClick="doSomething"/>
</Window>
</Tab>
</TabGroup>
</Alloy>
I think your showAsAction should be :
showAsAction="Ti.Android.SHOW_AS_ACTION_ALWAYS"
I'm using ofbiz framework to develop. But I'm confused with method of a link tag. Because security reasons, I don't want to display value of parameter in address of addressbar. In fact, I'm usually use method="post" for a a tag, but in ofbiz I don't know what attribute can do it. How can I do in this case ?
My resolution is:
I use a form element instead of using a link element because forms use post as the default method:
If my link element is:
<link target="myTarget">
<parameter param-name="myParameter" from-field="myField"/>
</link>
My form element will be:
<form name="myForms" type="single" target="myTarget">
<field name="myField" parameter-name="myParameter">
<hidden></hidden>
</field>
<field name="mySubmitButton" title="${uiLabelMap.myButtonTitle}">
<submit button-type="button"/>
</field>
</form>
I have an xPage with this content:
<div class="lotusFrame">
<xc:layoutCommonBanner />
<xp:callback facetName="facetTitleBar" id="callbackTitleBar" />
<xc:layoutDiscrepancyPlaceBar />
<div class="lotusMain">
<div class="lotusColLeft">
<xp:callback facetName="facetColLeft" id="callbackColLeft" />
</div>
<div class="lotusColRight">
<xp:callback facetName="facetColRight" id="callbackColRight" />
</div>
<div class="lotusContent">
<xp:callback facetName="facetContent" id="callbackContent" />
</div>
</div>
<xc:layoutCommonFooter />
<xc:layoutCommonLegal />
</div>
As you can see, there are several custom controls in it composing layout. In the facetContent, there is a document with document datasource. It's the only document in the page. I need to get this document somehow in the layoutDiscrepancyPlaceBar custom control.
I found some old articles on the web with undocumented feature called currentDocument. It should be on every page with document datasource. But it doesn's work. I have Domino 8.5.2 and currentDocument seems to be no longer supported.
Can you help me out? How can I get document datasource from one custom control in another custom control. Is it even possible?
Thanks in advance, Jiří
EDIT: OK, it is still supported, but it only works in custom control, that is included inside the one with document datasource. In the case scenario above it doesn't work.
Your best option is to hand over the binding name in a custom property. (lets call it bindto. Then you bind your field to
"${#{"+compositeData.bindto+"}}"
See details here (inside the prezi)
P.S. currentDocument is documented somewhere.
You can also pass a handle on the data source directly to the custom control, as well as the name of the item to bind to on the data source. Because EL supports array syntax as well as dot syntax, this allows you to define expressions like this:
#{compositeData.dsn[compositeData.fieldName]}
(where "dsn" is the property being passed the handle on the data source, and "fieldName" is the property being passed the name of the item to bind to on that data source.)
More details on this approach can be found here.