Button/Link
Data
Input
Miscellaneous
Multimedia
Output
Panel
Select
JSTL
Faces Core
Facelets
Extensions

alloy:inputTime

InputTime is a UIInput component that renders an <input type="text"> element and a list popover with selectable times. The component attempts to automatically convert the submitted value to a Date via a built-in DateTimeConverter.

General Usage

The showOn attribute specifies which events will popup the list of selectable times. When nativeWhenMobile=true (the default), then the component will render an HTML5 <input type="time" /> element on small/mobile displays in order to enable selection of a time with the mobile device's native UI.



Source Code

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:alloy="http://liferay.com/faces/alloy"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core" xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<!-- Example 1: Specifying showOn="focus" (the default) -->
<alloy:form>
<alloy:field label="#{i18n['time']}">
<alloy:inputTime id="time"
required="#{showcaseModelBean.selectedComponent.required}" pattern="hh:mm a"
value="#{inputDateModelBean.birthday}" />
<alloy:message for="time" />
</alloy:field>
<hr />
<alloy:commandButton render="@form" value="#{i18n['submit']}" />
<alloy:outputText id="modelValue" value="#{inputDateModelBean.birthday}">
<f:convertDateTime pattern="hh:mm a" />
</alloy:outputText>
</alloy:form>
<c:if test="#{!browserSniffer.mobile}">
<!-- Example 2: Specifying showOn="button" -->
<alloy:form>
<alloy:field label="#{i18n['time']}">
<alloy:inputTime id="time" showOn="button"
pattern="hh:mm a" value="#{inputDateModelBean.birthday}" />
<alloy:message for="time" />
</alloy:field>
<hr />
<alloy:commandButton render="@form" value="#{i18n['submit']}" />
<alloy:outputText id="modelValue" value="#{inputDateModelBean.birthday}">
<f:convertDateTime pattern="hh:mm a" />
</alloy:outputText>
</alloy:form>
</c:if>
<c:if test="#{!browserSniffer.mobile}">
<!-- Example 3: Specifying showOn="both" -->
<alloy:form>
<alloy:field label="#{i18n['time']}">
<alloy:inputTime id="time" showOn="both"
pattern="hh:mm a" value="#{inputDateModelBean.birthday}" />
<alloy:message for="time" />
</alloy:field>
<hr />
<alloy:commandButton render="@form" value="#{i18n['submit']}" />
<alloy:outputText id="modelValue" value="#{inputDateModelBean.birthday}">
<f:convertDateTime pattern="hh:mm a" />
</alloy:outputText>
</alloy:form>
</c:if>
</ui:composition>
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@ManagedBean
@ViewScoped
public class InputTimeModelBean implements Serializable {
// serialVersionUID
private static final long serialVersionUID = 7445057510998134124L;
// Private Data Members
private String highlighterType = "charMatch";
private Date time;
private Locale locale;
public String getHighlighterType() {
return highlighterType;
}
public Locale getLocale() {
if (locale == null) {
locale = new Locale("ja", "JA");
}
return locale;
}
public Date getTime() {
return time;
}
public void setHighlighterType(String highlighterType) {
this.highlighterType = highlighterType;
}
public void setTime(Date time) {
this.time = time;
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Liferay Faces Alloy 4.1.1 + Liferay Faces Bridge Implementation 5.0.0 + Showcase Common 4.0.0 + Liferay Faces Util 3.4.1 + Mojarra 2.2.20