Placeholder in Select component - material-ui

I use https://github.com/callemall/material-ui/tree/v1-beta
Can I make a placeholder in the Select component?
<Select
value={value}
onChange={handleChange}
input={<Input />}
>
<MenuItem value={''}>Any</MenuItem>
<MenuItem value={'Male'}>Male</MenuItem>
<MenuItem value={'Female'}>Female</MenuItem>
</Select>
Thanks

You should use FormControl and InputLabel components.
Example from the select component material page:
<FormControl className={classes.formControl}>
<InputLabel htmlFor="age-simple">Age</InputLabel>
<Select
value={this.state.age}
onChange={this.handleChange('age')}
input={<Input id="age-simple" />}
>
<MenuItem value="">
<em>None</em>
</MenuItem>
<MenuItem value={10}>Ten</MenuItem>
<MenuItem value={20}>Twenty</MenuItem>
<MenuItem value={30}>Thirty</MenuItem>
</Select>
</FormControl>
Hope it helps :)

Related

How to move the “Recently Viewed Products” widget in magento2?

I have added the 'Recently viewed products' widget on the product view page(2 columns left). Currently, it's showing below the product info details section. But I want it full width. So I want to move this widget into the main content area or above the footer.
so how to move this section? If anyone knows please let me know.
Thanks.
In vendor/magento/module-catalog/etc/widget.xml you see the containers section. This means the recently viewed products can only be placed in the sidebar main, content and sidebar additional containers.
<widget id="catalog_recently_viewed" class="Magento\Catalog\Block\Widget\RecentlyViewed"
placeholder_image="Magento_Catalog::images/product_widget_viewed.png">
<label translate="true">Recently Viewed Products</label>
<description translate="true">List of Products Recently Viewed by Visitor</description>
<parameters>
<parameter name="uiComponent" xsi:type="text" required="false" visible="false">
<label translate="true">UI Component</label>
<value>widget_recently_viewed</value>
</parameter>
<parameter name="page_size" xsi:type="text" required="true" visible="true">
<label translate="true">Number of Products to display</label>
<value>5</value>
</parameter>
<parameter name="show_attributes" xsi:type="multiselect" required="true" visible="true">
<label translate="true">Product attributes to show</label>
<options>
<option name="name" value="name">
<label translate="true">Name</label>
</option>
<option name="image" value="image">
<label translate="true">Image</label>
</option>
<option name="price" value="price">
<label translate="true">Price</label>
</option>
<option name="learn_more" value="learn_more">
<label translate="true">Learn More Link</label>
</option>
</options>
</parameter>
<parameter name="show_buttons" xsi:type="multiselect" required="true" visible="true">
<label translate="true">Buttons to show</label>
<options>
<option name="add_to_cart" value="add_to_cart">
<label translate="true">Add to Cart</label>
</option>
<option name="add_to_compare" value="add_to_compare">
<label translate="true">Add to Compare</label>
</option>
<option name="add_to_wishlist" value="add_to_wishlist">
<label translate="true">Add to Wishlist</label>
</option>
</options>
</parameter>
<parameter name="template" xsi:type="select" required="true" visible="true">
<label>Template</label>
<options>
<option name="grid" value="product/widget/viewed/grid.phtml" selected="true">
<label translate="true">Viewed Products Grid Template</label>
</option>
<option name="list" value="product/widget/viewed/list.phtml">
<label translate="true">Viewed Products List Template</label>
</option>
<option name="sidebar" value="product/widget/viewed/sidebar.phtml">
<label translate="true">Viewed Products Sidebar Template</label>
</option>
</options>
</parameter>
</parameters>
<containers>
<container name="sidebar.main">
<template name="default" value="sidebar" />
</container>
<container name="content">
<template name="grid" value="grid" />
<template name="list" value="list" />
</container>
<container name="sidebar.additional">
<template name="default" value="sidebar" />
</container>
</containers>
</widget>
You can try adding an etc/widget.xml in a custom module and add containers for the recently viewed widget in the container node. For example in page.top (After Page Header).
<container name="page.top">
<template name="grid" value="grid" />
<template name="list" value="list" />
</container>
In Extending a Magento widget layout within a theme is explained how to extend a widget in the widget xml.

How to put a line break in sapui5 text or input box?

I cant seem to find a way to put the <DatePicker id="DP1" placeholder="Enter Date" value="{/recipient2/name}" change="handleChange" class="sapUiSmallMarginBottom"/> and <Select selectedKey="{/recipient3/name}" id="input-c" forceSelection="false">
in new line. They show at the same line but I would like them in two different lines.
<mvc:View controllerName="Workspace.controller.App" xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc"
xmlns:l="sap.ui.layout" xmlns:f="sap.ui.layout.form">
<Page title="{i18n>homePageTitle}">
<content>
<Panel width="auto" class="sapUiResponsiveMargin">
<Image src="https://www.enggwave.com/wp-content/uploads/2016/11/Sopra-Steria-Logo.png" width="100px" height="100px"
class="sapUiResponsiveMargin"></Image>
<Text text="Plot No. 20 21 Seaview Special Economic Zone"/>
<Image src="https://upload.wikimedia.org/wikipedia/en/thumb/0/02/Sopra_Steria_logo.svg/1280px-Sopra_Steria_logo.svg.png" width="500px"
height="100px" class="sapUiResponsiveMargin"></Image>
</Panel>
<Panel>
<f:SimpleForm id="SimpleFormChange354" width="100%" minWidth="1024" maxContainerCols="2" editable="true" layout="ResponsiveGridLayout"
title="FORM" labelSpanL="3" labelSpanM="3" emptySpanL="4" emptySpanM="4" columnsL="1" columnsM="1" class="editableForm">
<f:content>
<Label text="NAME : " labelFor="input-a" design="Bold"/>
<Input id="input-a" placeholder="Enter Name" value="{/recipient1/name}" valueLiveUpdate="true" width="100%" required="true"/>
<Label text="DATE : " labelFor="input-b" design="Bold"/>
<DatePicker id="DP1" placeholder="Enter Date" value="{/recipient2/name}" change="handleChange" class="sapUiSmallMarginBottom"/>
<InputListItem label="Country" >
<Select selectedKey="{/recipient3/name}" id="input-c" forceSelection="false">
<core:Item key="Greece" text="Greece"/>
<core:Item key="Mexico" text="Mexico"/>
<core:Item key="Norway" text="Norway"/>
<core:Item key="New Zealand" text="New Zealand"/>
<core:Item key="Netherlands" text="Netherlands"/>
</Select>
</InputListItem>
<Button text="{i18n>showHelloButtonText}" press="onShowHello"/>
</f:content>
</f:SimpleForm>
</Panel>
</content>
</Page>
</mvc:View>
Try putting the two in a Vbox
<Vbox>
<DatePicker id="DP1" placeholder="Enter Date" value="{/recipient2/name}"
change="handleChange" class="sapUiSmallMarginBottom"/>
<InputListItem label="Country" >
<Select selectedKey="{/recipient3/name}" id="input-c"
forceSelection="false">
<core:Item key="Greece" text="Greece"/>
<core:Item key="Mexico" text="Mexico"/>
<core:Item key="Norway" text="Norway"/>
<core:Item key="New Zealand" text="New Zealand"/>
<core:Item key="Netherlands" text="Netherlands"/>
</Select>
</InputListItem>
<Button text="{i18n>showHelloButtonText}" press="onShowHello"/>
</Vbox>

SAPUI5 Select Drop Down Icon Missing

I have an odd issue. Here is a Plunker: https://plnkr.co/edit/x8BKd1zA55I7WQBC0mOu?p=preview
The issue is that the icon on the drop down button does not appear when placing a sap.m.Select within a sap.ui.layout.form.SimpleForm. The Plunker includes the same elements on two different panels (sap.m.Panel) but one of the panels has the elements also within a SimpleForm.
Here is the XML:
<Panel>
<Label text="One" />
<Select>
<core:Item text="Celsius" key="C"></core:Item>
<core:Item text="Fahrenheit" key="F"></core:Item>
</Select>
</Panel>
<Panel>
<forms:SimpleForm layout="ResponsiveGridLayout">
<Label text="One" />
<Select>
<core:Item text="Celsius" key="C"></core:Item>
<core:Item text="Fahrenheit" key="F"></core:Item>
</Select>
</forms:SimpleForm>
</Panel>
Any assistance would be appreciated.
Thank you
Just set simpleform as editable=true
<Panel>
<Label text="One" />
<Select>
<core:Item text="Celsius" key="C"></core:Item>
<core:Item text="Fahrenheit" key="F"></core:Item>
</Select>
</Panel>
<Panel>
<forms:SimpleForm editable="true" layout="ResponsiveGridLayout">
<Label text="One" />
<Select>
<core:Item text="Celsius" key="C"></core:Item>
<core:Item text="Fahrenheit" key="F"></core:Item>
</Select>
</forms:SimpleForm>
</Panel>

How to iterativly print label in zk using templates with mvvm style

<window apply="org.zkoss.bind.BindComposer"
viewModel="#id('vm') #init('com.test.labelTest')">
<template <!--model = "#bind(vm.allLabelSets)" some thing like this --> >
<label value="#load(each.label1)" />
<label value="#load(each.label2)" />
<label value="#load(each.label3)" />
</template>
</window>
how can we use template to iterate over a list without using any of gridModel,treeModel ?
Try this below code
<vlayout id="vlayout" children="#bind(vm.allLabelSets) #template('record')">
<template name="record" var="record">
<vlayout style="padding-left:10px; border:2px solid green;" >
<label value="#load(each.label1)" />
<label value="#load(each.label2)" />
<label value="#load(each.label3)" />
</vlayout>
</template>
</vlayout>
You have to use children attribute

Generate Unordered list for asp:menu in ASP.NET 3.5

The asp:menu that I am using is rendering an old table layout. Can someone help me create an unordered list with a nested unordered list for the hover menu. I need the output to render like this:
<ul>
<li>Link</li>
<li>Link</li>
<li>Link</li>
<li>Link
<ul>
<li></li>
</ul>
</li>
</ul>
XML Data feed looks like this:
<SiteMap>
<item Text="(!menu.Home!)" NavigateUrl="default.aspx" LookId="VertTopItemLook"/>
<item Text="(!menu.Categories!)" LookId="VertTopItemLook" />
<item Text="(!menu.Sections!)" LookId="VertTopItemLook" />
<item Text="(!menu.Manufacturers!)" LookId="VertTopItemLook" />
<item Text="(!menu.CustomerService!)" NavigateUrl="t-service.aspx" LookId="VertTopItemLook">
<MenuItem Text="(!menu.YourAccount!)" NavigateUrl="account.aspx" />
<MenuItem Text="(!menu.OrderHistory!)" NavigateUrl="account.aspx" />
<MenuItem Text="(!menu.FAQs!)" NavigateUrl="t-faq.aspx" />
<MenuItem Text="(!menu.PolicyReturns!)" NavigateUrl="t-returns.aspx" />
<MenuItem Text="(!menu.Shipping!)" NavigateUrl="t-shipping.aspx" />
<MenuItem Text="(!menu.Contact!)" NavigateUrl="t-contact.aspx" />
<MenuItem Text="(!menu.PolicyPrivacy!)" NavigateUrl="t-privacy.aspx" />
<MenuItem Text="(!menu.PolicySecurity!)" NavigateUrl="t-security.aspx" />
</item>
</SiteMap>