Embedded Objects - Login

An object of type login is an EntityBackingBean showing a login form. For example, embed a login into a page:

<object xmlns="http://www.cmobilecom.com/af/objects" type="login">
	<viewConfig>
		<propertiesToShow>username,password,rememberUser</propertiesToShow>
	</viewConfig>
</object>
To enable redirect after login to a URL, use entity type. For example,

<object xmlns="http://www.cmobilecom.com/af/objects" type="entity">
	<entityType>System.LOGIN</entityType>
	<mode>CREATE</mode>
	
	<criteriaElements>
		<function name="EQ" property="redirectURL">#{param.redirectURL}</function>
	</criteriaElements>
     
	<viewConfig>
		<viewType>ENTITY</viewType>
		<propertiesToShow>username,password,rememberUser</propertiesToShow>
		<styleClass>ui-login-form</styleClass>
	</viewConfig>
</object>
The redirectURL of the Login Form is set to the value of request parameter redirectURL if any. For example,
	https://www.cmobilecom.com/login.page?redirectURL=%2Fcompany-profile.page

Choice After Login

If both redirectURL and actionMenuNodeSource of LoginForm are null, choiceAfterLogin will be enabled if its select items are not empty.

<object xmlns="http://www.cmobilecom.com/af/objects" type="entity">
	<entityType>System.LOGIN</entityType>
	<mode>CREATE</mode>
	
	<criteriaElements>
		<function name="EQ" property="redirectURL">#{param.redirectURL}</function>
	</criteriaElements>
     
	<viewConfig>
		<viewType>ENTITY</viewType>
		<propertiesToShow>username,password,rememberUser,actionAfterLogin</propertiesToShow>
		<styleClass>ui-login-form</styleClass>
		
		<property name="choiceAfterLogin">
			<renderStyle>
							
				<!-- value: redirect URL without contextPath -->
				<selectItems>
					<selectItem value="/manage.xhtml">Go To Manage Center</selectItem>
					<selectItem value="/products.page">Go To Products Page</selectItem>
					<selectItem value="/pos.mpage">Go To POS Page</selectItem>
				</selectItems>
				
			</renderStyle>
		</property>
				
	</viewConfig>
</object>