Author: phuong_vu
Date: 2010-06-13 23:39:48 -0400 (Sun, 13 Jun 2010)
New Revision: 3315
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java
Log:
GTNPORTAL-1037 fix UICaptcha and refresh ui when register form input is invalid
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2010-06-14
03:10:03 UTC (rev 3314)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2010-06-14
03:39:48 UTC (rev 3315)
@@ -103,6 +103,7 @@
HttpServletRequest request = prContext.getRequest();
HttpSession session = request.getSession();
session.removeAttribute(Captcha.NAME);
+ context.addUIComponentToUpdateByAjax(getChild(UIRegisterInputSet.class));
}
}
@@ -124,11 +125,11 @@
{
//TODO: Send email and add Account Activating feature
UIApplication uiApp = context.getUIApplication();
- uiApp.addMessage(new
ApplicationMessage("UIRegisterForm.registerWithSuccess.message", null));
- HttpServletRequest request = prContext.getRequest();
- HttpSession session = request.getSession();
- session.removeAttribute(Captcha.NAME);
+ uiApp.addMessage(new
ApplicationMessage("UIRegisterForm.registerWithSuccess.message", null));
}
+ HttpServletRequest request = prContext.getRequest();
+ HttpSession session = request.getSession();
+ session.removeAttribute(Captcha.NAME);
}
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java 2010-06-14
03:10:03 UTC (rev 3314)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java 2010-06-14
03:39:48 UTC (rev 3315)
@@ -22,6 +22,8 @@
******************************************************************************/
package org.exoplatform.portal.webui;
+import java.util.Calendar;
+
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.form.UIFormStringInput;
@@ -38,9 +40,11 @@
}
public void processRender(WebuiRequestContext context) throws Exception
- {
- context.getWriter().write("<img src=\"" +
context.getPortalContextPath() + "/captcha\" /><br/>");
+ {
+ context.getWriter().write("<div id='" + getId() +
"'><img src=\"" + context.getPortalContextPath() +
"/captcha?v=" +
+ Calendar.getInstance().getTimeInMillis() + "\"
/><br/>");
super.processRender(context);
+ context.getWriter().write("</div>");
}
}
Show replies by date