Difference between revisions of "Action Tags"
imported>Aeric |
imported>Aeric |
||
Line 34: | Line 34: | ||
|- | |- | ||
|[[#Change Password Tag|Change Password Tag]]|| Renders an HTML form element whose action attribute is assigned to [[Server-Side_Actions#Change_Password|Change Password]] action||<tt><lj:changePassword name="" onError="pages/changePassword.jsp" onSuccess="pages/home.jsp"></tt> | |[[#Change Password Tag|Change Password Tag]]|| Renders an HTML form element whose action attribute is assigned to [[Server-Side_Actions#Change_Password|Change Password]] action||<tt><lj:changePassword name="" onError="pages/changePassword.jsp" onSuccess="pages/home.jsp"></tt> | ||
|- | |||
|[[#Google Login Tag|Google Login Tag]]|| Let a site user login using their Google Email ID ||<tt><lj:login name="loginForm" onError="pages/login.jsp" onSuccess="pages/home.jsp" method="POST" id="loginForm"> | |||
<lj:googlelogin name="googleLoginForm" onError="pages/home.jsp" | |||
onSuccess="pages/ticketList.jsp?fieldList=number,type,subject,status&sortBy=number&page=0&pageSize=25" | |||
method="POST" id="googleLoginForm"> | |||
</lj:googlelogin></tt> | |||
|- | |- | ||
|[[#Login Tag|Login Tag]]|| Renders an HTML form element whose action attribute is assigned to the [[Server-Side_Actions#Login_to_the_site|Login]] action ||<tt><lj:login name="loginForm" onError="pages/login.jsp" onSuccess="pages/home.jsp" method="POST" id="loginForm"></tt> | |[[#Login Tag|Login Tag]]|| Renders an HTML form element whose action attribute is assigned to the [[Server-Side_Actions#Login_to_the_site|Login]] action ||<tt><lj:login name="loginForm" onError="pages/login.jsp" onSuccess="pages/home.jsp" method="POST" id="loginForm"></tt> |
Revision as of 21:47, 8 June 2012
These tags directly map to various platform actions specified in the Actions section. These action tags render an HTML form element.
Common Attributes for Action Tags
All the action tags have some common attributes.
Common Attributes for Action Tags Attribute Type Description onError String Complete or partial relative URL to execute on error of the operation onSuccess String Complete or partial relative URL to execute on success of the operation method String maps to the HTML form element’s method attribute name String Name of the HTML form element which is rendered as a result of this tag preController String Name of the class whose method is executed before the controller is executed preControllerMethod String Method of the class identified by preController, that is executed before the controller is executed. Useful in validations or some pre actions when controller is Platform. prefill Boolean Specifies whether the values should be prefilled for the form elements within this form. Prefill logic first looks at the HttpServletRequest.getParameter("form element"), if the value is present it will render it from there, otherwise it will take it from the value attribute of the form element. This is specifically used for error handling.
Available Action Tags
Action Tag Description Syntax Change Password Tag Renders an HTML form element whose action attribute is assigned to Change Password action <lj:changePassword name="" onError="pages/changePassword.jsp" onSuccess="pages/home.jsp"> Google Login Tag Let a site user login using their Google Email ID <lj:login name="loginForm" onError="pages/login.jsp" onSuccess="pages/home.jsp" method="POST" id="loginForm"> <lj:googlelogin name="googleLoginForm" onError="pages/home.jsp"
onSuccess="pages/ticketList.jsp?fieldList=number,type,subject,status&sortBy=number&page=0&pageSize=25" method="POST" id="googleLoginForm">
</lj:googlelogin>
Login Tag Renders an HTML form element whose action attribute is assigned to the Login action <lj:login name="loginForm" onError="pages/login.jsp" onSuccess="pages/home.jsp" method="POST" id="loginForm"> Logout Tag Renders a URL which points to the Logout action <a href="<lj:logout />">Logout</a> Register Tag Renders an HTML form element whose action attribute is assigned to the Register User action <lj:register name="" onError="pages/register.jsp" onSuccess="pages/home.jsp" prefill="true" method="POST"> Reset Password Tag Renders an HTML form element whose action attribute is assigned to Reset Password action <lj:resetPassword name="" onError="pages/resetPassword.jsp" onSuccess="pages/home.jsp"> Update Profile Tag Renders an HTML form element whose action attribute is assigned to Update Profile action <lj:updateProfile name="" onError="pages/updateProfile.jsp" onSuccess="pages/home.jsp" prefill="true"> Validate Security Question Tag Renders an HTML form element whose action attribute is assigned to the Validate the Security Question action. <lj:validateSecurityQuestion name="" onError="pages/secQuestion.jsp" onSuccess="pages/resetPassword.jsp" prefill="true">
Change Password Tag
Renders an HTML form element whose action attribute is assigned to "change_password" action.
User is expected to supply all the form elements that are expected for this action. Refer to changePassword action.
- Example
<%@taglib prefix="lj" uri="/LJTagLib"%> <lj:changePassword name="" onError="pages/changePassword.jsp" onSuccess="pages/home.jsp"> <table cellpadding="5" cellspacing="0"> <tr> <td class="side-link" ${empty __response ? "" : (__response.code < 0 ? "style=\"color:red\"" : "")} colspan="2"> ${empty __response ? "" : __response.message} </td> </tr> <tr> <td align="left"><b>Old Password</b></td> <td align="left"><lj:password name="old_password" value=""/> </td> </tr> <tr> <td align="left"><b>New Password</b></td> <td align="left"><lj:password name="password" /></td> </tr> <tr> <td align="left"><b>Confirm Password</b></td> <td align="left"><lj:password name="password2" /></td> </tr> <tr> <td align="right"><lj:button submit="true" name="submit" value="Change"/></td> <td align="left"><input type="button" name="button2" id="button2" value="Cancel" onclick="window.location='<lj:url resource="pages/home.jsp"/>'; return false;"/></td> </tr> </table> </lj:changePassword>
Login Tag
Renders an HTML form element whose action attribute is assigned to "login" action.
User is expected to supply all the form elements that are expected for this action. Refer to login action.
- Example
<%@taglib prefix="lj" uri="/LJTagLib"%> <lj:login name="loginForm" onError="pages/login.jsp" onSuccess="pages/home.jsp" method="POST" id="loginForm"> <table border="0" cellspacing="0" cellpadding="5"> <tr> <td class="side-link" ${empty __response ? "" : (__response.code < 0 ? "style=\"color:red\"" : "")} colspan="2"> ${empty __response ? "" : __response.message} </td> </tr> <tr> <td align="left"><b>Username</b></td> <td align="left"><lj:text name="login" id="login" /></td> </tr> <tr> <td align="left"><b>Password</b></td> <td align="left"><lj:password name="password" id="password" /></td> </tr> <tr> <td align="right"><lj:button submit="true" name="submit" id="submit" value="Submit" /></td> <td align="left"><input type="button" name="cancel" value="Cancel" onClick="window.location='<lj:url resource="pages/home.jsp" />';" /></td> </tr> <tr> <td colspan="2" align="left"><a href="<lj:url resource="pages/forgot.jsp" />"> Forgot Your Password</a></td> </tr> </table> </lj:login>
Google Login Tag
Generates a button that allows a site user to login using their Google Email ID. (This tag is typically used in conjunction with the Login Tag, to give site users a choice as to how they log in.)
- Requirement
-
- The Site user's username must be the same as the Google Email address.
- Example
<%@taglib prefix="lj" uri="/LJTagLib"%> <div style="display:inline-block;font-size:14px;font-weight:bold"> <span onclick="document.googleLoginForm.submit();return false;" target="_parent" style="cursor:pointer;">Login Using Google ID</span> </div> <lj:googlelogin name="googleLoginForm" onError="pages/home.jsp" onSuccess="pages/ticketList.jsp?fieldList=number,type,subject,status,date_modified,description&sortBy=number&sortOrder=desc&page=0&pageSize=25" method="POST" id="googleLoginForm"> </lj:googlelogin>
Logout Tag
Renders a URL which points to the logout action.
User is expected to supply all the form elements that are expected for this action. Refer to logout action.
- Example
<%@taglib prefix="lj" uri="/LJTagLib"%> <a href="<lj:logout />">Logout</a>
Register Tag
Renders an HTML form element whose action attribute is assigned to "register" action.
User is expected to supply all the form elements that are expected for this action. Refer to register action.
- Example
<%@taglib prefix="lj" uri="/LJTagLib"%> <lj:register name="" onError="pages/register.jsp" onSuccess="pages/home.jsp" prefill="true" method="POST"> <table width="100%" border="0" cellpadding="0" cellspacing="5"> <tr> <td class="side-link" ${empty __response ? "" : (__response.code < 0 ? "style=\"color:red\"" : "")} colspan="2"> ${empty __response ? "" : __response.message} </td> </tr> <tr> <td align="left"><b>First Name</b></td> <td align="left"><lj:text name="first_name" value="${first_name}"/> </td> </tr> <tr> <td align="left"><b>Last Name</b></td> <td align="left"><lj:text name="last_name" value="${last_name}"/></td> </tr> <tr> <td align="left"><b>Email</b></td> <td align="left"><lj:text name="email" value="${email}"/></td> </tr> <tr> <td align="left"><b>User Name</b></td> <td align="left"><lj:text name="username" value="${username}"/></td> </tr> <tr> <td align="left"><b>Password</b></td> <td align="left"><lj:password name="password"/></td> </tr> <tr> <td align="left"><b>Confirm Password</b></td> <td align="left"><lj:password name="password2"/></td> </tr> <tr> <td align="left"><b>Security Question</b></td> <td align="left"><lj:text name="custom_security_question" value="${custom_security_question}"/></td> </tr> <tr> <td align="left"><b>Security Answer</b></td> <td align="left"><lj:text name="security_answer" value="${security_answer}"/></td> </tr> <tr> <td align="right"><lj:button submit="true" name="submit" value="Register"/></td> <td align="left"><input type="submit" name="button2" id="button2" value="Cancel" onclick="window.location='<lj:url resource="pages/home.jsp"/>'; return false;"/></td> </tr> </table> </lj:register>
Reset Password Tag
Renders an HTML form element whose action attribute is assigned to "reset_password" action.
User is expected to supply all the form elements that are expected for this action. Refer to Reset Password action.
- Example
<%@taglib prefix="lj" uri="/LJTagLib"%> <lj:resetPassword name="" onError="pages/resetPassword.jsp" onSuccess="pages/home.jsp"> <table cellpadding="5" cellspacing="0"> <tr> <td class="side-link" ${empty __response ? "" : (__response.code < 0 ? "style=\"color:red\"" : "")} colspan="2"> ${empty __response ? "" : __response.message} </td> </tr> <tr> <td align="left"><b>New Password</b></td> <td align="left" width="50%"><lj:password name="password" /></td> </tr> <tr> <td align="left"><b>New Password Again</b></td> <td align="left" width="50%"><lj:password name="password2" /></td> </tr> <tr> <td align="right"><lj:button submit="true" name="submit" value="Reset" /></td> <td align="left" width="50%"><input type="button" name="button2" id="button2" value="Cancel" onclick="window.location='<lj:url resource="pages/login.jsp"/>'; return false;"/></td> </tr> </table> </lj:resetPassword>
Update Profile Tag
Renders an HTML form element whose action attribute is assigned to "update_profile" action.
User is expected to supply all the form elements that are expected for this action. Refer to Update Profile action.
- Example
<%@taglib prefix="lj" uri="/LJTagLib"%> <lj:updateProfile name="" onError="pages/updateProfile.jsp" onSuccess="pages/home.jsp" prefill="true"> <table border="0" cellpadding="0" cellspacing="5"> <lj:detailData object="USER_PROFILE" controller="Platform" recordVariable="profile"> <tr> <td class="side-link" ${empty __response ? "" : (__response.code < 0 ? "style=\"color:red\"" : "")} colspan="2"> ${empty __response ? "" : __response.message} </td> </tr> <tr> <td align="left"><b>First Name</b></td> <td align="left"><lj:text name="first_name" value="${profile.parameters.first_name}" /> </td> </tr> <tr> <td align="left"><b>Last Name</b></td> <td align="left"><lj:text name="last_name" value="${profile.parameters.last_name}" /> </td> </tr> <tr> <td align="left"><b>Email</b></td> <td align="left"><lj:text name="email" value="${profile.parameters.email}" /> </td> </tr> <tr> <td align="left"><b>Street</b></td> <td align="left"><lj:text name="street" value="${profile.parameters.street}" /> </td> </tr> <tr> <td align="left"><b>City</b></td> <td align="left"><lj:text name="city" value="${profile.parameters.city}" /> </td> </tr> <tr> <td align="left"><b>State</b></td> <td align="left"><lj:text name="state" value="${profile.parameters.state}" /> </td> <tr> <td align="left"><b>Zip</b></td> <td align="left"><lj:text name="zip" value="${profile.parameters.zip}" /> </td> </tr> <tr> <td align="left"><b>Country</b></td> <td align="left"><lj:text name="country" value="${profile.parameters.country}" /> </td> </tr> <tr> <td align="left"><b>Company</b></td> <td align="left"><lj:text name="company" value="${profile.parameters.company}" /> </td> </tr> <tr> <td align="left"><b>Title</b></td> <td align="left"><lj:text name="title" value="${profile.parameters.title}" /> </td> </tr> <tr> <td align="left"><b>Division</b></td> <td align="left"><lj:text name="division" value="${profile.parameters.division}" /> </td> <tr> <td align="left"><b>Phone</b></td> <td align="left"><lj:text name="phone" value="${profile.parameters.phone}" /> </td> </tr> <tr> <td align="left"><b>Fax</b></td> <td align="left"><lj:text name="fax" value="${profile.parameters.fax}" /> </td> </tr> <tr> <td align="left"><b>Mobile</b></td> <td align="left"><lj:text name="mobile" value="${profile.parameters.mobile}" /> </td> </tr> <tr> <td align="left"><b>Security Question</b></td> <td align="left"><lj:text name="custom_security_question" value="${profile.parameters.custom_security_question}" /> </td> </tr> <tr> <td align="left"><b>Security Answer</b></td> <td align="left"><lj:text name="security_answer" value="${profile.parameters.security_answer}" /> </td> </tr> </lj:detailData> <tr> <td align="right"><lj:button submit="true" name="submit" value="Update" /></td> <td align="left"><input type="submit" name="button2" id="button2" value="Cancel" onclick="window.location='<lj:url resource="pages/home.jsp"/>'; return false;"/></td> </tr> </table> </lj:updateProfile>
Validate Security Question Tag
Renders an HTML form element whose action attribute is assigned to "validate_security_question" action.
User is expected to supply all the form elements that are expected for this action. Refer to Validate Security Question action.
- Example
<%@taglib prefix="lj" uri="/LJTagLib"%> <lj:validateSecurityQuestion name="" onError="pages/secQuestion.jsp" onSuccess="pages/resetPassword.jsp" prefill="true"> <table border="0" cellpadding="5" cellspacing="0"> <tr> <td colspan="2" ${empty __response ? "" : (__response.code < 0 ? "style=\"color:red\"" : "")} colspan="2"> ${empty __response ? "" : __response.message} </td> <td> </td> </tr> <lj:detailData object="USER_PROFILE" controller="Platform" recordVariable="user" recordId="${param['username']}"> <tr> <td ${empty user ? "" : (user.code < 0 ? "style=\"color:red\"" : "")} colspan="2"> ${empty user ? "" : user.message} </td> </tr> <tr> <td align="left"><b>Username</b></td> <td align="left">${user.parameters.username}<lj:hidden name="username" value="${user.parameters.username}"/></td> </tr> <tr> <td align="left"><b>Security Question</b></td> <td align="left">${user.parameters.custom_security_question} <lj:hidden name="custom_security_question" value="${user.parameters.custom_security_question}"/></td> </tr> <tr> <td align="left"><b>Security Answer</b></td> <td align="left"><lj:text name="security_answer" value="${security_answer}"/></td> </tr> <tr> <td align="right"><lj:button submit="true" name="submit" value="Submit"/></td> <td align="left"><input type="submit" name="button2" id="button2" value="Cancel" onclick="window.location='<lj:url resource="pages/login.jsp"/>'; return false;"/></td> </tr> </lj:detailData> </table> </lj:validateSecurityQuestion>