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

alloy:form

Form is a UIForm component that renders a <form> element. Since it extends HtmlForm, it supports all the features of h:form.

View Params Usage

View Parameters can be automatically included in full-page postbacks by setting includeViewParams=true.
The action attribute of the rendered <form> (shown below) contains view parameters in the query-string.
action=https://faces.uat.liferay.dev/fi/alloy-showcase/-/alloy-tag/alloy/form/view-params?p_p_lifecycle=1&p_auth=p45vEUZD

Source Code

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:alloy="http://liferay.com/faces/alloy"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<alloy:outputScript use="event">
A.on('domready', function () {
document.getElementById('#{attributeValue.clientId}').innerHTML =
'action=' + document.getElementById('#{myForm.clientId}').action;
});
</alloy:outputScript>
<alloy:form binding="#{myForm}" includeViewParams="true">
<alloy:messages globalOnly="true" />
<alloy:outputText escape="false" value="#{i18n['form-action-attribute-view-params-description']}" />
<alloy:outputText id="attributeValue" binding="#{attributeValue}" />
</alloy:form>
</ui:composition>
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@RequestScoped
@ManagedBean
public class FormBackingBean {
public void submit() {
FacesContext facesContext = FacesContext.getCurrentInstance();
FacesMessage facesMessage = null;
if (facesContext.getPartialViewContext().isAjaxRequest()) {
facesMessage = new FacesMessage("The form was submitted via Ajax and re-rendered with updates to the DOM.");
}
else {
facesMessage = new FacesMessage(
"The form was submitted as a full page postback and the entire page was re-rendered.");
}
facesContext.addMessage(null, facesMessage);
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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