Author: phuong_vu
Date: 2010-10-28 03:54:19 -0400 (Thu, 28 Oct 2010)
New Revision: 4866
Modified:
portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl
portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UILoginForm.java
Log:
GTNPORTAL-1544 Always show Loading Progress bar when click Discard button on SignIn form
Modified:
portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl
===================================================================
---
portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl 2010-10-28
07:06:34 UTC (rev 4865)
+++
portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/UILoginForm.gtmpl 2010-10-28
07:54:19 UTC (rev 4866)
@@ -22,22 +22,20 @@
<div class="MiddleRightLoginDecorator">
<div class="LoginDecoratorBackground">
<div class="LoginDetailBox">
- <% uiform.begin(); %>
- <!--<form class="UIForm" id="$uicomponent.id"
name="loginForm" action="<%= rcontext.getRequestContextPath() +
"/login"%>" method="post" style="margin: 0px;">
- <input type="hidden" name="<%= uiform.ACTION %>"
value=""/>-->
+ <form class="UIForm" id="$uicomponent.id"
name="loginForm" action="<%= rcontext.getRequestContextPath() +
"/login"%>" method="post" style="margin: 0px;">
<input type="hidden" name="initialURI"
value="<%=session.getAttribute("initialURI"); %>"/>
<div class="VerticalLayout">
<table class="UIFormGrid">
<tr class="UserNameField">
<td
class="FieldLabel"><%=_ctx.appRes("UILoginForm.label.UserName")%></td>
- <td><% uiform.renderChild(0)%></td>
+ <td><input class="UserName"
name="username"/></td>
</tr>
<tr class="PasswordField" id="UIPortalLoginFormControl"
onkeypress="eXo.portal.UIPortalControl.onEnterPress(event)">
<td
class="FieldLabel"><%=_ctx.appRes("UILoginForm.label.password")%></td>
- <td><% uiform.renderChild(1)%></td>
+ <td><input class="Password" type="password"
name="password"/></td>
</tr>
<tr class="RememberField"
onkeypress="eXo.portal.UIPortalControl.onEnterPress(event)">
- <td class="FieldLabel"><%
uiform.renderChild(2)%></td>
+ <td class="FieldLabel"><input type="checkbox"
class="checkbox" value="true"
name="rememberme"/></td>
<td><%=_ctx.appRes("UILoginForm.label.RememberOnComputer")%></td>
</tr>
</table>
@@ -69,7 +67,7 @@
</table>
</div>
</div>
- <%uiform.end()%>
+ </form>
</div>
</div>
</div>
@@ -84,7 +82,6 @@
<script>
function login(ele) {
var formEle = eXo.core.DOMUtil.findAncestorByTagName(ele,'form');
- formEle.action = eXo.env.portal.context + "/login";
formEle.submit();
}
</script>
Modified:
portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UILoginForm.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UILoginForm.java 2010-10-28
07:06:34 UTC (rev 4865)
+++
portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UILoginForm.java 2010-10-28
07:54:19 UTC (rev 4866)
@@ -20,17 +20,13 @@
package org.exoplatform.portal.webui.login;
import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
-import org.exoplatform.web.login.InitiateLoginServlet;
+import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.form.UIForm;
-import org.exoplatform.webui.form.UIFormCheckBoxInput;
-import org.exoplatform.webui.form.UIFormStringInput;
-import org.exoplatform.webui.form.validator.MandatoryValidator;
/**
* Created by The eXo Platform SARL
@@ -38,26 +34,16 @@
* nhudinhthuan(a)exoplatform.com
* Jul 11, 2006
*/
-@ComponentConfig(lifecycle = UIFormLifecycle.class, template =
"system:/groovy/portal/webui/UILoginForm.gtmpl", events = {
+@ComponentConfig(template = "system:/groovy/portal/webui/UILoginForm.gtmpl",
events = {
@EventConfig(phase = Phase.DECODE, listeners =
UIMaskWorkspace.CloseActionListener.class),
@EventConfig(phase = Phase.DECODE, listeners =
UILoginForm.ForgetPasswordActionListener.class)})
-public class UILoginForm extends UIForm
+public class UILoginForm extends UIComponent
{
- final static String USER_NAME = "username";
- final static String PASSWORD = "password";
-
public UILoginForm() throws Exception
{
- addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME,
null).addValidator(MandatoryValidator.class))
- .addUIFormInput(
- new UIFormStringInput(PASSWORD, PASSWORD,
null).setType(UIFormStringInput.PASSWORD_TYPE).addValidator(
- MandatoryValidator.class));
- addUIFormInput(new
UIFormCheckBoxInput<String>(InitiateLoginServlet.COOKIE_NAME,
- InitiateLoginServlet.COOKIE_NAME, Boolean.TRUE.toString()));
}
- //TODO: dang.tung - forget password
static public class ForgetPasswordActionListener extends
EventListener<UILoginForm>
{
public void execute(Event<UILoginForm> event) throws Exception
@@ -68,4 +54,18 @@
event.getRequestContext().addUIComponentToUpdateByAjax(uiLogin);
}
}
+
+ @Override
+ public void processDecode(WebuiRequestContext context) throws Exception
+ {
+ super.processDecode(context);
+ String action = context.getRequestParameter(context.getActionParameterName());
+ Event<UIComponent> event = createEvent(action, Event.Phase.DECODE, context);
+ if (event != null)
+ {
+ event.broadcast();
+ }
+ }
+
+
}
Show replies by date